sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
class SGWBackground;
part of SGEXTN module SG_Widgets
SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ UI page background base class
list of all including inherited members
preprocessor file inclusion directive: #include ‹SGWBackground.h›
CMake target for BuildLah: SGEXTN::SG_Widgets
see this link for more information about BuildLah
parent class: SGWWidget
children classes: SGWPageBackground, SGWScrollView, SGWSequentialScrollView
[[nodiscard]] SGXColourRGBA getColour(bool* isUsing) const;
[[nodiscard]] int getThemeColour(bool* isUsing) const;
void setColour(SGXColourRGBA colour);
void setThemeColour(int themeColour);
static void disable(SGWBackground*& thisPointer);
static void enable(SGWBackground*& thisPointer, SGWBackground* (*initFunction)(), void (*resetFunction)());
SGWBackground provides a base class for UI pages. This is not meant to be instantiated directly, you are supposed to create its subclasses (SGWPageBackground, SGWScrollView, SGWSequentialScrollView) to use its functionality. SGWBackground allows you to easily turn on and turn off SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ UI pages. Use a SGWBlankWidget instead if only a blank rectangle is needed.
Stores information about the SGWBackground and also within static variables, information about which SGWBackground are on.
Returns the SGXColourRGBA currently being used for the background of this SGWBackground. 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 SGWBackground. 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.
Sets the SGXColourRGBA of the background of this SGWBackground to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWBackground to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Turns off the UI page referenced by thisPointer then set thisPointer, which is passed by reference, to nullptr.
If thisPointer is nullptr when the function is called, it is assumed that the UI page is already off so nothing is done. If the UI page was previously turned on using SGWBackground::enable, this is not a concern.
Turn on a SGWBackground using a initialisation function and a reset function. initFunction is run to create the SGWBackground instance which is stored in thisPointer which is passed by reference, then resetFunction is run.
If no resetFunction is needed, pass nullptr to it.
This hides all other UI pages to ensure that keyboard focus (pressing tab) works as expected.
Forgetting to return a valid SGWBackground in initFunction is undefined behaviour.
Passing nullptr to initFunction will crash.
If thisPointer is not nullptr when the function is called, it is assumed that the UI page is already on so nothing is done. If the UI page was previously turned off using SGWBackground::disable, this is not a concern.
©2025 05524F.sg (Singapore)