Cyrus Mod Loader
Loading...
Searching...
No Matches
ControlButton Class Reference

A class that represents a button control element in a window. More...

#include <ControlButton.h>

Inheritance diagram for ControlButton:
Window PropertyClass ControlCheckBox ControlDecalButton ControlPopupButton ControlTab__Button PCSButton PotionButton BadgeButton InventoryPageWindow__InventoryItem PetSnackCheckBox RecipeWindow__RecipeItem SpellCheckBox ScrollButton ScrollablePopupButton ChatPopupButton

Public Member Functions

CYRUS bool isToggle () const
 Check if the button is in toggle state.
 
CYRUS void setToggle (bool toggle)
 Set the toggle state of the button.
 
CYRUS bool isButtonDown () const
 Check if the button is currently pressed down.
 
CYRUS void setButtonDown (bool buttonDown)
 Set the button down state.
 
CYRUS std::wstring getLabel () const
 Get the label of the button.
 
CYRUS void setLabel (const std::wstring &label)
 Set the label of the button.
 
CYRUS unsigned int getHotKey () const
 Get the hotkey assigned to the button.
 
CYRUS void setHotKey (unsigned int hotKey)
 Set the hotkey for the button.
 
CYRUS int getColor () const
 Get the color of the button.
 
CYRUS void setColor (int col)
 Set the color of the button.
 
CYRUS bool isHotKeyDown () const
 Check if the hotkey is currently pressed down.
 
CYRUS void setHotKeyDown (bool hotKeyDown)
 Set the hotkey down state.
 
CYRUS float getTime () const
 Get the time associated with the button.
 
CYRUS void setTime (float time)
 Set the time associated with the button.
 
CYRUS bool isGreyed () const
 Check if the button is greyed out.
 
CYRUS void setGreyed (bool greyed)
 Set the greyed out state of the button.
 
CYRUS bool isCursorOver () const
 Check if the cursor is over the button.
 
CYRUS void setCursorOver (bool cursorOver)
 Set the cursor over state of the button.
 
CYRUS float getMaxScale () const
 Get the maximum scale of the button.
 
CYRUS void setMaxScale (float maxScale)
 Set the maximum scale of the button.
 
CYRUS float getScaleSpeed () const
 Get the scale speed of the button.
 
CYRUS void setScaleSpeed (float scaleSpeed)
 Set the scale speed of the button.
 
CYRUS bool isDropShadowUsed () const
 Check if drop shadow is used.
 
CYRUS void setDropShadowUsed (bool useDropShadow)
 Enable or disable drop shadow.
 
CYRUS bool isOutlineUsed () const
 Check if outline is used.
 
CYRUS void setOutlineUsed (bool useOutline)
 Enable or disable outline.
 
CYRUS bool isAbortWhenCursorNotOver () const
 Check if actions should be aborted when the cursor is not over the button.
 
CYRUS void setAbortWhenCursorNotOver (bool abortWhenCursorNotOver)
 Enable or disable aborting actions when the cursor is not over the button.
 
- Public Member Functions inherited from Window
CYRUS int32_t getWindowID () const
 Retrieve the unique identifier for the Window.
 
CYRUS std::list< ClickResponder_t > getClickResponders ()
 
CYRUS std::string getName ()
 Retrieve the name of the Window.
 
CYRUS std::vector< std::shared_ptr< Window > > getChildren ()
 Retrieve the child Windows of this Window.
 
CYRUS WindowgetParent ()
 Get the Windows parent Window.
 
CYRUS std::string getFlags ()
 
CYRUS std::string getStyles ()
 
CYRUS void addFlag (uint32_t flag)
 Unconditionally sets the specified Window flag to 1.
 
CYRUS void addStyle (uint32_t style)
 Unconditionally sets the specified Window style to 1.
 
CYRUS void toggleFlag (uint32_t flag)
 Toggles the current value of the specified Window flag.
 
CYRUS void toggleStyle (uint32_t style)
 Toggles the current value of the specified Window style.
 
CYRUS void removeFlag (uint32_t flag)
 Unconditionally sets the specified Window flag to 0.
 
CYRUS void removeStyle (uint32_t style)
 Unconditionally sets the specified Window style to 0.
 
CYRUS RectgetTransform ()
 Get the transformation coordinates of the window.
 
CYRUS void setTransform (Rect in)
 Sets the transformation coordinates of the window.
 
