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

To be inherited to create custom wigets whcih can hold other widgets as children. Derived classes must be passeed as the template type. More...

#include <container_widget.hpp>

Inheritance diagram for bugui::container_widget< T, can_delete >:
bugui::deleter< T, base_container_widget, true >

Public Member Functions

void update () override final
 Calls the set function of the derived class if defined. update will then be called on every child widgets.
void add_held (base_widget *widget) override final
 Called when a child widget is held down. Pointers to held widgets are stored in their parent. Multiple down presses on the same widget stores. duplicates of the same pointer. If an on_held_added function is defined, it will be called.
void remove_held (base_widget *widget) override final
 Called when a child widget is released. The asociated pointer stored in the parent is deleted. If an on_remove_held function is defined, it will be called.
void handle_painter (painter &painter) const override final
 Ofsets the painter's corordinates to match the relative position of the widget. If a paint funciton is defined, it will be called. handle_painter will then be called on every child widgets.
bool handle_presser (presser &presser) override final
 Ofsets the presser's corordinates to match the relative position of the widget. If a paint funciton is defined, it will be called. handle_presser will then be called on every child widgets.
bool handle_child_Delete () override final
 Calls on_child_Delete if defined.
Public Member Functions inherited from bugui::deleter< T, base_container_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::container_widget< T, can_delete >

To be inherited to create custom wigets whcih can hold other widgets as children. Derived classes must be passeed as the template type.

Member Function Documentation

◆ add_held()

template<typename T, bool can_delete>
void bugui::container_widget< T, can_delete >::add_held ( base_widget * widget)
inlinefinaloverride

Called when a child widget is held down. Pointers to held widgets are stored in their parent. Multiple down presses on the same widget stores. duplicates of the same pointer. If an on_held_added function is defined, it will be called.

Parameters
widgetpoints to the held widget.

◆ handle_child_Delete()

template<typename T, bool can_delete>
bool bugui::container_widget< T, can_delete >::handle_child_Delete ( )
inlinefinaloverride

Calls on_child_Delete if defined.

Returns
true if on_child_Delete is called, false otherwise.

◆ handle_painter()

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

Ofsets the painter's corordinates to match the relative position of the widget. If a paint funciton is defined, it will be called. handle_painter will then be called on every child widgets.

Parameters
painterreference, passed down from the controller to all child widgets.

◆ handle_presser()

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

Ofsets the presser's corordinates to match the relative position of the widget. If a paint funciton is defined, it will be called. handle_presser will then be called on every child widgets.

Parameters
presserreference, passed down from the hardware to all child widgets.

◆ remove_held()

template<typename T, bool can_delete>
void bugui::container_widget< T, can_delete >::remove_held ( base_widget * widget)
inlinefinaloverride

Called when a child widget is released. The asociated pointer stored in the parent is deleted. If an on_remove_held function is defined, it will be called.

Parameters
widgetpoints to the released widget.

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