sincerely Singaporean

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

SGWMultiTouchReceiver

see header file

see source file

class SGWMultiTouchReceiver;

part of SGEXTN module SG_Widgets

SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ custom interactive component accepting multiple touch events

detailed description

list of all including inherited members

implementation details

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

CMake target for BuildLah: SGEXTN::SG_Widgets

see this link for more information about BuildLah

parent class: SGWWidget

children classes: (none)

instance member variables

int attachedInt;

SGXString attachedString;

void (*callbackFunction)(const SGLArraySGXTouchEvent›&);

void (*callbackFunctionWithInt)(int, const SGLArraySGXTouchEvent›&);

void (*callbackFunctionWithPointer)(SGWMultiTouchReceiver*, const SGLArraySGXTouchEvent›&);

void (*callbackFunctionWithString)(SGXString, const SGLArraySGXTouchEvent›&);

instance member functions

SGWMultiTouchReceiver(SGWWidget* parent, void (*function)(const SGLArraySGXTouchEvent›&), float x1, float x0, float y1, float y0, float w1, float w0, float h1, float h0);

[[nodiscard]] float getHeight() const;

[[nodiscard]] float getWidth() const;

Detailed Description

SGWMultiTouchReceiver allows for custom programmed interactive components in SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾. It receives multiple touch events simultaneously and sends them all to a callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ for processing in the form of a SGLArray of SGXTouchEvent.

Implementation Details

Stores information about the SGWMultiTouchReceiver.

int attachedInt;

Int attached to this SGWMultiTouchReceiver.

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

SGXString attachedString;

String attached to this SGWMultiTouchReceiver.

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

void (*callbackFunction)(const SGLArraySGXTouchEvent›&);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ called when the user interacts with the SGWMultiTouchReceiver. All touch events are sent using a SGLArray of SGXTouchEvent.

void (*callbackFunctionWithInt)(int, const SGLArraySGXTouchEvent›&);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ called when the user interacts with the SGWMultiTouchReceiver. All touch events are sent using a SGLArray of SGXTouchEvent, in addition to SGWMultiTouchReceiver::attachedInt.

void (*callbackFunctionWithPointer)(SGWMultiTouchReceiver*, const SGLArraySGXTouchEvent›&);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ called when the user interacts with the SGWMultiTouchReceiver. All touch events are sent using a SGLArray of SGXTouchEvent, in addition to a pointer to this SGWMultiTouchReceiver.

void (*callbackFunctionWithString)(SGXString, const SGLArraySGXTouchEvent›&);

callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ called when the user interacts with the SGWMultiTouchReceiver. All touch events are sent using a SGLArray of SGXTouchEvent, in addition to SGWMultiTouchReceiver::attachedString.

SGWMultiTouchReceiver(SGWWidget* parent, void (*function)(const SGLArraySGXTouchEvent›&), float x1, float x0, float y1, float y0, float w1, float w0, float h1, float h0);

Creates a SGWMultiTouchReceiver with parent SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ parent, w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ coordinates (x1, x0, y1, y0, w1, w0, h1, h0), and callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ function.

5 touch events will be sent to the callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ function, but this may change in a future SGEXTN version.

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.

[[nodiscard]] float getHeight() const;

Returns the height in pixels of this SGWMultiTouchReceiver.

This should only be used to interpret the SGXTouchEvent sent from the SGWMultiTouchReceiver. Using pixel size for any other purpose is not recommended, instead use w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.

[[nodiscard]] float getWidth() const;

Returns the width in pixels of this SGWMultiTouchReceiver.

This should only be used to interpret the SGXTouchEvent sent from the SGWMultiTouchReceiver. Using pixel size for any other purpose is not recommended, instead use w-distance ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.

©2025 05524F.sg (Singapore)

contact 05524F / report a bug / make a suggestion

about 05524F SINGAPORE values

list of 05524F projects