Cavestory Mod API
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
SystemMenuInfo Class Reference

Show a dropdown box. More...

#include <CSMAPI_types.h>

Inheritance diagram for SystemMenuInfo:
GuiBase

Public Member Functions

 SystemMenuInfo ()
 Default constructor.
 
 ~SystemMenuInfo ()
 Default deconstructor.
 
virtual const char * getClassName ()
 Get this class' name. More...
 
void setFont (FontObject *pFont)
 Set this element's font. More...
 
SystemMenuItemAddItem (int iItemId, const char *pText, SystemMenuItem *pParent=NULL, Input::KeyShortcut *pShortcut=NULL)
 Add an item to the list. More...
 
SystemMenuItemGetItemByText (const char *pText)
 Get a menu item by text. More...
 
SystemMenuItemGetItemById (int iItemId)
 Get a menu item by its ID. More...
 
SystemMenuItemGetItemByIndex (int iIndex)
 Get a menu item by its index number. More...
 
int GetItemCount ()
 Gets the total amount of items in this menu. More...
 
void ClearItems ()
 Clear all items.
 
void DumpItems ()
 Dump items.
 
virtual void setSelected (int value)
 Set this GUI element as selected or not. More...
 
virtual void setHovered (int value)
 Set this GUI element as hovered over or not. More...
 
virtual bool isSelected ()
 Check selection status. More...
 
virtual bool isHovered ()
 Check hover status. More...
 
virtual bool isHoverable ()
 Check hoverability status. More...
 
virtual int getSelectableCount ()
 Get the selectable number of elements in this element. More...
 
virtual int getHoverableCount ()
 Get the number of elements that can be hovered over in this element. More...
 
int processShortcuts ()
 Process shortcuts.
 
virtual int processKeys ()
 Process key input for this element. More...
 
virtual int process (GUI_POINT mouse)
 Process mouse input for this element. More...
 
void closeMenu ()
 Close this menu.
 
virtual void calculate ()
 Re-calculate this element's data. More...
 
virtual void render ()
 Render this element.
 
virtual void importantRender ()
 Render the important bits of this element. More...
 
- Public Member Functions inherited from GuiBase
 GuiBase ()
 Default constructor.
 
virtual ~GuiBase ()
 Default deconstructor.
 
virtual GuiBasegetHoverable (int index)
 Get a hoverable sub-element. More...
 
virtual GuiBasegetSelectable (int index)
 Get a selectable sub-element. More...
 
virtual bool SelectOnMouseUp ()
 Select on mouse up. More...
 
virtual FontObject * getFont ()
 Get the font for this GUI element. More...
 
virtual int getMagnification ()
 
 GuiBase (const GuiBase &)=delete
 
GuiBaseoperator= (const GuiBase &)=delete
 
 GuiBase (GuiBase &&)=delete
 
GuiBaseoperator= (GuiBase &&)=delete
 

Public Attributes

struct {
   unsigned long   text_normal
 Normal text color.
 
   unsigned long   submenu_itembg_hovered
 Item background's color when hovered over.
 
   unsigned long   submenu_itembg_selected
 Item background's color when selected.
 
