BuGUI
BUtton Grid User Interface
Loading...
Searching...
No Matches
bugui::base_controller Struct Reference

Serves as the root of the widget tree. Also provides access to buttons componnents. More...

#include <base_controller.hpp>

Inheritance diagram for bugui::base_controller:
bugui::base_container_widget bugui::base_widget bugui::rectangle bugui::ctrlr_deleter< T > bugui::ctrlr_deleter< T > bugui::ctrlr_deleter< T > bugui::ctrlr_shifter< T > bugui::ctrlr_shifter< T > bugui::ctrlr_shifter< T > bugui::ctrlr_shifter< T > bugui::ctrlr_shifter< T > bugui::ctrlr_shifter< T > bugui::controller< T > bugui::controller< T > bugui::controller< T > bugui::controller< T >

Public Member Functions

void local_repaint (base_widget *widget)
 Triggers the painting of the widget pointed to by the parameter.
double get_horizontal_scale () const noexcept
 Retrieves the horizontal scale value.
double get_vertical_scale () const noexcept
 Retrieves the vertical scale value.
bool handle_Delete () override final
Public Member Functions inherited from bugui::base_container_widget
 base_container_widget (base_container_widget *parent)
virtual void add_held (base_widget *widget)=0
virtual void remove_held (base_widget *widget)=0
virtual bool handle_child_Delete ()=0
const std::vector< base_widget * > & get_held () const
 Retrieves all held widgets, including duplicates.
std::vector< base_widget * > get_unique_held () const
 Retrieves held widgets, filtering out duplicates.
std::vector< base_widget * > get_deepest_held ()
 Retrieves all held items that do not have child held widgets i.e. the deepest held widget in the hierarchy.
void remove_widget (base_widget *widget)
 Removes a child widget.
Public Member Functions inherited from bugui::base_widget
virtual void repaint ()
 Calls for this widget to be repainted.
virtual void update ()=0
virtual void handle_painter (painter &painter) const =0
virtual bool handle_presser (presser &presser)=0
base_container_widgetget_parent () const
 Retrieves the parent widget.
base_controllerget_root () const
 Retrieves the root widget.
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 pointget_top_left () const
const pointget_bottom_right () const
void set_top_left (point &&new_top_left)
void set_bottom_right (point &&new_bottom_right)

Protected Member Functions

 base_controller (std::unique_ptr< base_hardware > &&hardware)
void increment_horizontal_scale (double scale_inc)
 Increments the horizontal scale value.
void increment_vertical_scale (double scale_inc)
 Increments the vertical scale value.
void set_horizontal_scale (double scale)
 Set the horizontal scale value.
void set_vetical_scale (double scale)
 Set the vertical scale value.
Protected Member Functions inherited from bugui::base_container_widget
template<typename T, typename ... Args>
requires std::derived_from<T, base_widget>
base_widget * add_widget (Args &...args)
 Create and add a child widget.
template<typename T, typename ... Args>
requires std::derived_from<T, base_widget>
base_widget * add_widget (Args &&...args)
 Create and add a child widget.
template<class Pred>
requires (!std::derived_from<std::remove_pointer_t<Pred> , base_widget>)
base_widget * remove_widget (Pred pred)
 Removes a child widget.
Protected Member Functions inherited from bugui::base_widget
 base_widget (base_container_widget *parent)
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

std::unique_ptr< base_hardwarehdw
painter paint
Protected Attributes inherited from bugui::base_container_widget
std::vector< base_widget * > held
std::vector< std::unique_ptr< base_widget > > children
Protected Attributes inherited from bugui::base_widget
base_container_widgetparent {nullptr}
base_controllerroot {nullptr}

Detailed Description

Serves as the root of the widget tree. Also provides access to buttons componnents.

Member Function Documentation

◆ get_horizontal_scale()

double bugui::base_controller::get_horizontal_scale ( ) const
inlinenoexcept

Retrieves the horizontal scale value.

Returns
double precission value of the horizontal scale.

◆ get_vertical_scale()

double bugui::base_controller::get_vertical_scale ( ) const
inlinenoexcept

Retrieves the vertical scale value.

Returns
double precission value of the vertical scale.

◆ handle_Delete()

bool bugui::base_controller::handle_Delete ( )
inlinefinaloverridevirtual

Implements bugui::base_widget.

◆ increment_horizontal_scale()

void bugui::base_controller::increment_horizontal_scale ( double scale_inc)
protected

Increments the horizontal scale value.

Parameters
scale_incdouble precision value of the scale incerment

◆ increment_vertical_scale()

void bugui::base_controller::increment_vertical_scale ( double scale_inc)
protected

Increments the vertical scale value.

Parameters
scale_incdouble precision value of the scale incerment

◆ set_horizontal_scale()

void bugui::base_controller::set_horizontal_scale ( double scale)
protected

Set the horizontal scale value.

Parameters
scaledouble precision value of the scale factor

◆ set_vetical_scale()

void bugui::base_controller::set_vetical_scale ( double scale)
protected

Set the vertical scale value.

Parameters
scaledouble precision value of the scale factor

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