SourceMod::IBaseMenu Class Reference

High-level interface for building menus. More...

#include <public/IMenuManager.h>

List of all members.

Public Member Functions

virtual bool AppendItem (const char *info, const ItemDrawInfo &draw)=0
 Appends an item to the end of a menu.
virtual bool InsertItem (unsigned int position, const char *info, const ItemDrawInfo &draw)=0
 Inserts an item into the menu before a certain position; the new item will be at the given position and all next items pushed forward.
virtual bool RemoveItem (unsigned int position)=0
 Removes an item from the menu.
virtual void RemoveAllItems ()=0
 Removes all items from the menu.
virtual const char * GetItemInfo (unsigned int position, ItemDrawInfo *draw)=0
 Returns an item's info.
virtual unsigned int GetItemCount ()=0
 Returns the number of items.
virtual bool SetPagination (unsigned int itemsPerPage)=0
 Sets the menu's pagination,.
virtual unsigned int GetPagination ()=0
 Returns an item's pagination.
virtual IMenuStyleGetDrawStyle ()=0
 Returns the menu style.
virtual void SetDefaultTitle (const char *message)=0
 Sets the menu's display title/message.
virtual const char * GetDefaultTitle ()=0
 Returns the menu's display/title message.
virtual bool SetExtOption (MenuOption option, const void *valuePtr)=0
 Sets an extended menu option.
virtual IMenuPanelCreatePanel ()=0
 Creates a new IMenuPanel object using extended options specific to the IMenuStyle parent. Titles, items, etc, are not copied.
virtual bool Display (int client, unsigned int time, IMenuHandler *alt_handler=NULL)=0
 Sends the menu to a client.
virtual void Destroy (bool releaseHandle=true)=0
 Destroys the menu and frees all associated resources.
virtual void Cancel ()=0
 Cancels the menu on all client's displays. While the menu is being cancelled, the menu may not be re-displayed to any clients. If a vote menu is currently active, it will be cancelled as well.
virtual Handle_t GetHandle ()=0
 Returns the menu's Handle. The Handle is automatically removed when the menu is destroyed.
virtual unsigned int GetMenuOptionFlags ()=0
 Returns menu option flags.
virtual void SetMenuOptionFlags (unsigned int flags)=0
 Sets menu option flags.
virtual IMenuHandlerGetHandler ()=0
 Returns the menu's handler.
virtual bool DisplayAtItem (int client, unsigned int time, unsigned int start_item, IMenuHandler *alt_handler=NULL)=0
 Sends the menu to a client, starting from the given item number.
virtual unsigned int GetApproxMemUsage ()=0
 For the Handle system, returns approximate memory usage.


Detailed Description

High-level interface for building menus.

Definition at line 428 of file IMenuManager.h.


Member Function Documentation

virtual bool SourceMod::IBaseMenu::AppendItem ( const char *  info,
const ItemDrawInfo draw 
) [pure virtual]

Appends an item to the end of a menu.

Parameters:
info Item information string.
draw Default drawing information.
Returns:
True on success, false on item limit reached.

virtual bool SourceMod::IBaseMenu::InsertItem ( unsigned int  position,
const char *  info,
const ItemDrawInfo draw 
) [pure virtual]

Inserts an item into the menu before a certain position; the new item will be at the given position and all next items pushed forward.

Parameters:
position Position, starting from 0.
info Item information string.
draw Default item draw info.
Returns:
True on success, false on invalid menu position

virtual bool SourceMod::IBaseMenu::RemoveItem ( unsigned int  position  )  [pure virtual]

Removes an item from the menu.

Parameters:
position Position, starting from 0.
Returns:
True on success, false on invalid menu position.

virtual const char* SourceMod::IBaseMenu::GetItemInfo ( unsigned int  position,
ItemDrawInfo draw 
) [pure virtual]

Returns an item's info.

Parameters:
position Position, starting from 0.
draw Optional pointer to store a draw information.
Returns:
Info string pointer, or NULL if position was invalid.

virtual unsigned int SourceMod::IBaseMenu::GetItemCount (  )  [pure virtual]

Returns the number of items.

Returns:
Number of items in the menu.

virtual bool SourceMod::IBaseMenu::SetPagination ( unsigned int  itemsPerPage  )  [pure virtual]

