Cavestory Mod API
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
DropdownBoxInfo Class Reference

Show a dropdown box. More...

#include <CSMAPI_types.h>

Inheritance diagram for DropdownBoxInfo:
GuiBase

Classes

struct  DBI_Item
 Dropdown box item struct. More...
 

Public Member Functions

 DropdownBoxInfo ()
 Default constructor.
 
 ~DropdownBoxInfo ()
 Default deconstructor.
 
virtual const char * getClassName ()
 Get this class' name. More...
 
const char * getItemText (int index)
 Get item text by index. More...
 
virtual void setFont (FontObject *pFont)
 Set this element's font. More...
 
virtual FontObject * getFont ()
 Get the font for this GUI element. More...
 
void addItem (const char *text)
 Add an item to the list. More...
 
void clearItems ()
 Clear all items.
 
int getCount ()
 Get number of selectable options. More...
 
void setSelectedItem (int iItemId)
 Set the selected item.
 
ScrollAreaInfogetScroll ()
 Get the scroll object. More...
 
virtual void setIsOpen (bool bIsOpen)
 Set whether this dropdown box is open or not. More...
 
virtual bool getIsOpen ()
 Get whether this dropdown box is opened or not. More...
 
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...
 
virtual int processKeys ()
 Process key input for this element. More...
 
virtual int process (GUI_POINT mouse)
 Process mouse input for this element. More...
 
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 int getMagnification ()
 
 GuiBase (const GuiBase &)=delete
 
GuiBaseoperator= (const GuiBase &)=delete
 
 GuiBase (GuiBase &&)=delete
 
GuiBaseoperator= (GuiBase &&)=delete
 

Static Public Member Functions

static int GetDropdownBoxHeight (FontObject *pFont=NULL, int iTextMargin=-1)
 Get the height of a normal dropdown box. More...
 

Public Attributes

GUI_RECT containing_rect
 Containing rect.
 
GUI_COLOR mText_Disabled
 The color of the text when the element is disabled.
 
GUI_COLOR mText_Normal
 The color of the text when the element is normal.
 
GUI_COLOR mText_ListSelected
 The color of the text when the element is selected in the list.
 
GUI_COLOR mText_NotSelected
 The color of the text when the element is not selected.
 
bool mDisabled
 Whether this element is disabled or not.
 
int mTextMargin
 Text margin.
 
int mItemMargin
 Item margin.
 
int mSelected
 Whether the dropbox is expanded or not.
 
- 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'.
 

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
 
- 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.
 

Detailed Description

Show a dropdown box.

Member Function Documentation

◆ addItem()

void DropdownBoxInfo::addItem ( const char *  text)

Add an item to the list.

Parameters
textThe text of the item.

◆ calculate()

virtual void DropdownBoxInfo::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* DropdownBoxInfo::getClassName ( )
inlinevirtual

Get this class' name.

Returns
Should return the name of this class.

Reimplemented from GuiBase.

◆ getCount()

int DropdownBoxInfo::getCount ( )

Get number of selectable options.

Returns
Returns number of selectable options.

◆ GetDropdownBoxHeight()

static int DropdownBoxInfo::GetDropdownBoxHeight ( FontObject *  pFont = NULL,
int  iTextMargin = -1 
)
static

Get the height of a normal dropdown box.

Parameters
pFontThe font to use in the calculation. Leave as 'NULL' to use BaseModeInstance::GetDefaultFont().
iTextMarginThe margin for the text. Leave as '-1' to use default values.
Returns
Returns the height of the hypothetical dropdown box.

◆ getFont()

virtual FontObject* DropdownBoxInfo::getFont ( )
inlinevirtual

Get the font for this GUI element.

Returns
Returns the font object for this element.

Reimplemented from GuiBase.

◆ getHoverableCount()

virtual int DropdownBoxInfo::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.

◆ getIsOpen()

virtual bool DropdownBoxInfo::getIsOpen ( )
virtual

Get whether this dropdown box is opened or not.

Returns
Returns true if it's open, false otherwise.

◆ getItemText()

const char* DropdownBoxInfo::getItemText ( int  index)

Get item text by index.

Parameters
indexThe index of the item
Returns
Returns the item text for the item at the index. Returns NULL if not valid.

◆ getScroll()

ScrollAreaInfo* DropdownBoxInfo::getScroll ( )

Get the scroll object.

Returns
Returns the scroll object.

◆ getSelectableCount()

virtual int DropdownBoxInfo::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 DropdownBoxInfo::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 DropdownBoxInfo::isHoverable ( )
virtual

Check hoverability status.

Returns
Returns true if this element can be hovered over.

Implements GuiBase.

◆ isHovered()

virtual bool DropdownBoxInfo::isHovered ( )
virtual

Check hover status.

Returns
Returns true if this element is being hovered over.

Implements GuiBase.

◆ isSelected()

virtual bool DropdownBoxInfo::isSelected ( )
virtual

Check selection status.

Returns
Returns true if this element is selected.

Implements GuiBase.

◆ process()

virtual int DropdownBoxInfo::process ( GUI_POINT  mouse)
virtual

Process mouse input for this element.

Returns
Returns ProcessReturnType flags.
See also
ProcessReturnType

Implements GuiBase.

◆ processKeys()

virtual int DropdownBoxInfo::processKeys ( )
virtual

Process key input for this element.

Returns
Returns ProcessReturnType flags.
See also
ProcessReturnType

Reimplemented from GuiBase.

◆ setFont()

virtual void DropdownBoxInfo::setFont ( FontObject *  pFont)
virtual

Set this element's font.

Parameters
pFontThe new font.

Reimplemented from GuiBase.

◆ setHovered()

virtual void DropdownBoxInfo::setHovered ( int  value)
virtual

Set this GUI element as hovered over or not.

Parameters
valueThe hover value.

Implements GuiBase.

◆ setIsOpen()

virtual void DropdownBoxInfo::setIsOpen ( bool  bIsOpen)
virtual

Set whether this dropdown box is open or not.

Parameters
bIsOpenThe value to set.

◆ setSelected()

virtual void DropdownBoxInfo::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: