BuGUI
BUtton Grid User Interface
Loading...
Searching...
No Matches
bugui::widget< T, can_delete > Struct Template Reference

To be inherited to create custom wigets. Derived classes must be passeed as the template type. More...

#include <widget.hpp>

Inheritance diagram for bugui::widget< T, can_delete >:
bugui::deleter< T, base_widget, true >

Public Member Functions

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.
Public Member Functions inherited from bugui::deleter< T, base_widget, true >
bool handle_Delete () override final
 Calls on_Delete if defined, otherwise simply deletes the widget.

Detailed Description

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.

Member Function Documentation

◆ handle_painter()

template<typename T, bool can_delete>
void bugui::widget< T, can_delete >::handle_painter ( painter & painter) const
inlinefinaloverride

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.

Parameters
painterprovides all painting functionalities.

◆ handle_presser()

template<typename T, bool can_delete>
bool bugui::widget< T, can_delete >::handle_presser ( presser & presser)
inlinefinaloverride

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
painterprovides all painting functionalities.

The documentation for this struct was generated from the following file: