SourceMod SDK  1.7
SourceMod::IMenuPanel Class Referenceabstract

Sets how a raw menu should be drawn. More...

#include <public/IMenuManager.h>

Public Member Functions

virtual IMenuStyleGetParentStyle ()=0
 Returns the parent IMenuStyle pointer. More...
 
virtual void Reset ()=0
 Resets/clears the cached display text.
 
virtual void DrawTitle (const char *text, bool onlyIfEmpty=false)=0
 Sets how the title should be drawn. More...
 
virtual unsigned int DrawItem (const ItemDrawInfo &item)=0
 Adds an item to the menu and returns the position (1-10). More...
 
virtual bool DrawRawLine (const char *rawline)=0
 Draws a raw line of text, if supported. The line does not need to be newline terminated. More...
 
virtual bool SetExtOption (MenuOption option, const void *valuePtr)=0
 Sets an extended menu option. More...
 
virtual bool CanDrawItem (unsigned int drawFlags)=0
 Returns whether the display is capable of rendering an item with the given flags. More...
 
virtual bool SendDisplay (int client, IMenuHandler *handler, unsigned int time)=0
 Sends the menu display to a client. More...
 
virtual void DeleteThis ()=0
 Destroys the display object.
 
virtual bool SetSelectableKeys (unsigned int keymap)=0
 Sets the selectable key map. Returns false if the function is not supported. More...
 
virtual unsigned int GetCurrentKey ()=0
 Returns the current key position. More...
 
virtual bool SetCurrentKey (unsigned int key)=0
 Sets the next key position. This cannot be used to traverse backwards. More...
 
virtual int GetAmountRemaining ()=0
 Returns the number of characters that can be added to the menu. The internal buffer is truncated if overflowed; this is for manual truncation/wrapping purposes. More...
 
virtual unsigned int GetApproxMemUsage ()=0
 For the Handle system, returns approximate memory usage. More...
 
virtual bool DirectSet (const char *str)=0
 Sets panel content directly. More...
 

Detailed Description

Sets how a raw menu should be drawn.

Member Function Documentation

virtual bool SourceMod::IMenuPanel::CanDrawItem ( unsigned int  drawFlags)
pure virtual

Returns whether the display is capable of rendering an item with the given flags.

Parameters
drawFlagsITEMDRAW flags.
Returns
True if renderable, false otherwise.
virtual bool SourceMod::IMenuPanel::DirectSet ( const char *  str)
pure virtual

Sets panel content directly.

Parameters
strNew panel contents.
Returns
True if supported, otherwise false.
virtual unsigned int SourceMod::IMenuPanel::DrawItem ( const ItemDrawInfo item)
pure virtual

Adds an item to the menu and returns the position (1-10).

Note: Item will fail to draw if there are too many items, or the item is not drawable (for example, invisible).

Returns
Item draw position, or 0 on failure.
virtual bool SourceMod::IMenuPanel::DrawRawLine ( const char *  rawline)
pure virtual

Draws a raw line of text, if supported. The line does not need to be newline terminated.

Returns
True on success, false if not supported.
virtual void SourceMod::IMenuPanel::DrawTitle ( const char *  text,
bool  onlyIfEmpty = false 
)
pure virtual

Sets how the title should be drawn.

Parameters
textText string to display for the title.
onlyIfEmptyOnly sets the title if one does not already exist.
virtual int SourceMod::IMenuPanel::GetAmountRemaining ( )
pure virtual

Returns the number of characters that can be added to the menu. The internal buffer is truncated if overflowed; this is for manual truncation/wrapping purposes.

Returns
Number of bytes available. If the result is -1, then the panel has no text limit.
virtual unsigned int SourceMod::IMenuPanel::GetApproxMemUsage ( )
pure virtual

For the Handle system, returns approximate memory usage.

Returns
Approximate number of bytes being used.
virtual unsigned int SourceMod::IMenuPanel::GetCurrentKey ( )
pure virtual

Returns the current key position.

Returns
Current key position starting at 1.
virtual IMenuStyle* SourceMod::IMenuPanel::GetParentStyle ( )
pure virtual

Returns the parent IMenuStyle pointer.

Returns
IMenuStyle pointer which created this object.
virtual bool SourceMod::IMenuPanel::SendDisplay ( int  client,
IMenuHandler handler,
unsigned int  time 
)
pure virtual

Sends the menu display to a client.

Parameters
clientClient index to display to.
handlerMenu handler to use.
timeTime to hold menu for.
Returns
True on success, false otherwise.
virtual bool SourceMod::IMenuPanel::SetCurrentKey ( unsigned int  key)
pure virtual

Sets the next key position. This cannot be used to traverse backwards.

Parameters
keyKey that is greater or equal to GetCurrentKey().
Returns
True on success, false otherwise.
virtual bool SourceMod::IMenuPanel::SetExtOption ( MenuOption  option,
const void *  valuePtr 
)
pure virtual

Sets an extended menu option.

Parameters
optionOption type.
valuePtrPointer of the type expected by the option.
Returns
True on success, false if option or value is not supported.
virtual bool SourceMod::IMenuPanel::SetSelectableKeys ( unsigned int  keymap)
pure virtual

Sets the selectable key map. Returns false if the function is not supported.

Parameters
keymapA bit string where each bit N-1 specifies that key N is selectable (key 0 is bit 9). If the selectable key map is 0, it will be automatically set to allow 0.
Returns
True on success, false if not supported.

The documentation for this class was generated from the following file: