sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
class SGWSingleTouchReceiver;
part of SGEXTN module SG_Widgets
SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ custom interactive component accepting 1 touch event
list of all including inherited members
preprocessor file inclusion directive: #include ‹SGWSingleTouchReceiver.h›
CMake target for BuildLah: SGEXTN::SG_Widgets
see this link for more information about BuildLah
parent class: SGWWidget
children classes: (none)
int attachedInt;
void (*callbackFunction)(const SGXTouchEvent&);
void (*callbackFunctionWithInt)(int, const SGXTouchEvent&);
void (*callbackFunctionWithPointer)(SGWSingleTouchReceiver*, const SGXTouchEvent&);
void (*callbackFunctionWithString)(SGXString, const SGXTouchEvent&);
SGWSingleTouchReceiver(SGWWidget* parent, void (*function)(const SGXTouchEvent&), float x1, float x0, float y1, float y0, float w1, float w0, float h1, float h0);
[[nodiscard]] float getHeight() const;
[[nodiscard]] float getWidth() const;
SGWSingleTouchReceiver allows for custom programmed interactive components in SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾. It receives 1 touch event at a time and sends it to a callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ for processing in the form of a SGXTouchEvent. Additional touch events are ignored.
Stores information about the SGWSingleTouchReceiver.
Int attached to this SGWSingleTouchReceiver.
This is used to identify the source of the callback in callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
String attached to this SGWSingleTouchReceiver.
This is used to identify the source of the callback in callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ called when the user interacts with the SGWSingleTouchReceiver. The touch event is sent as a SGXTouchEvent.
callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ called when the user interacts with the SGWSingleTouchReceiver. The touch event is sent as a SGXTouchEvent along with SGWSingleTouchReceiver::attachedInt.
callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ called when the user interacts with the SGWSingleTouchReceiver. The touch event is sent as a SGXTouchEvent along with a pointer to this SGWSingleTouchReceiver.
callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ called when the user interacts with the SGWSingleTouchReceiver. The touch event is sent as a SGXTouchEvent along with SGWSingleTouchReceiver::attachedString.
Creates a SGWSingleTouchReceiver with parent SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ parent, w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ coordinates (x1, x0, y1, y0, w1, w0, h1, h0), and callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ function.
Only the first touch event will be sent, the others will be ignored.
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 height in pixels of this SGWSingleTouchReceiver.
This should only be used to interpret the SGXTouchEvent sent from the SGWSingleTouchReceiver. Using pixel size for any other purpose is not recommended, instead use w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
Returns the width in pixels of this SGWSingleTouchReceiver.
This should only be used to interpret the SGXTouchEvent sent from the SGWSingleTouchReceiver. Using pixel size for any other purpose is not recommended, instead use w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
©2025 05524F.sg (Singapore)