|
BuGUI
BUtton Grid User Interface
|
Adds 2D information on top of a button_presser. Meant to traverse the entire widget tree, each widget temporarly applies a coordinate offset to the paresser, reflecting their relative position in the scene. More...
#include <presser.hpp>
Public Member Functions | |
| void | ofset (int x, int y) |
| Displaces the underlying rectangle by the given arguments. | |
| void | set_drag (int to_x, int to_y) |
| Flags the input as a drag event and sets it's target coordinates. | |
| void | set_drop () |
| Flags the input as a drop event. | |
| void | set_double_press (int x, int y) |
| Flags the input as a drop event and sets it's coordinates. | |
| 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. | |
| void | set_drop (int x, int y) |
| Flags the input as a drop event and sets it's coordinates. | |
| int | get_target_x () const |
| Retrives x target coordinate of a drag event. | |
| int | get_target_y () const |
| Retrives y target coordinate of a drag event. | |
| Public Member Functions inherited from bugui::button_presser | |
| void | set_midi (uint8_t midi) |
| Stores the given MIDI value. | |
| void | set_bool (bool boolean) |
| Stores the given boolean value. | |
| void | set_double_press () |
| Flags the input as a double press event. | |
| states | get_state () const |
| Retieves the curent state. | |
| bool | get_bool () |
| Converts the currently stored value to boolean if necesary, and returns the result. | |
| bool | get_midi () |
| Converts the currently stored value to boolean if necesary, and returns the result. | |
| void | clear_values () |
| Ignore currently held values and allows for overwriting them. | |
| Public Member Functions inherited from bugui::rectangle | |
| int | get_x () const |
| int | get_y () const |
| void | set_x (int new_x) |
| void | set_y (int new_y) |
| int | get_width () const |
| int | get_height () const |
| void | set_width (int new_width) |
| void | set_height (int new_height) |
| void | set_size (int new_size) |
| void | set (int new_x, int new_y) |
| void | set (int new_x, int new_y, int new_width, int new_height) |
| const point & | get_top_left () const |
| const point & | get_bottom_right () const |
| void | set_top_left (point &&new_top_left) |
| void | set_bottom_right (point &&new_bottom_right) |
Additional Inherited Members | |
| Public Types inherited from bugui::button_presser | |
| enum | states : uint8_t { single , doubled , dragged , dropped } |
| Protected Types inherited from bugui::button_presser | |
| enum class | available_values : std::uint8_t { none = 0 , boolean = 1 , midi = 2 } |
| Protected Member Functions inherited from bugui::rectangle | |
| virtual bool | overlap (rectangle &other) const |
| Checks whether this rectangle overlaps with another. This funciton is the bassis for handling inputs on the grid. The presser object also inherits from rectangle, and this function is called to check if a press event overlaps with a widget. If so, we can determine that this particular widget is pressed. Custom widgets can override this funciton for a more fine grained handling of presses. | |
| Protected Attributes inherited from bugui::button_presser | |
| states | state {single} |
| available_values | available {available_values::none} |
Adds 2D information on top of a button_presser. Meant to traverse the entire widget tree, each widget temporarly applies a coordinate offset to the paresser, reflecting their relative position in the scene.