CYRUS VectorI2D getParentOffset () const
 Get the offset of the window relative to its parent.
 
CYRUS float getTimeOnScreen () const
 Get the total time the window has been displayed on the screen.
 
CYRUS void setTimeOnScreen (float screenTime)
 Set the total time the window has been displayed on the screen.
 
CYRUS float getDisabledAlpha () const
 Get the alpha value when the window is disabled.
 
CYRUS void setFDisabledAlpha (float fDisabledAlpha)
 Set the alpha value for when the window is disabled.
 
CYRUS float getTargetAlpha () const
 Get the target alpha value of the window.
 
CYRUS void setFTargetAlpha (float fTargetAlpha)
 Set the target alpha value of the window.
 
CYRUS Vector2D getScale () const
 Get the scale of the window.
 
CYRUS void setScale (float x, float y)
 Sets the scale of the window.
 
CYRUS VectorI2D getOffset () const
 Get the offset of the window.
 
CYRUS void performScale (float factor)
 Scales the current Window, and all descendants, by the scale factor. If the scale factor is 2, the Window and it's descendants will be twice as large. If the scale factor is 0.5, the Window and it's descendants will be twice as small.
 
template<class T >
CYRUS T * findChild (const std::string &name)
 Find a child Window by name and cast it to the specified type.
 
template<class T >
CYRUS T * findDescendant (const std::string &name)
 Find a descendant Window by name and cast it to the specified type.
 
virtual void func1 ()
 
virtual void func2 ()
 
virtual void func3 ()
 
virtual void func4 ()
 
virtual void func5 ()
 
virtual void func6 ()
 
virtual void func7 ()
 
virtual void func8 ()
 
virtual void func9 ()
 
virtual void func10 ()
 
virtual void func11 ()
 
virtual void func12 ()
 
virtual void func13 ()
 
virtual void func14 ()
 
virtual void func15 ()
 
virtual void func16 ()
 
virtual void func17 ()
 
virtual void func18 ()
 
virtual void func19 ()
 
virtual void func20 ()
 
virtual void func21 ()
 
virtual void func22 ()
 
virtual void func23 ()
 
virtual void func24 ()
 
virtual void func25 ()
 
virtual void func26 ()
 
virtual void func27 ()
 
virtual void func28 ()
 
virtual void func29 ()
 
virtual void func30 ()
 
virtual void func31 ()
 
virtual void func32 ()
 
virtual void func33 ()
 
virtual void func34 ()
 
virtual void func35 ()
 
virtual bool updateDockPosition ()
 
- Public Member Functions inherited from PropertyClass
virtual char * getClassName ()=0
 Gets the class name of the derived class in the format class T[*].
 
virtual void * getPropertyList ()=0
 Constructs and caches the PropertyList for the derived class, adding all reflected members and member functions.
 
virtual bool copy (uint32_t a1)=0
 Copies the property class data.
 
virtual void * serialize (void *a2, uint32_t a3)=0
 Serializes the derived class's PropertyList as XML.
 
virtual bool onCreated ()=0
 Called when the PropertyClass is created.
 
template<typename T >
CYRUS T * as ()
 Casts this to a pointer of type T.
 
virtual void onPostLoad ()=0
 Called when the PropertyClass is loaded, i.e., initialize is called and onCreated has finished.
 
virtual void onFinalizeLoad ()=0
 
virtual bool shouldNotSerialize ()=0
 Determines if the PropertyClass should not be serialized.
 

Friends

struct ControlButtonLayout
 

Detailed Description

A class that represents a button control element in a window.

The ControlButton class extends the functionality of the Window class to provide specific features for handling and displaying a button within a window. This class includes capabilities for managing button states, labels, hotkeys, colors, scaling, and various display options such as drop shadows and outlines. Additionally, it supports detecting cursor interaction and handling toggle states.

Note
This class inherits from the Window class, thereby incorporating all the functionalities and attributes of a standard window.

Member Function Documentation

◆ getColor()

int ControlButton::getColor ( ) const

Get the color of the button.

Returns
The color as an integer.

◆ getHotKey()

unsigned int ControlButton::getHotKey ( ) const

Get the hotkey assigned to the button.

Returns
The hotkey as an unsigned integer.

◆ getLabel()

std::wstring ControlButton::getLabel ( ) const

Get the label of the button.

Returns
The label as a wide string.

◆ getMaxScale()

float ControlButton::getMaxScale ( ) const

Get the maximum scale of the button.

