mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 12:06:07 +08:00
Sync with upstream (Issue #30).
Recompiled tier1 and mathlib for all platforms will come in next commit.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user