Cavestory Mod API
Public Types | Public Member Functions | Public Attributes | List of all members
DraggableWindowInfo Class Reference

Show a clickable button. More...

#include <CSMAPI_types.h>

Inheritance diagram for DraggableWindowInfo:
GuiBase

Public Types

enum  ActionType {
  ACTION_NONE , ACTION_HOVER_CLOSE , ACTION_HOVER_MINMAX , ACTION_CLICK_CLOSE ,
  ACTION_CLICK_MINMAX , ACTION_DRAG , ACTION_RESIZE_LEFT , ACTION_RESIZE_TOP ,
  ACTION_RESIZE_RIGHT , ACTION_RESIZE_BOTTOM , ACTION_RESIZE_BOTTOMLEFT , ACTION_RESIZE_BOTTOMRIGHT ,
  ACTION_RESIZE_TOPLEFT
}
 
typedef void(* OnWindowDraggedFunc) (DraggableWindowInfo *)
 OnPressed Callback.
 
typedef void(* OnWindowCollapsedFunc) (DraggableWindowInfo *)
 OnCollapse Callback.
 
typedef void(* OnWindowExpandedFunc) (DraggableWindowInfo *)
 OnExpand Callback.
 
typedef void(* OnWindowClosedFunc) (DraggableWindowInfo *)
 OnClose Callback.
 
- 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.
 

Public Member Functions

 DraggableWindowInfo ()
 Default constructor.
 
 ~DraggableWindowInfo ()
 Default deconstructor.
 
virtual const char * getClassName ()
 Get this class' name. More...
 
bool isCollapsed ()
 Check to see if this window is collapsed. More...
 
void setCollapsed (bool bValue)
 Set whether this window is collapsed. More...
 
void setText (const char *pValue)
 Set this element's text. 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...
 
GUI_RECT getContentArea ()
 Get the area that content goes in.
 
GUI_RECT getStaticAreaSize ()
 Get the size of the static space that does not change.
 
void setContentSize (GUI_POINT pSize)
 Set the content size of this window.
 
virtual void setFont (FontObject *pFont)
 Set this element's font. More...
 
virtual FontObject * getFont ()
 Get the font for this GUI 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...
 
void calculateTop ()
 Calculate the top.
 
virtual void calculate ()
 Re-calculate this element's data. More...
 
virtual void render ()
 Render this element.
 
- 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 void importantRender ()
 Render the important bits of this element. More...
 
virtual int getMagnification ()
 
 GuiBase (const GuiBase &)=delete
 
GuiBaseoperator= (const GuiBase &)=delete
 
 GuiBase (GuiBase &&)=delete
 
GuiBaseoperator= (GuiBase &&)=delete
 

Public Attributes

int margin
 The text margin for this object.
 
OnWindowDraggedFunc OnDragged
 On drag callback.
 
OnWindowDraggedFunc OnDragStart
 On drag start callback.
 
OnWindowDraggedFunc OnDragEnd
 On drag end callback.
 
OnWindowDraggedFunc OnResizeStart
 On resize start callback.
 
OnWindowDraggedFunc OnResizing
 On resizing callback.
 
OnWindowDraggedFunc OnResizeEnd
 On resize end callback.
 
OnWindowCollapsedFunc OnCollapse
 On collapse callback.
 
OnWindowExpandedFunc OnExpand
 On expand callback.
 
OnWindowClosedFunc OnClose
 On close callback.
 
bool show_button_close
 Show the close button.
 
bool show_button_minmax
 Show the minmax button.
 
bool is_draggable
 Whether this window is draggable or not.
 
bool can_resize_width
 Whether the width of this window can be resized.
 
bool can_resize_height
 Whether the height of this window can be resized.
 
int resize_hotspot_size
 The resize hotspot size.
 
GUI_RECT content_rect
 The rect at which the window's contents should be at.
 
GUI_POINT collapse_position
 The point at which the window is collapsed at.
 
GUI_POINT collapse_normal
 The normal coordinates at which the element will move when positioning relative to collapse_position.
 
GUI_POINT min_content_size
 The minimum content size this window can have.
 
GUI_RECT valid_drag_rect
 The valid rect that this window can be dragged to.
 
- 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

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

Member Function Documentation

◆ calculate()

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

Get this class' name.

Returns
Should return the name of this class.

Reimplemented from GuiBase.

◆ getFont()

virtual FontObject* DraggableWindowInfo::getFont ( )
inlinevirtual

Get the font for this GUI element.

Returns
Returns the font object for this element.

Reimplemented from GuiBase.

◆ getHoverableCount()

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

◆ getSelectableCount()

virtual int DraggableWindowInfo::getSelectableCount ( )
inlinevirtual

Get the selectable number of elements in this element.

Returns
Returns the amount of selectable elements in this element.

Reimplemented from GuiBase.

◆ isCollapsed()

bool DraggableWindowInfo::isCollapsed ( )
inline

Check to see if this window is collapsed.

Returns

◆ isHoverable()

virtual bool DraggableWindowInfo::isHoverable ( )
virtual

Check hoverability status.

Returns
Returns true if this element can be hovered over.

Implements GuiBase.

◆ isHovered()

virtual bool DraggableWindowInfo::isHovered ( )
virtual

Check hover status.

Returns
Returns true if this element is being hovered over.

Implements GuiBase.

◆ isSelected()

virtual bool DraggableWindowInfo::isSelected ( )
virtual

Check selection status.

Returns
Returns true if this element is selected.

Implements GuiBase.

◆ process()

virtual int DraggableWindowInfo::process ( GUI_POINT  mouse)
virtual

Process mouse input for this element.

Returns
Returns ProcessReturnType flags.
See also
ProcessReturnType

Implements GuiBase.

◆ processKeys()

virtual int DraggableWindowInfo::processKeys ( )
virtual

Process key input for this element.

Returns
Returns ProcessReturnType flags.
See also
ProcessReturnType

Reimplemented from GuiBase.

◆ setCollapsed()

void DraggableWindowInfo::setCollapsed ( bool  bValue)
inline

Set whether this window is collapsed.

Parameters
bValueThe new value.

◆ setFont()

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

Set this element's font.

Parameters
pFontThe new font.

Reimplemented from GuiBase.

◆ setHovered()

virtual void DraggableWindowInfo::setHovered ( int  value)
virtual

Set this GUI element as hovered over or not.

Parameters
valueThe hover value.

Implements GuiBase.

◆ setSelected()

virtual void DraggableWindowInfo::setSelected ( int  value)
virtual

Set this GUI element as selected or not.

Parameters
valueThe selection value.

Implements GuiBase.

◆ setText()

void DraggableWindowInfo::setText ( const char *  pValue)

Set this element's text.

Parameters
pValueThe text to set.

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