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.

54 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef MENUBAR_H
  8. #define MENUBAR_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/Panel.h>
  13. #include <utlvector.h>
  14. namespace vgui
  15. {
  16. //-----------------------------------------------------------------------------
  17. // Purpose:
  18. //-----------------------------------------------------------------------------
  19. class MenuBar : public Panel
  20. {
  21. DECLARE_CLASS_SIMPLE( MenuBar, Panel );
  22. public:
  23. MenuBar(Panel *parent, const char *panelName);
  24. ~MenuBar();
  25. virtual void AddButton(MenuButton *button); // add button to end of menu list
  26. virtual void AddMenu( const char *pButtonName, Menu *pMenu );
  27. virtual void GetContentSize( int& w, int&h );
  28. protected:
  29. virtual void OnKeyCodeTyped(KeyCode code);
  30. virtual void OnKeyTyped(wchar_t unichar);
  31. virtual void ApplySchemeSettings(IScheme *pScheme);
  32. virtual void PerformLayout();
  33. virtual void Paint();
  34. MESSAGE_FUNC( OnMenuClose, "MenuClose" );
  35. MESSAGE_FUNC_INT( OnCursorEnteredMenuButton, "CursorEnteredMenuButton", VPanel);
  36. private:
  37. CUtlVector<MenuButton *> m_pMenuButtons;
  38. int m_nRightEdge;
  39. };
  40. } // namespace vgui
  41. #endif // MENUBAR_H