summaryrefslogtreecommitdiff
path: root/tools/toolutils/ToolUI.h
blob: 8a7a710d89f25177a7c678e0f8659339c8cadf28 (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
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// The tool UI has 4 purposes:
//		1) Create the menu bar and client area (lies under the menu bar)
//		2) Forward all mouse messages to the tool workspace so action menus work
//		3) Forward all commands to the tool system so all smarts can reside there
//		4) Control the size of the menu bar + the working area
//=============================================================================

#ifndef TOOLUI_H
#define TOOLUI_H

#ifdef _WIN32
#pragma once
#endif

#include "vgui_controls/panel.h"
#include "vgui/mousecode.h"


//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
class CBaseToolSystem;

namespace vgui
{
	class MenuBar;
}

//-----------------------------------------------------------------------------
// The tool UI has 4 purposes:
//		1) Create the menu bar and client area (lies under the menu bar)
//		2) Forward all mouse messages to the tool workspace so action menus work
//		3) Forward all commands to the tool system so all smarts can reside there
//		4) Control the size of the menu bar + the working area
//-----------------------------------------------------------------------------
class CToolUI : public vgui::Panel
{
	DECLARE_CLASS_SIMPLE( CToolUI, vgui::Panel );

public:
	// Constructor
	CToolUI( vgui::Panel *pParent, const char *pPanelName, CBaseToolSystem *pBaseToolSystem );

	// Overrides of panel methods
	virtual void	PerformLayout();
	virtual void	OnCommand( const char *cmd );
	virtual void	OnMousePressed( vgui::MouseCode code );

	virtual void	UpdateMenuBarTitle();

	// Other public methods
	vgui::MenuBar	*GetMenuBar();
	vgui::Panel		*GetClientArea();
	vgui::Panel		*GetStatusBar();

private:
	vgui::MenuBar	*m_pMenuBar;
	vgui::Panel		*m_pStatusBar;
	vgui::Panel		*m_pClientArea;
	CBaseToolSystem *m_pBaseToolSystem;
};


#endif // TOOLUI_H