Cavestory Mod API
|
A scroll area. More...
#include <CSMAPI_types.h>
Public Types | |
enum | HoverType : unsigned char { HOVER_NONE = 0 , HOVER_BUTTON_1 , HOVER_HANDLE , HOVER_BUTTON_2 } |
Scroll hover type. More... | |
enum | ScrollState { SCROLL_NONE = 0 , SCROLL_X , SCROLL_Y } |
State of scrolling. More... | |
typedef void(* | OnScrollCallbackFunc) (ScrollAreaInfo *pGui, GUI_POINT_F scrollAmt) |
Func callback for when a scroll element scrolls. More... | |
![]() | |
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 | |
ScrollAreaInfo () | |
Default constructor. | |
bool | isScrolling () |
Check if this element is being scrolled. More... | |
virtual const char * | getClassName () |
Get this class' name. 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... | |
void | fitIntoContent (GUI_POINT p) |
Fit the point into the content. More... | |
void | fitIntoContent (GUI_RECT r) |
Fit the rect into the content. More... | |
void | scrollTo (GUI_RECT r) |
Scroll to a rect. More... | |
void | scrollByPixelAmount (GUI_POINT p) |
Scroll by pixel amount. More... | |
GUI_POINT | getOffset () |
Get the scroll offsets. More... | |
GUI_POINT | getRelativeOffset () |
Get the scroll offsets. More... | |
GUI_RECT | getContentArea () |
Calculate the content area for this scroll. More... | |
GUI_RECT | getHorizontalScrollBar () |
Calculate the rect for the horizontal scroll bar. More... | |
GUI_RECT | getVerticalScrollBar () |
Calculate the rect for the vertical scroll bar. 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. | |
void | begin () |
Enforce a clip rect that accomodates the content area. More... | |
void | end () |
Clear the clip rect enforced by begin(). More... | |
![]() | |
GuiBase () | |
Default constructor. | |
virtual | ~GuiBase () |
Default deconstructor. | |
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 GuiBase * | getHoverable (int index) |
Get a hoverable sub-element. More... | |
virtual GuiBase * | getSelectable (int index) |
Get a selectable sub-element. More... | |
virtual bool | SelectOnMouseUp () |
Select on mouse up. More... | |
virtual void | setFont (FontObject *pFont) |
Set the font for this GUI element. More... | |
virtual FontObject * | getFont () |
Get the font for this GUI element. More... | |
virtual int | processKeys () |
Process key input for this element. More... | |
virtual void | importantRender () |
Render the important bits of this element. More... | |
virtual int | getMagnification () |
GuiBase (const GuiBase &)=delete | |
GuiBase & | operator= (const GuiBase &)=delete |
GuiBase (GuiBase &&)=delete | |
GuiBase & | operator= (GuiBase &&)=delete |
Public Attributes | |
OnScrollCallbackFunc | OnScroll |
Called when this element's scroll amount changes. | |
GUI_POINT_F | scroll |
Normalized scroll amounts (for both x and y) | |
bool | drawBackground |
Draw scroll background. | |
bool | drawBorder |
Draw scroll border. | |
bool | showScrollX |
Show the horizontal scrollbar. | |
bool | showScrollY |
Show the vertical scrollbar. | |
int | scrollBarSize |
The size of the scrollbar (height for the horizontal scrollbar, width for the vertical scrollbar) | |
int | scrollBarHandleMargin |
Scroll bar handle margin. | |
int | scrollBarHandleMinSize |
Scroll bar handle minimum size (width for horizontal scrollbar, width for vertical scrollbar) | |
HoverType | hoverScrollX |
The current hover state for the horizontal bar. | |
HoverType | hoverScrollY |
The current hover state for the vertical bar. | |
GUI_POINT | contentSize |
Size of the content area. | |
GUI_POINT | mouseWheelScroll |
Amount of scroll on mousewheel movement for both X and Y. | |
![]() | |
GuiBase * | pNext |
GuiBase * | pPrev |
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 Attributes | |
ScrollState | scrollState |
GUI_RECT | scrollBarXBtn_Left |
GUI_RECT | scrollBarXBtn_Right |
GUI_RECT | scrollBarYBtn_Up |
GUI_RECT | scrollBarYBtn_Down |
GUI_RECT | scrollBarHandleY |
GUI_RECT | scrollBarY |
GUI_RECT | scrollBarHandleX |
GUI_RECT | scrollBarX |
GUI_POINT | offsetPoint |
bool | showingHandleX |
bool | showingHandleY |
Additional Inherited Members | |
![]() | |
static unsigned int | defaultCustomMagnification |
static GuiBase * | gFirst |
![]() | |
void | Link () |
Link ourselves to the global GUI element linkage. | |
void | Unlink () |
Unlink ourselves from the global GUI element linkage. | |
A scroll area.
typedef void(* ScrollAreaInfo::OnScrollCallbackFunc) (ScrollAreaInfo *pGui, GUI_POINT_F scrollAmt) |
Func callback for when a scroll element scrolls.
pGui | The GUI element being scrolled. |
scrollAmt | Normalized scroll amount. |
enum ScrollAreaInfo::HoverType : unsigned char |
void ScrollAreaInfo::begin | ( | ) |
Enforce a clip rect that accomodates the content area.
|
virtual |
void ScrollAreaInfo::end | ( | ) |
void ScrollAreaInfo::fitIntoContent | ( | GUI_POINT | p | ) |
Fit the point into the content.
p | The point to show |
Resizes the contentSize variable to accomodate showing p
void ScrollAreaInfo::fitIntoContent | ( | GUI_RECT | r | ) |
Fit the rect into the content.
r | The rect to show |
Resizes the contentSize variable to accomodate showing the entirety of r
|
inlinevirtual |
GUI_RECT ScrollAreaInfo::getContentArea | ( | ) |
Calculate the content area for this scroll.
GUI_RECT ScrollAreaInfo::getHorizontalScrollBar | ( | ) |
Calculate the rect for the horizontal scroll bar.
GUI_POINT ScrollAreaInfo::getOffset | ( | ) |
Get the scroll offsets.
You should use this offset things that should be inside this scroll.
GUI_POINT ScrollAreaInfo::getRelativeOffset | ( | ) |
Get the scroll offsets.
GUI_RECT ScrollAreaInfo::getVerticalScrollBar | ( | ) |
Calculate the rect for the vertical scroll bar.
|
virtual |
Check hoverability status.
Implements GuiBase.
|
virtual |
|
inline |
Check if this element is being scrolled.
|
virtual |
|
virtual |
Process mouse input for this element.
Implements GuiBase.
void ScrollAreaInfo::scrollByPixelAmount | ( | GUI_POINT | p | ) |
Scroll by pixel amount.
p | The pixel amounts to scroll by |
void ScrollAreaInfo::scrollTo | ( | GUI_RECT | r | ) |
Scroll to a rect.
r | The rect to scroll to |
Automatically scroll to show the entirety of rect r
|
virtual |
|
virtual |