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

A class that represents a text-based control element in a window. More...

#include <ControlText.h>

Inheritance diagram for ControlText:
Window PropertyClass ControlList ControlTextAlert MatchTimerControl WindowHelp WindowTip

Public Member Functions

std::wstring getText () const
 Get the text of the control.
 
void setText (const std::wstring &text)
 Set the text of the control.
 
std::wstring getTooltip () const
 Get the tooltip text of the control.
 
void setTooltip (const std::wstring &tooltip)
 Set the tooltip text of the control.
 
bool isToggleEnabled () const
 Check if toggle is enabled.
 
void setToggleEnabled (bool enableToggle)
 Enable or disable toggle.
 
bool isDropShadowUsed () const
 Check if drop shadow is used.
 
void setDropShadowUsed (bool useDropShadow)
 Enable or disable drop shadow.
 
bool isOutlineUsed () const
 Check if outline is used.
 
void setOutlineUsed (bool useOutline)
 Enable or disable outline.
 
bool isWordWrapEnabled () const
 Check if word wrap is enabled.
 
void setWordWrapEnabled (bool enableWordWrap)
 Enable or disable word wrap.
 
int getLeadingAdjust () const
 Get the leading adjustment value.
 
void setLeadingAdjust (int leadingAdjust)
 Set the leading adjustment value.
 
- 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 ControlTextLayout
 

Detailed Description

A class that represents a text-based control element in a window.

The ControlText class extends the functionality of the Window class to provide specific features for handling and displaying text within a window. This class includes capabilities for managing text content, tooltips, and various display options such as drop shadows, outlines, and word wrapping. Additionally, it supports enabling and disabling toggle states and adjusting leading (the space between lines of text).

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

Member Function Documentation

◆ getLeadingAdjust()

int ControlText::getLeadingAdjust ( ) const
inline

Get the leading adjustment value.

Returns
The leading adjustment value.

◆ getText()

std::wstring ControlText::getText ( ) const
inline

Get the text of the control.

Returns
The text as a wide string.

◆ getTooltip()

std::wstring ControlText::getTooltip ( ) const
inline

Get the tooltip text of the control.

Returns
The tooltip text as a wide string.

◆ isDropShadowUsed()

bool ControlText::isDropShadowUsed ( ) const
inline

Check if drop shadow is used.

Returns
True if drop shadow is used, false otherwise.

◆ isOutlineUsed()

bool ControlText::isOutlineUsed ( ) const
inline

Check if outline is used.

Returns
True if outline is used, false otherwise.

◆ isToggleEnabled()

bool ControlText::isToggleEnabled ( ) const
inline

Check if toggle is enabled.

Returns
True if toggle is enabled, false otherwise.

◆ isWordWrapEnabled()

bool ControlText::isWordWrapEnabled ( ) const
inline

Check if word wrap is enabled.

Returns
True if word wrap is enabled, false otherwise.

◆ setDropShadowUsed()

void ControlText::setDropShadowUsed ( bool useDropShadow)
inline

Enable or disable drop shadow.

Parameters
useDropShadowTrue to use drop shadow, false to disable.

◆ setLeadingAdjust()

void ControlText::setLeadingAdjust ( int leadingAdjust)
inline

Set the leading adjustment value.

Parameters
leadingAdjustThe leading adjustment value to set.

◆ setOutlineUsed()

void ControlText::setOutlineUsed ( bool useOutline)
inline

Enable or disable outline.

Parameters
useOutlineTrue to use outline, false to disable.

◆ setText()

void ControlText::setText ( const std::wstring & text)
inline

Set the text of the control.

Parameters
textThe text to set as a wide string.

◆ setToggleEnabled()

void ControlText::setToggleEnabled ( bool enableToggle)
inline

Enable or disable toggle.

Parameters
enableToggleTrue to enable toggle, false to disable.

◆ setTooltip()

void ControlText::setTooltip ( const std::wstring & tooltip)
inline

Set the tooltip text of the control.

Parameters
tooltipThe tooltip text to set as a wide string.

◆ setWordWrapEnabled()

void ControlText::setWordWrapEnabled ( bool enableWordWrap)
inline

Enable or disable word wrap.

Parameters
enableWordWrapTrue to enable word wrap, false to disable.

Friends And Related Symbol Documentation

◆ ControlTextLayout

friend struct ControlTextLayout
friend