Sets the menu's pagination,.

If pagination is set to MENU_NO_PAGINATION, and the previous pagination was not MENU_NO_PAGINATION, then the MENUFLAG_BUTTON_EXIT is unset. It can be re-applied if desired.

Parameters:
itemsPerPage Number of items per page, or MENU_NO_PAGINATION.
Returns:
True on success, false if itemsPerPage is too large.

virtual unsigned int SourceMod::IBaseMenu::GetPagination (  )  [pure virtual]

Returns an item's pagination.

Returns:
Pagination setting.

virtual IMenuStyle* SourceMod::IBaseMenu::GetDrawStyle (  )  [pure virtual]

Returns the menu style.

Returns:
Menu style.

virtual void SourceMod::IBaseMenu::SetDefaultTitle ( const char *  message  )  [pure virtual]

Sets the menu's display title/message.

Parameters:
message Message (format options allowed).

virtual const char* SourceMod::IBaseMenu::GetDefaultTitle (  )  [pure virtual]

Returns the menu's display/title message.

Returns:
Message string.

virtual bool SourceMod::IBaseMenu::SetExtOption ( MenuOption  option,
const void *  valuePtr 
) [pure virtual]

Sets an extended menu option.

Parameters:
option Option type.
valuePtr Pointer of the type expected by the option.
Returns:
True on success, false if option or value is not supported.

virtual IMenuPanel* SourceMod::IBaseMenu::CreatePanel (  )  [pure virtual]

Creates a new IMenuPanel object using extended options specific to the IMenuStyle parent. Titles, items, etc, are not copied.

Note: The object should be freed with IMenuPanel::DeleteThis.

Returns:
IMenuPanel pointer.

virtual bool SourceMod::IBaseMenu::Display ( int  client,
unsigned int  time,
IMenuHandler alt_handler = NULL 
) [pure virtual]

Sends the menu to a client.

Parameters:
client Client index to display to.
time Time to hold menu for.
alt_handler Alternate IMenuHandler.
Returns:
True on success, false otherwise.

virtual void SourceMod::IBaseMenu::Destroy ( bool  releaseHandle = true  )  [pure virtual]

Destroys the menu and frees all associated resources.

Parameters:
releaseHandle If true, the Handle will be released in the destructor. This should be set to true except for IHandleTypeDispatch destructors.

virtual void SourceMod::IBaseMenu::Cancel (  )  [pure virtual]

Cancels the menu on all client's displays. While the menu is being cancelled, the menu may not be re-displayed to any clients. If a vote menu is currently active, it will be cancelled as well.

Returns:
Number of menus cancelled.

virtual Handle_t SourceMod::IBaseMenu::GetHandle (  )  [pure virtual]

Returns the menu's Handle. The Handle is automatically removed when the menu is destroyed.

Returns:
Handle_t handle value.

virtual unsigned int SourceMod::IBaseMenu::GetMenuOptionFlags (  )  [pure virtual]

Returns menu option flags.

Returns:
Menu option flags.

virtual void SourceMod::IBaseMenu::SetMenuOptionFlags ( unsigned int  flags  )  [pure virtual]

Sets menu option flags.

Parameters:
flags Menu option flags.

virtual IMenuHandler* SourceMod::IBaseMenu::GetHandler (  )  [pure virtual]

Returns the menu's handler.

Returns:
IMenuHandler of the menu.

virtual bool SourceMod::IBaseMenu::DisplayAtItem ( int  client,
unsigned int  time,
unsigned int  start_item,
IMenuHandler alt_handler = NULL 
) [pure virtual]

Sends the menu to a client, starting from the given item number.

Note: this API call was added in v13.

Parameters:
client Client index to display to.
time Time to hold menu for.
start_item Starting item to draw.
alt_handler Alternate IMenuHandler.
Returns:
True on success, false otherwise.

virtual unsigned int SourceMod::IBaseMenu::GetApproxMemUsage (  )  [pure virtual]

For the Handle system, returns approximate memory usage.

Returns:
Approximate number of bytes being used.


The documentation for this class was generated from the following file:
Generated on Fri Nov 21 05:10:04 2008 for SourceMod SDK by  doxygen 1.5.1