diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /tools/toolutils/ToolUI.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'tools/toolutils/ToolUI.h')
| -rw-r--r-- | tools/toolutils/ToolUI.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/tools/toolutils/ToolUI.h b/tools/toolutils/ToolUI.h new file mode 100644 index 0000000..8a7a710 --- /dev/null +++ b/tools/toolutils/ToolUI.h @@ -0,0 +1,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 |