To be inherited to create custom wigets. Derived classes must be passeed as the template type.
More...
|
|
void | update () override final |
| | Calls the set() function of the derived class if defined.
|
| void | handle_painter (painter &painter) const override final |
| | Calls the paint(painter&) function of the derived class if defined. The position of the painter is offsested by the position of the widget. The widget can then be painted at it's relative position. Before returning, the painter is offseted back, rendering the painted widget at it's absolute position.
|
| bool | handle_presser (presser &presser) override final |
| | Depending on the presser::states, calls either on_double_press(presser&), on_drag(presser&) ,on_drop(presser&) or on_press(presser&) of the derived class if defined. The position of the painter is offsested by the position of the widget. The widget can then be painted at it's relative position. Before returning, the painter is offseted back, rendering the painted widget at it's absolute position.
|
| bool | handle_Delete () override final |
| | Calls on_Delete if defined, otherwise simply deletes the widget.
|
template<typename T, bool can_delete = true>
struct bugui::widget< T, can_delete >
To be inherited to create custom wigets. Derived classes must be passeed as the template type.
template<typename T, bool can_delete>
Depending on the presser::states, calls either on_double_press(presser&), on_drag(presser&) ,on_drop(presser&) or on_press(presser&) of the derived class if defined. The position of the painter is offsested by the position of the widget. The widget can then be painted at it's relative position. Before returning, the painter is offseted back, rendering the painted widget at it's absolute position.
- Parameters
-
| painter | provides all painting functionalities. |