sincerely Singaporean

If you have not done so, read this full tutorial on how to use SGEXTN to build an application.

SGWButton

see header file

see source file

class SGWButton;

part of SGEXTN module SG_Widgets

SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ button base class

detailed description

list of all including inherited members

implementation details

preprocessor file inclusion directive: #include ‹SGWButton.h›

CMake target for BuildLah: SGEXTN::SG_Widgets

see this link for more information about BuildLah

parent class: SGWWidget

children classes: SGWIconButton, SGWTextButton

instance member variables

int attachedInt;

SGXString attachedString;

void (*clickFunction)();

void (*clickFunctionWithInt)(int);

void (*clickFunctionWithPointer)(SGWButton*);

void (*clickFunctionWithString)(const SGXString&);

void (*pressFunction)();

void (*pressFunctionWithInt)(int);

void (*pressFunctionWithPointer)(SGWButton*);

void (*pressFunctionWithString)(const SGXString&);

void (*releaseFunction)();

void (*releaseFunctionWithInt)(int);

void (*releaseFunctionWithPointer)(SGWButton*);

void (*releaseFunctionWithString)(const SGXString&);

instance member functions

[[nodiscard]] SGXColourRGBA getBackgroundColour(bool* isUsing) const;

[[nodiscard]] SGXColourRGBA getBackgroundFocusColour(bool* isUsing) const;

[[nodiscard]] SGXColourRGBA getBackgroundFocusSelectedColour(bool* isUsing) const;

[[nodiscard]] int getBackgroundFocusSelectedThemeColour(bool* isUsing) const;

[[nodiscard]] int getBackgroundFocusThemeColour(bool* isUsing) const;

[[nodiscard]] SGXColourRGBA getBackgroundHoverColour(bool* isUsing) const;

[[nodiscard]] SGXColourRGBA getBackgroundHoverSelectedColour(bool* isUsing) const;

[[nodiscard]] int getBackgroundHoverSelectedThemeColour(bool* isUsing) const;

[[nodiscard]] int getBackgroundHoverThemeColour(bool* isUsing) const;

[[nodiscard]] SGXColourRGBA getBackgroundSelectedColour(bool* isUsing) const;

[[nodiscard]] int getBackgroundSelectedThemeColour(bool* isUsing) const;

[[nodiscard]] int getBackgroundThemeColour(bool* isUsing) const;

[[nodiscard]] float getF0() const;

[[nodiscard]] float getF1() const;

[[nodiscard]] SGXString getFont() const;

[[nodiscard]] SGXColourRGBA getForegroundColour(bool* isUsing) const;

[[nodiscard]] SGXColourRGBA getForegroundFocusColour(bool* isUsing) const;

[[nodiscard]] SGXColourRGBA getForegroundFocusSelectedColour(bool* isUsing) const;

[[nodiscard]] int getForegroundFocusSelectedThemeColour(bool* isUsing) const;

[[nodiscard]] int getForegroundFocusThemeColour(bool* isUsing) const;

[[nodiscard]] SGXColourRGBA getForegroundHoverColour(bool* isUsing) const;

[[nodiscard]] SGXColourRGBA getForegroundHoverSelectedColour(bool* isUsing) const;

[[nodiscard]] int getForegroundHoverSelectedThemeColour(bool* isUsing) const;

[[nodiscard]] int getForegroundHoverThemeColour(bool* isUsing) const;

[[nodiscard]] SGXColourRGBA getForegroundSelectedColour(bool* isUsing) const;

[[nodiscard]] int getForegroundSelectedThemeColour(bool* isUsing) const;

[[nodiscard]] int getForegroundThemeColour(bool* isUsing) const;

[[nodiscard]] SGWHorizontalAlignment::Flag getHorizontalAlignment() const;

[[nodiscard]] bool getSelected() const;

[[nodiscard]] float getTextAsFloat(bool* isValid, float minimum, float maximum) const;

[[nodiscard]] int getTextAsInt(bool* isValid, int minimum, int maximum) const;

[[nodiscard]] SGXString getTextAsString() const;

[[nodiscard]] SGWVerticalAlignment::Flag getVerticalAlignment() const;

void setBackgroundColour(SGXColourRGBA colour);

void setBackgroundFocusColour(SGXColourRGBA colour);

void setBackgroundFocusSelectedColour(SGXColourRGBA colour);

void setBackgroundFocusSelectedThemeColour(int themeColour);

void setBackgroundFocusThemeColour(int themeColour);

void setBackgroundHoverColour(SGXColourRGBA colour);

void setBackgroundHoverSelectedColour(SGXColourRGBA colour);

void setBackgroundHoverSelectedThemeColour(int themeColour);

void setBackgroundHoverThemeColour(int themeColour);

void setBackgroundSelectedColour(SGXColourRGBA colour);

void setBackgroundSelectedThemeColour(int themeColour);

void setBackgroundThemeColour(int themeColour);

void setF0(float f0);

void setF1(float f1);

void setFont(const SGXString& font);

void setForegroundColour(SGXColourRGBA colour);

void setForegroundFocusColour(SGXColourRGBA colour);

void setForegroundFocusSelectedColour(SGXColourRGBA colour);

