A mix-in that will make class T draggable and able to snap to a position when a drag operation has ended. The mix-in is able to perform callbacks when the snapper gets dragged and when the Snapper snaps to its snap position.
- T specifies the type to enable the Snap behavior to.
Inherits from: touchgfx::Draggable< T >, T
|virtual void||handleClickEvent(const ClickEvent & evt)|
|Handles the click events when the Snapper is clicked.|
|virtual void||handleDragEvent(const DragEvent & evt)|
|Called when dragging the Draggable object.|
|void||setDragAction(GenericCallback< const DragEvent & > & callback)|
|Associates an action to be performed when the Snapper is dragged.|
|void||setSnappedAction(GenericCallback<> & callback)|
|Associates an action to be performed when the Snapper is snapped.|
|void||setSnapPosition(int16_t x, int16_t y)|
|Sets the position the Snapper should snap to.|
Handles the click events when the Snapper is clicked.
It saves its current position as the snap position if the Snapper is pressed. This happens when the drag operation starts.
The snapper will then move to the snap position when the click is released. This happens when the drag operation ends.
|evt||The click event.|
|void setSnapPosition||(||int16_t||x ,|