sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
class SGWColourPickerWidget;
part of SGEXTN module SG_RI
SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ for choosing a colour
list of all including inherited members
preprocessor file inclusion directive: #include ‹SGWColourPickerWidget.h›
CMake target for BuildLah: SGEXTN::SG_RI
see this link for more information about BuildLah
parent class: SGWWidget
children classes: (none)
void (*attachedFunction)();
void (*attachedFunctionWithInt)(int);
void (*attachedFunctionWithPointer)(SGWColourPickerWidget*);
void (*attachedFunctionWithString)(const SGXString&);
int attachedInt;
SGWColourPickerWidget(SGWWidget* parent, float x1, float x0, float y1, float y0, float w1, float w0, float h1, float h0, SGXColourRGBA defaultColour);
[[nodiscard]] SGXColourRGBA getBackgroundColour(bool* isUsing) const;
[[nodiscard]] SGXColourRGBA getBackgroundFocusColour(bool* isUsing) const;
[[nodiscard]] int getBackgroundFocusThemeColour(bool* isUsing) const;
[[nodiscard]] SGXColourRGBA getBackgroundHoverColour(bool* isUsing) const;
[[nodiscard]] int getBackgroundHoverThemeColour(bool* isUsing) const;
[[nodiscard]] int getBackgroundThemeColour(bool* isUsing) const;
[[nodiscard]] SGXColourRGBA getColour() const;
[[nodiscard]] float getE0() const;
[[nodiscard]] float getE1() const;
void setBackgroundColour(SGXColourRGBA colour);
void setBackgroundFocusColour(SGXColourRGBA colour);
void setBackgroundFocusThemeColour(int themeColour);
void setBackgroundHoverColour(SGXColourRGBA colour);
void setBackgroundHoverThemeColour(int themeColour);
void setBackgroundThemeColour(int themeColour);
void setColour(SGXColourRGBA colour);
void setE0(float e0);
void setE1(float e1);
SGWColourPickerWidget is part of the SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ system that provides a colour picker, allowing the user to choose a colour. It also supports running a callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ after the colour is chosen. The colour picker UI is builtin to SGEXTN and does not need to be implemented.
SGWColourPickerWidget internally uses SG - RI ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking no arguments, triggered when a colour is selected by the user.
callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a int, triggered when a colour is selected by the user and SGWColourPickerWidget::attachedInt is passed as argument.
callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a pointer to SGWColourPickerWidget, triggered when a colour is selected by the user and the pointer to this SGWColourPickerWidget is passed as argument.
callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ taking a string, triggered when a colour is selected by the user and SGWColourPickerWidget::attachedString is passed as argument.
Int attached to this SGWColourPickerWidget.
This is used to identify the source of the callback in callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
String attached to this SGWColourPickerWidget.
This is used to identify the source of the callback in callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
Creates a SGWColourPickerWidget with parent SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ parent, w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ coordinates (x1, x0, y1, y0, w1, w0, h1, h0), and the default choice of colour set to defaultColour.
parent being nullptr is undefined behaviour.
To avoid use after free bugs, deleting a SGWWidget directly will cause a crash. Use SGWWidget::deleteWidget to delete it safely.
Returns the SGXColourRGBA currently being used for the background of this SGWColourPickerWidget. 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 SGXColourRGBA currently being used for the background of this SGWColourPickerWidget 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.
Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the background of this SGWColourPickerWidget 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.
Returns the SGXColourRGBA currently being used for the background of this SGWColourPickerWidget 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.
Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the background of this SGWColourPickerWidget 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.
Returns the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ currently being used for the background of this SGWColourPickerWidget. 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 currently chosen SGXColourRGBA.
Returns the 0 coordinate of the w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ controlling the width of the border of this SGWColourPickerWidget.
Returns the 1 coordinate of the w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ controlling the width of the border of this SGWColourPickerWidget.
Sets the SGXColourRGBA of the background of this SGWColourPickerWidget to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the SGXColourRGBA of the background of this SGWColourPickerWidget when focused to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWColourPickerWidget when focused to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the SGXColourRGBA of the background of this SGWColourPickerWidget when hovered over to colour and turns off theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWColourPickerWidget when hovered over to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ of the background of this SGWColourPickerWidget to themeColour and turns on theme colour ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ mode.
Sets the currently chosen SGXColourRGBA to colour.
This does not activate callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
Sets the 0 coordinate of the w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ controlling the width of the border of this SGWColourPickerWidget to e0.
Sets the 1 coordinate of the w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ controlling the width of the border of this SGWColourPickerWidget to e1.
©2025 05524F.sg (Singapore)