void setForegroundFocusSelectedThemeColour(int themeColour);

void setForegroundFocusThemeColour(int themeColour);

void setForegroundHoverColour(SGXColourRGBA colour);

void setForegroundHoverSelectedColour(SGXColourRGBA colour);

void setForegroundHoverSelectedThemeColour(int themeColour);

void setForegroundHoverThemeColour(int themeColour);

void setForegroundSelectedColour(SGXColourRGBA colour);

void setForegroundSelectedThemeColour(int themeColour);

void setForegroundThemeColour(int themeColour);

void setHorizontalAlignment(SGWHorizontalAlignment::Flag alignment);

void setSelected(bool selected);

void setTextFromFloat(float x);

void setTextFromInt(int x);

void setTextFromString(const SGXString& s);

void setVerticalAlignment(SGWVerticalAlignment::Flag alignment);

Detailed Description

SGWButton provides a base class for SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ buttons. This is not meant to be instantiated directly, you are supposed to create its subclasses (SGWTextButton, SGWIconButton) to use its functionality. This is interactive and can trigger callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ when pressed down, released, and clicked.

Implementation Details

Stores information about the SGWButton.

int attachedInt;

Int attached to this SGWColourPickerWidget.

This is used to identify the source of the callback in callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.

SGXString attachedString;

String attached to this SGWColourPickerWidget.

This is used to identify the source of the callback in callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.

void (*clickFunction)();

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking no arguments, triggered when the SGWButton is clicked.

void (*clickFunctionWithInt)(int);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a int, triggered when the SGWButton is clicked and SGWButton::attachedInt is passed as argument.

void (*clickFunctionWithPointer)(SGWButton*);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a pointer to SGWButton, triggered when the SGWButton is clicked and the pointer to this SGWButton is passed as argument.

void (*clickFunctionWithString)(const SGXString&);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a string, triggered when the SGWButton is clicked and SGWButton::attachedString is passed as argument.

void (*pressFunction)();

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking no arguments, triggered when the SGWButton is pressed down.

This also triggers when the SGWButton is clicked.

void (*pressFunctionWithInt)(int);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a int, triggered when the SGWButton is pressed down and SGWButton::attachedInt is passed as argument.

This also triggers when the SGWButton is clicked.

void (*pressFunctionWithPointer)(SGWButton*);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a pointer to SGWButton, triggered when the SGWButton is pressed down and the pointer to this SGWButton is passed as argument.

This also triggers when the SGWButton is clicked.

void (*pressFunctionWithString)(const SGXString&);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a string, triggered when the SGWButton is pressed down and SGWButton::attachedString is passed as argument.

This also triggers when the SGWButton is clicked.

void (*releaseFunction)();

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking no arguments, triggered when the SGWButton is released.

This also triggers when the SGWButton is clicked.

void (*releaseFunctionWithInt)(int);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a int, triggered when the SGWButton is released and SGWButton::attachedInt is passed as argument.

This also triggers when the SGWButton is clicked.

void (*releaseFunctionWithPointer)(SGWButton*);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a pointer to SGWButton, triggered when the SGWButton is released and the pointer to this SGWButton is passed as argument.

This also triggers when the SGWButton is clicked.

void (*releaseFunctionWithString)(const SGXString&);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a string, triggered when the SGWButton is released and SGWButton::attachedString is passed as argument.

This also triggers when the SGWButton is clicked.

[[nodiscard]] SGXColourRGBA getBackgroundColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the background of this SGWButton. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGXColourRGBA getBackgroundFocusColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the background of this SGWButton when focused. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGXColourRGBA getBackgroundFocusSelectedColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the background of this SGWButton when focused and marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getBackgroundFocusSelectedThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the background of this SGWButton when focused and marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getBackgroundFocusThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the background of this SGWButton when focused. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGXColourRGBA getBackgroundHoverColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the background of this SGWButton when hovered over. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGXColourRGBA getBackgroundHoverSelectedColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the background of this SGWButton when hovered over and marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getBackgroundHoverSelectedThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the background of this SGWButton when hovered over and marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getBackgroundHoverThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the background of this SGWButton when hovered over. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGXColourRGBA getBackgroundSelectedColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the background of this SGWButton when marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getBackgroundSelectedThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the background of this SGWButton when marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getBackgroundThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the background of this SGWButton. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] float getF0() const;

Returns the 0 coordinate of the font size as a w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.

[[nodiscard]] float getF1() const;

Returns the 1 coordinate of the font size as a w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.

[[nodiscard]] SGXString getFont() const;

Returns the current font used to display text in the SGWButton.

[[nodiscard]] SGXColourRGBA getForegroundColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the foreground of this SGWButton. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGXColourRGBA getForegroundFocusColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the foreground of this SGWButton when focused. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGXColourRGBA getForegroundFocusSelectedColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the foreground of this SGWButton when focused and marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getForegroundFocusSelectedThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the foreground of this SGWButton when focused and marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getForegroundFocusThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the foreground of this SGWButton when focused. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGXColourRGBA getForegroundHoverColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the foreground of this SGWButton when hovered over. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGXColourRGBA getForegroundHoverSelectedColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the foreground of this SGWButton when hovered over and marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getForegroundHoverSelectedThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the foreground of this SGWButton when hovered over and marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getForegroundHoverThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the foreground of this SGWButton when hovered over. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGXColourRGBA getForegroundSelectedColour(bool* isUsing) const;

