Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // The tool UI has 4 purposes:
  4. // 1) Create the menu bar and client area (lies under the menu bar)
  5. // 2) Forward all mouse messages to the tool workspace so action menus work
  6. // 3) Forward all commands to the tool system so all smarts can reside there
  7. // 4) Control the size of the menu bar + the working area
  8. //=============================================================================
  9. #ifndef TOOLUI_H
  10. #define TOOLUI_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "vgui_controls/panel.h"
  15. #include "vgui/mousecode.h"
  16. //-----------------------------------------------------------------------------
  17. // Forward declarations
  18. //-----------------------------------------------------------------------------
  19. class CBaseToolSystem;
  20. namespace vgui
  21. {
  22. class MenuBar;
  23. }
  24. //-----------------------------------------------------------------------------
  25. // The tool UI has 4 purposes:
  26. // 1) Create the menu bar and client area (lies under the menu bar)
  27. // 2) Forward all mouse messages to the tool workspace so action menus work
  28. // 3) Forward all commands to the tool system so all smarts can reside there
  29. // 4) Control the size of the menu bar + the working area
  30. //-----------------------------------------------------------------------------
  31. class CToolUI : public vgui::Panel
  32. {
  33. DECLARE_CLASS_SIMPLE( CToolUI, vgui::Panel );
  34. public:
  35. // Constructor
  36. CToolUI( vgui::Panel *pParent, const char *pPanelName, CBaseToolSystem *pBaseToolSystem );
  37. // Overrides of panel methods
  38. virtual void PerformLayout();
  39. virtual void OnCommand( const char *cmd );
  40. virtual void OnMousePressed( vgui::MouseCode code );
  41. virtual void UpdateMenuBarTitle();
  42. // Other public methods
  43. vgui::MenuBar *GetMenuBar();
  44. vgui::Panel *GetClientArea();
  45. vgui::Panel *GetStatusBar();
  46. private:
  47. vgui::MenuBar *m_pMenuBar;
  48. vgui::Panel *m_pStatusBar;
  49. vgui::Panel *m_pClientArea;
  50. CBaseToolSystem *m_pBaseToolSystem;
  51. };
  52. #endif // TOOLUI_H