aboutsummaryrefslogtreecommitdiff
path: root/sp/src/utils/common/consolewnd.h
blob: 92649e2ff4718dcafe32c1beae4504f64a18b52b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#ifndef CONSOLEWND_H
#define CONSOLEWND_H
#ifdef _WIN32
#pragma once
#endif


class IConsoleWnd
{
public:
	virtual void	Release() = 0;
	
	// Print a message to the console.
	virtual void	PrintToConsole( const char *pMsg ) = 0;

	// Set the window title.
	virtual void	SetTitle( const char *pTitle ) = 0;

	// Show and hide the console window.
	virtual void	SetVisible( bool bVisible ) = 0;
	virtual bool	IsVisible() const = 0;

	// Normally, the window just hides itself when closed. You can use this to make the window 
	// automatically go away when they close it.
	virtual void	SetDeleteOnClose( bool bDelete ) = 0;
};


// Utility functions.

// This converts adds \r's where necessary and sends the text to the edit control.
void FormatAndSendToEditControl( void *hWnd, const char *pText );


IConsoleWnd* CreateConsoleWnd( void *hInstance, int dialogResourceID, int editControlID, bool bVisible );


#endif // CONSOLEWND_H