Returns the SGXColourRGBA currently being used for the foreground of this SGWButton when marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is off, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getForegroundSelectedThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the foreground of this SGWButton when marked as selected. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] int getForegroundThemeColour(bool* isUsing) const;

Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the foreground of this SGWButton. The bool that isUsing points to is set to true if theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode is on, and false otherwise.

If you are not interested in the current theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode, pass nullptr to isUsing.

[[nodiscard]] SGWHorizontalAlignment::Flag getHorizontalAlignment() const;

Returns the current SGWHorizontalAlignment mode used to display text in this SGWButton.

[[nodiscard]] bool getSelected() const;

Returns if this SGWButton is currently set to selected.

Different SGWButton have independent selection states. More than 1 SGWButton can be set to selected simultaneously.

[[nodiscard]] float getTextAsFloat(bool* isValid, float minimum, float maximum) const;

Returns the text displayed in the SGWButton as a number between minimum and maximum inclusive. If the text does not represent a number or if it is out of bounds, isValid is set to false and 0 is returned, otherwise isValid is set to true.

Pass nullptr to isValid if you are not interested if the text represents a number and the integer is in bounds.

minimum more than maximum is undefined behaviour.

[[nodiscard]] int getTextAsInt(bool* isValid, int minimum, int maximum) const;

Returns the text displayed in the SGWButton as an integer between minimum and maximum inclusive. If the text does not represent an integer or if it is out of bounds, isValid is set to false and 0 is returned, otherwise isValid is set to true.

Pass nullptr to isValid if you are not interested if the text represents an integer and the integer is in bounds.

minimum more than maximum is undefined behaviour.

[[nodiscard]] SGXString getTextAsString() const;

Returns the text displayed in the SGWButton.

[[nodiscard]] SGWVerticalAlignment::Flag getVerticalAlignment() const;

Returns the current SGWVerticalAlignment mode used to display text in this SGWButton.

void setBackgroundColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the background of this SGWButton to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundFocusColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the background of this SGWButton when focused to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundFocusSelectedColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the background of this SGWButton when focused and marked as selected to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundFocusSelectedThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWButton when focused and marked as selected to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundFocusThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWButton when focused to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundHoverColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the background of this SGWButton when hovered over to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundHoverSelectedColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the background of this SGWButton when hovered over and marked as selected to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundHoverSelectedThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWButton when hovered over and marked as selected to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundHoverThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWButton when hovered over to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundSelectedColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the background of this SGWButton when marked as selected to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundSelectedThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWButton when marked as selected to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setBackgroundThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWButton to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setF0(float f0);

Sets the 0 coordinate of the font size as a w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ to f0.

void setF1(float f1);

Sets the 1 coordinate of the font size as a w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ to f1.

void setFont(const SGXString& font);

Sets the SGWButton to use font to display text.

If font is not a valid font, this is undefined behaviour.

void setForegroundColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the foreground of this SGWButton to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundFocusColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the foreground of this SGWButton when focused to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundFocusSelectedColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the foreground of this SGWButton when focused and marked as selected to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundFocusSelectedThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the foreground of this SGWButton when focused and marked as selected to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundFocusThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the foreground of this SGWButton when focused to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundHoverColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the foreground of this SGWButton when hovered over to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundHoverSelectedColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the foreground of this SGWButton when hovered over and marked as selected to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundHoverSelectedThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the foreground of this SGWButton when hovered over and marked as selected to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundHoverThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the foreground of this SGWButton when hovered over to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundSelectedColour(SGXColourRGBA colour);

Sets the SGXColourRGBA of the foreground of this SGWButton when marked as selected to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundSelectedThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the foreground of this SGWButton when marked as selected to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setForegroundThemeColour(int themeColour);

Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the foreground of this SGWButton to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.

void setHorizontalAlignment(SGWHorizontalAlignment::Flag alignment);

Sets the SGWHorizontalAlignment mode used to display text in this SGWButton to alignment.

void setSelected(bool selected);

If selected is true, sets this SGWButton to selected, otherwise set this SGWButton to not selected.

Different SGWButton have independent selection states. More than 1 SGWButton can be set to selected simultaneously.

void setTextFromFloat(float x);

Sets the text currently displayed in the SGWButton to the string representation of x.

void setTextFromInt(int x);

Sets the text currently displayed in the SGWButton to the string representation of x.

void setTextFromString(const SGXString& s);

Sets the text currently displayed in the SGWButton to s.

void setVerticalAlignment(SGWVerticalAlignment::Flag alignment);

Sets the SGWVerticalAlignment mode used to display text in this SGWButton to alignment.

©2025 05524F.sg (Singapore)

contact 05524F / report a bug / make a suggestion

about 05524F SINGAPORE values

list of 05524F projects