aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/vgui_controls/Menu.h
diff options
context:
space:
mode:
authorJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
committerJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
commit0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch)
treec831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/public/vgui_controls/Menu.h
parentUpdated the SDK with the latest code from the TF and HL2 branches. (diff)
downloadsource-sdk-2013-master.tar.xz
source-sdk-2013-master.zip
Updated the SDK with the latest code from the TF and HL2 branches.HEADmaster
Diffstat (limited to 'mp/src/public/vgui_controls/Menu.h')
-rw-r--r--mp/src/public/vgui_controls/Menu.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/mp/src/public/vgui_controls/Menu.h b/mp/src/public/vgui_controls/Menu.h
index 2b374373..77937335 100644
--- a/mp/src/public/vgui_controls/Menu.h
+++ b/mp/src/public/vgui_controls/Menu.h
@@ -216,7 +216,7 @@ public:
virtual int GetActiveItem(); // returns the itemID (not the row) of the active item
// Return the number of items currently in the menu list
- virtual int GetItemCount();
+ virtual int GetItemCount() const;
// return the menuID of the n'th item in the menu list, valid from [0, GetItemCount)
virtual int GetMenuID(int index);
@@ -351,6 +351,29 @@ private:
double m_fLastTypeAheadTime;
};
+
+//-----------------------------------------------------------------------------
+// Helper class to create menu
+//-----------------------------------------------------------------------------
+class MenuBuilder
+{
+public:
+
+ MenuBuilder( Menu *pMenu, Panel *pActionTarget );
+
+ MenuItem* AddMenuItem( const char *pszButtonText, const char *pszCommand, const char *pszCategoryName );
+
+ MenuItem* AddCascadingMenuItem( const char *pszButtonText, Menu *pSubMenu, const char *pszCategoryName );
+
+private:
+
+ void AddSepratorIfNeeded( const char *pszCategoryName );
+
+ Menu *m_pMenu;
+ Panel *m_pActionTarget;
+ const char *m_pszLastCategory;
+};
+
} // namespace vgui
#endif // MENU_H