AbstractButton

Inherited: Widget

Description

The AbstractButton class provides a foundation for creating interactive buttons within a graphical user interface. It allows customization of various visual properties and handles user interaction events. Internal methods are marked as internal and are intended for use within the framework rather than by external code.

Public Methods

Frame *

background () const

float

fadeDuration () const

Vector4

highlightedColor () const

Image *

icon () const

Vector2

iconSize () const

bool

isCheckable () const

bool

isChecked () const

bool

isExclusive () const

bool

isMirrored () const

Label *

label () const

Vector4

normalColor () const

Vector4

pressedColor () const

void

setBackground (Frame * frame)

void

setCheckable (bool checkable)

void

setChecked (bool checked)

void

setExclusive (bool exclusive)

void

setFadeDuration (float duration)

void

setHighlightedColor (const Vector4 color)

void

setIcon (Image * image)

void

setIconSize (Vector2 size)

void

setLabel (Label * label)

void

setMirrored (bool mirrored)

void

setNormalColor (const Vector4 color)

void

setPressedColor (const Vector4 color)

void

setText (const std::string text)

std::string

text () const

Static Methods

None

Methods Description

:ref:`Frame<api_Frame>`* AbstractButton::background () const

Returns the background frame object associated with the button.

See also setBackground().


float AbstractButton::fadeDuration () const

Returns the fade duration used for visual effects.

See also setFadeDuration().


Vector4 AbstractButton::highlightedColor () const

Returns the color used when the button is highlighted.

See also setHighlightedColor().


:ref:`Image<api_Image>`* AbstractButton::icon () const

Returns the icon associated with the button.

See also setIcon().


Vector2 AbstractButton::iconSize () const

Returns the size of the icon.

See also setIconSize().


bool AbstractButton::isCheckable () const

Returns true if the button is checkable; otherwise, false.


bool AbstractButton::isChecked () const

Returns true if the button is checked; otherwise, false.


bool AbstractButton::isExclusive () const

Returns true if the button is in exclusive mode; otherwise, false.


bool AbstractButton::isMirrored () const

Returns true if the button is mirrored; otherwise, false.


:ref:`Label<api_Label>`* AbstractButton::label () const

Returns the label object associated with the button.

See also setLabel().


Vector4 AbstractButton::normalColor () const

Returns the normal color of the button.

See also setNormalColor().


Vector4 AbstractButton::pressedColor () const

Returns the color used when the button is pressed.

See also setPressedColor().


void AbstractButton::setBackground (Frame * frame)

Sets the background frame of the button.

See also background().


void AbstractButton::setCheckable (bool checkable)

Sets whether the button is checkable.

See also isCheckable().


void AbstractButton::setChecked (bool checked)

Sets the checked state of the button.

See also isChecked().


void AbstractButton::setExclusive (bool exclusive)

Sets whether the button is in exclusive mode.

See also isExclusive().


void AbstractButton::setFadeDuration (float duration)

Sets the fade duration used for visual effects.

See also fadeDuration().


void AbstractButton::setHighlightedColor (Vector4 color)

Sets the color used when the button is highlighted.

See also highlightedColor().


void AbstractButton::setIcon (Image * image)

Sets the icon image associated with the button.

See also icon().


void AbstractButton::setIconSize (Vector2 size)

Sets the size of the icon.

See also iconSize().


void AbstractButton::setLabel (Label * label)

Sets the label associated with the button.

See also *label*().


void AbstractButton::setMirrored (bool mirrored)

Sets whether the button should be mirrored.

See also isMirrored().


void AbstractButton::setNormalColor (Vector4 color)

Sets the normal color of the button.

See also normalColor().


void AbstractButton::setPressedColor (Vector4 color)

Sets the color used when the button is pressed.

See also pressedColor().


void AbstractButton::setText (std::string text)

Sets the text displayed on the button.

See also *text*().


std::string AbstractButton::text () const

Returns the text displayed on the button.

See also setText().