BuGUI
BUtton Grid User Interface
Loading...
Searching...
No Matches
presser.hpp
1#pragma once
2#include "button_presser.hpp"
3#include <bugui/geometry/rectangle.hpp>
4
5namespace bugui
6{
7struct base_controller;
8
13struct presser final
15 , rectangle
16{
19 void ofset(int x, int y);
20
23 void set_drag(int to_x, int to_y);
25 void set_drop();
26
29 void set_double_press(int x, int y);
32 void set_drag(int from_x, int from_y, int to_x, int to_y);
35 void set_drop(int x, int y);
36
38 int get_target_x() const { return target_x; }
40 int get_target_y() const { return target_y; }
41
42private:
43 int target_x{0};
44 int target_y{0};
45};
46
47} // namespace bugui
Serves as the root of the widget tree. Also provides access to buttons componnents.
Definition base_controller.hpp:10
Provides a generic interface to represent a button press event by the user on the device.
Definition button_presser.hpp:12
Adds 2D information on top of a button_presser. Meant to traverse the entire widget tree,...
Definition presser.hpp:16
void set_drag(int to_x, int to_y)
Flags the input as a drag event and sets it's target coordinates.
void set_double_press(int x, int y)
Flags the input as a drop event and sets it's coordinates.
void set_drop()
Flags the input as a drop event.
int get_target_x() const
Retrives x target coordinate of a drag event.
Definition presser.hpp:38
int get_target_y() const
Retrives y target coordinate of a drag event.
Definition presser.hpp:40
void set_drop(int x, int y)
Flags the input as a drop event and sets it's coordinates.
void ofset(int x, int y)
Displaces the underlying rectangle by the given arguments.
void set_drag(int from_x, int from_y, int to_x, int to_y)
Flags the input as a drag event and sets both it's initial and it's target coordinates.
Provides the geometric structure of widgets.
Definition rectangle.hpp:8