sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
class SGWLabel;
part of SGEXTN module SG_Widgets
SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ text label base class
list of all including inherited members
preprocessor file inclusion directive: #include ‹SGWLabel.h›
CMake target for BuildLah: SGEXTN::SG_Widgets
see this link for more information about BuildLah
parent class: SGWWidget
children classes: SGWIconLabel, SGWLongLabel, SGWSequentialLongLabel, SGWTextLabel
[[nodiscard]] SGXColourRGBA getBackgroundColour(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]] int getForegroundThemeColour(bool* isUsing) const;
[[nodiscard]] SGWHorizontalAlignment::Flag getHorizontalAlignment() 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 setBackgroundThemeColour(int themeColour);
void setF0(float f0);
void setF1(float f1);
void setFont(const SGXString& font);
void setForegroundColour(SGXColourRGBA colour);
void setForegroundThemeColour(int themeColour);
void setHorizontalAlignment(SGWHorizontalAlignment::Flag alignment);
void setTextFromFloat(float x);
void setTextFromInt(int x);
void setTextFromString(const SGXString& text);
void setVerticalAlignment(SGWVerticalAlignment::Flag alignment);
SGWLabel provides a base class for SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ text labels. This is not meant to be instantiated directly, you are supposed to create its subclasses (SGWTextLabel, SGWIconLabel, SGWLongLabel, SGWSequentialLongLabel) to use its functionality.
Stores information about the SGWLabel.
Returns the SGXColourRGBA currently being used for the background of this SGWLabel. 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.
Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the background of this SGWLabel. 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.
Returns the 0 coordinate of the font size as a w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
Returns the 1 coordinate of the font size as a w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
Returns the current font used to display text in the SGWLabel.
Returns the SGXColourRGBA currently being used for the foreground of this SGWLabel. 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.
Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the foreground of this SGWLabel. 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.
Returns the current SGWHorizontalAlignment mode used to display text in this SGWLabel.
Returns the text displayed in the SGWLabel 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.
Returns the text displayed in the SGWLabel 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.
Returns the text displayed in the SGWLabel.
Returns the current SGWVerticalAlignment mode used to display text in this SGWLabel.
Sets the SGXColourRGBA of the background of this SGWLabel to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWLabel to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the 0 coordinate of the font size as a w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ to f0.
Sets the 1 coordinate of the font size as a w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ to f1.
Sets the SGWLabel to use font to display text.
If font is not a valid font, this is undefined behaviour.
Sets the SGXColourRGBA of the foreground of this SGWLabel to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the foreground of this SGWLabel to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the SGWHorizontalAlignment mode used to display text in this SGWLabel to alignment.
Sets the text currently displayed in the SGWLabel to the string representation of x.
Sets the text currently displayed in the SGWLabel to the string representation of x.
Sets the text currently displayed in the SGWLabel to text.
Sets the SGWVerticalAlignment mode used to display text in this SGWLabel to alignment.
©2025 05524F.sg (Singapore)