summaryrefslogtreecommitdiff
path: root/utils/hlfaceposer/VGuiWnd.h
blob: 0c8964a6b6f4c90a230b2c091d0dffc39df52c4d (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================

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

#include "mxtk/mx.h"
#include "color.h"

namespace vgui
{
	class EditablePanel;
	typedef unsigned long HCursor;
}

class CVGuiWnd 
{

public:
	CVGuiWnd(void);
	~CVGuiWnd(void);

public:

	void				SetMainPanel( vgui::EditablePanel * pPanel );
	vgui::EditablePanel	*GetMainPanel();	// returns VGUI main panel
	vgui::EditablePanel *CreateDefaultPanel();

	void				SetParentWindow(mxWindow *pParent);
	mxWindow			*GetParentWnd();	// return mxWindow handle

	void				SetCursor(vgui::HCursor cursor);
	void				SetCursor(const char *filename);

	void				SetRepaintInterval( int msecs );
	int					GetVGuiContext();

protected:
	void DrawVGuiPanel();  // overridden to draw this view
	int HandeEventVGui( mxEvent *event );

	vgui::EditablePanel	*m_pMainPanel;
	mxWindow			*m_pParentWnd;
	int					m_hVGuiContext;
	bool				m_bIsDrawing;
	Color				m_ClearColor;
	bool				m_bClearZBuffer;
};

class CVGuiPanelWnd: public mxWindow, public CVGuiWnd
{
	typedef mxWindow BaseClass;

public:

	CVGuiPanelWnd( mxWindow *parent, int x, int y, int w, int h );

	virtual int handleEvent( mxEvent *event ); 
	virtual void redraw();
};


#endif // VGUIWND_H