Public Member Functions

SourceMod::IMenuPanel Class Reference

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

#include <public/IMenuManager.h>

List of all members.

Public Member Functions

virtual IMenuStyleGetParentStyle ()=0
 Returns the parent IMenuStyle pointer.
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.
virtual unsigned int DrawItem (const ItemDrawInfo &item)=0
 Adds an item to the menu and returns the position (1-10).
virtual bool DrawRawLine (const char *rawline)=0
 Draws a raw line of text, if supported. The line does not need to be newline terminated.
virtual bool SetExtOption (MenuOption option, const void *valuePtr)=0
 Sets an extended menu option.
virtual bool CanDrawItem (unsigned int drawFlags)=0
 Returns whether the display is capable of rendering an item with the given flags.
virtual bool SendDisplay (int client, IMenuHandler *handler, unsigned int time)=0
 Sends the menu display to a client.
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.
virtual unsigned int GetCurrentKey ()=0
 Returns the current key position.
virtual bool SetCurrentKey (unsigned int key)=0
 Sets the next key position. This cannot be used to traverse backwards.
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.
virtual unsigned int GetApproxMemUsage ()=0
 For the Handle system, returns approximate memory usage.

Detailed Description

Sets how a raw menu should be drawn.

Definition at line 215 of file IMenuManager.h.


Member Function Documentation

virtual IMenuStyle* SourceMod::IMenuPanel::GetParentStyle (  )  [pure virtual]

Returns the parent IMenuStyle pointer.

Returns:
IMenuStyle pointer which created this object.
virtual void SourceMod::IMenuPanel::DrawTitle ( const char *  text,
bool  onlyIfEmpty = false 
) [pure virtual]

Sets how the title should be drawn.

Parameters:
text Text string to display for the title.
onlyIfEmpty Only sets the title if one does not already exist.
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 bool SourceMod::IMenuPanel::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 bool SourceMod::IMenuPanel::CanDrawItem ( unsigned int  drawFlags  )  [pure virtual]

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

Parameters:
drawFlags ITEMDRAW flags.
Returns:
True if renderable, false otherwise.
virtual bool SourceMod::IMenuPanel::SendDisplay ( int  client,
IMenuHandler handler,
unsigned int  time 
) [pure virtual]

Sends the menu display to a client.

Parameters:
client Client index to display to.
handler Menu handler to use.
time Time to hold menu for.
Returns:
True on success, false otherwise.
virtual bool SourceMod::IMenuPanel::SetSelectableKeys ( unsigned int  keymap  )  [pure virtual]

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

Parameters:
keymap A 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.
virtual unsigned int SourceMod::IMenuPanel::GetCurrentKey (  )  [pure virtual]

Returns the current key position.

Returns:
Current key position starting at 1.
virtual bool SourceMod::IMenuPanel::SetCurrentKey ( unsigned int  key  )  [pure virtual]

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

Parameters:
key Key that is greater or equal to GetCurrentKey().
Returns:
True on success, false otherwise.
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.

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