Returns
The maximum scale as a float.

◆ getScaleSpeed()

float ControlButton::getScaleSpeed ( ) const

Get the scale speed of the button.

Returns
The scale speed as a float.

◆ getTime()

float ControlButton::getTime ( ) const

Get the time associated with the button.

Returns
The time as a float.

◆ isAbortWhenCursorNotOver()

bool ControlButton::isAbortWhenCursorNotOver ( ) const

Check if actions should be aborted when the cursor is not over the button.

Returns
True if actions are aborted when the cursor is not over, false otherwise.

◆ isButtonDown()

bool ControlButton::isButtonDown ( ) const

Check if the button is currently pressed down.

Returns
True if the button is pressed down, false otherwise.

◆ isCursorOver()

bool ControlButton::isCursorOver ( ) const

Check if the cursor is over the button.

Returns
True if the cursor is over the button, false otherwise.

◆ isDropShadowUsed()

bool ControlButton::isDropShadowUsed ( ) const

Check if drop shadow is used.

Returns
True if drop shadow is used, false otherwise.

◆ isGreyed()

bool ControlButton::isGreyed ( ) const

Check if the button is greyed out.

Returns
True if the button is greyed out, false otherwise.

◆ isHotKeyDown()

bool ControlButton::isHotKeyDown ( ) const

Check if the hotkey is currently pressed down.

Returns
True if the hotkey is pressed down, false otherwise.

◆ isOutlineUsed()

bool ControlButton::isOutlineUsed ( ) const

Check if outline is used.

Returns
True if outline is used, false otherwise.

◆ isToggle()

bool ControlButton::isToggle ( ) const

Check if the button is in toggle state.

Returns
True if the button is toggled, false otherwise.

◆ setAbortWhenCursorNotOver()

void ControlButton::setAbortWhenCursorNotOver ( bool abortWhenCursorNotOver)

Enable or disable aborting actions when the cursor is not over the button.

Parameters
abortWhenCursorNotOverTrue to abort actions when the cursor is not over, false to disable.

◆ setButtonDown()

void ControlButton::setButtonDown ( bool buttonDown)

Set the button down state.

Parameters
buttonDownTrue to set the button as pressed down, false to release.

◆ setColor()

void ControlButton::setColor ( int col)

Set the color of the button.

Parameters
colThe color to set as an integer.

◆ setCursorOver()

void ControlButton::setCursorOver ( bool cursorOver)

Set the cursor over state of the button.

Parameters
cursorOverTrue to set the cursor as over the button, false otherwise.

◆ setDropShadowUsed()

void ControlButton::setDropShadowUsed ( bool useDropShadow)

Enable or disable drop shadow.

Parameters
useDropShadowTrue to use drop shadow, false to disable.

◆ setGreyed()

void ControlButton::setGreyed ( bool greyed)

Set the greyed out state of the button.

Parameters
greyedTrue to grey out the button, false to enable it.

◆ setHotKey()

void ControlButton::setHotKey ( unsigned int hotKey)

Set the hotkey for the button.

Parameters
hotKeyThe hotkey to set as an unsigned integer.

◆ setHotKeyDown()

void ControlButton::setHotKeyDown ( bool hotKeyDown)

Set the hotkey down state.

Parameters
hotKeyDownTrue to set the hotkey as pressed down, false to release.

◆ setLabel()

void ControlButton::setLabel ( const std::wstring & label)

Set the label of the button.

Parameters
labelThe label to set as a wide string.

◆ setMaxScale()

void ControlButton::setMaxScale ( float maxScale)

Set the maximum scale of the button.

Parameters
maxScaleThe maximum scale to set as a float.

◆ setOutlineUsed()

void ControlButton::setOutlineUsed ( bool useOutline)

Enable or disable outline.

Parameters
useOutlineTrue to use outline, false to disable.

◆ setScaleSpeed()

void ControlButton::setScaleSpeed ( float scaleSpeed)

Set the scale speed of the button.

Parameters
scaleSpeedThe scale speed to set as a float.

◆ setTime()

void ControlButton::setTime ( float time)

Set the time associated with the button.

Parameters
timeThe time to set as a float.

◆ setToggle()

void ControlButton::setToggle ( bool toggle)

Set the toggle state of the button.

Parameters
toggleTrue to enable toggle, false to disable.

Friends And Related Symbol Documentation

◆ ControlButtonLayout

friend struct ControlButtonLayout
friend