   unsigned long   background
 Background color.
 
mColors
 
int mItemMargin
 Item margin.
 
- Public Attributes inherited from GuiBase
GuiBasepNext
 
GuiBasepPrev
 
OnValueChangeCallbackFunc OnValueChange
 Called in specific GuiBase children classes to indicate that a value has been changed.
 
OnValidateChangeCallbackFunc OnValidateChange
 Called in specific GuiBase children classes to indicate that a value has been changed.
 
GUI_RECT rect
 The display rect this GUI element will use.
 
void * userData
 Custom user data.
 
void * userData2
 Custom user data.
 
unsigned int customMagnification
 The magnification to display this element at.
 
OnHoverChangeCallbackFunc OnHoverChange
 Called in specific GuiBase children classes to indicate that the GUI element is being hovered over.
 
bool has_special_mouse_processing
 Has special mouse processing.
 
GUI_RECT hotspot_rect
 The special hotspot rect.
 
bool has_special_hotspot_rect
 Has special hotspot rect; If true, 'process' will be called everytime the mouse is inside of 'hotspot_rect' instead of 'rect'.
 

Protected Member Functions

SystemMenuItemAllocateItem ()
 Allocate a new item. More...
 
void position_menu_items (SystemMenuItem *pItem)
 Position menu items. More...
 
- Protected Member Functions inherited from GuiBase
void Link ()
 Link ourselves to the global GUI element linkage.
 
void Unlink ()
 Unlink ourselves from the global GUI element linkage.
 

Additional Inherited Members

- Public Types inherited from GuiBase
enum  ProcessReturnType {
  PRT_DIRTY = 0b000001 , PRT_IGNORE_MOUSE = 0b000010 , PRT_IGNORE_KEYS = 0b000100 , PRT_SELECTED = 0b001000 ,
  PRT_DISABLE_MOUSE_ON_MOVE = 0b010000 , PRT_CHANGED = 0b100000
}
 Return flags for GuiBase::process and GuiBase::processKeys. More...
 
typedef void(* OnHoverChangeCallbackFunc) (GuiBase *, int value)
 Hover callback.
 
typedef void(* OnValueChangeCallbackFunc) (GuiBase *, const char *&newValue)
 Value change callback.
 
typedef bool(* OnValidateChangeCallbackFunc) (GuiBase *, const char *oldValue, char *newValue)
 Validate change callback.
 
- Static Public Attributes inherited from GuiBase
static unsigned int defaultCustomMagnification
 
static GuiBasegFirst
 

Detailed Description

Show a dropdown box.

Member Function Documentation

◆ AddItem()

SystemMenuItem* SystemMenuInfo::AddItem ( int  iItemId,
const char *  pText,
SystemMenuItem pParent = NULL,
Input::KeyShortcut *  pShortcut = NULL 
)

Add an item to the list.

Parameters
iItemIdThe ID of the item.
pTextThe text of the new item.
pParentThe parent of the new item. Can be NULL.
Returns
Returns SMI_Item if it's valid.

◆ AllocateItem()

SystemMenuItem* SystemMenuInfo::AllocateItem ( )
protected

Allocate a new item.

Returns
Returns the newly allocated item.

◆ calculate()

virtual void SystemMenuInfo::calculate ( )
virtual

Re-calculate this element's data.

Warning
You should ALWAYS call this at least once BEFORE you call render()!

Implements GuiBase.

◆ getClassName()

virtual const char* SystemMenuInfo::getClassName ( )
inlinevirtual

Get this class' name.

Returns
Should return the name of this class.

Reimplemented from GuiBase.

◆ getHoverableCount()

virtual int SystemMenuInfo::getHoverableCount ( )
inlinevirtual

Get the number of elements that can be hovered over in this element.

Returns
Returns the amount of elements that can be hovered over in this element.

Reimplemented from GuiBase.

◆ GetItemById()

SystemMenuItem* SystemMenuInfo::GetItemById ( int  iItemId)

Get a menu item by its ID.

Parameters
iItemIdThe ID to search for.
Returns
Returns the SMI_Item if it exists, NULL otherwise.

◆ GetItemByIndex()

SystemMenuItem* SystemMenuInfo::GetItemByIndex ( int  iIndex)

Get a menu item by its index number.

Parameters
iIndexThe index number.
Returns
Returns the SMI_Item if it exists, NULL otherwise.

◆ GetItemByText()

SystemMenuItem* SystemMenuInfo::GetItemByText ( const char *  pText)

Get a menu item by text.

Parameters
pTextThe text to search for.
Returns
Returns the SMI_Item if it exists, NULL otherwise.

◆ GetItemCount()

int SystemMenuInfo::GetItemCount ( )

Gets the total amount of items in this menu.

Returns
Returns the total amount of items.

◆ getSelectableCount()

virtual int SystemMenuInfo::getSelectableCount ( )
inlinevirtual

Get the selectable number of elements in this element.

Returns
Returns the amount of selectable elements in this element.

Reimplemented from GuiBase.

◆ importantRender()

virtual void SystemMenuInfo::importantRender ( )
virtual

Render the important bits of this element.

Note
This function is used to draw things that should be at the front of the screen, so make sure to call it AFTER rendering everything else.

Reimplemented from GuiBase.

◆ isHoverable()

virtual bool SystemMenuInfo::isHoverable ( )
virtual

Check hoverability status.

Returns
Returns true if this element can be hovered over.

Implements GuiBase.

◆ isHovered()

virtual bool SystemMenuInfo::isHovered ( )
virtual

Check hover status.

Returns
Returns true if this element is being hovered over.

Implements GuiBase.

◆ isSelected()

virtual bool SystemMenuInfo::isSelected ( )
virtual

Check selection status.

Returns
Returns true if this element is selected.

Implements GuiBase.

◆ position_menu_items()

void SystemMenuInfo::position_menu_items ( SystemMenuItem pItem)
protected

Position menu items.

Parameters
pItemThe item to position.

◆ process()

virtual int SystemMenuInfo::process ( GUI_POINT  mouse)
virtual

Process mouse input for this element.

Returns
Returns ProcessReturnType flags.
See also
ProcessReturnType

Implements GuiBase.

◆ processKeys()

virtual int SystemMenuInfo::processKeys ( )
virtual

Process key input for this element.

Returns
Returns ProcessReturnType flags.
See also
ProcessReturnType

Reimplemented from GuiBase.

◆ setFont()

void SystemMenuInfo::setFont ( FontObject *  pFont)
inlinevirtual

Set this element's font.

Parameters
pFontThe new font.

Reimplemented from GuiBase.

◆ setHovered()

virtual void SystemMenuInfo::setHovered ( int  value)
virtual

Set this GUI element as hovered over or not.

Parameters
valueThe hover value.

Implements GuiBase.

◆ setSelected()

virtual void SystemMenuInfo::setSelected ( int  value)
virtual

Set this GUI element as selected or not.

Parameters
valueThe selection value.

Implements GuiBase.


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