BuGUI
BUtton Grid User Interface
Loading...
Searching...
No Matches
base_widget.hpp
1#pragma once
2#include <io/painter.hpp>
3#include <io/presser.hpp>
4
5namespace bugui
6{
7struct base_controller;
11struct base_widget : rectangle
12{
14 virtual void repaint();
15
16 virtual void update() = 0;
17 virtual void handle_painter(painter& painter) const = 0;
18 virtual bool handle_presser(presser& presser) = 0;
19 virtual bool handle_Delete() = 0;
20
24 base_container_widget* get_parent() const { return parent; }
25
29 base_controller* get_root() const { return root; }
30
31 virtual ~base_widget() = default;
32
33protected:
34 explicit base_widget(base_container_widget* parent);
35
36 base_container_widget* parent{nullptr};
37 base_controller* root{nullptr};
38};
39
40} // namespace bugui
Provides functionalities for 2D widget that can hold other widgets as children.
Definition base_container_widget.hpp:14
Serves as the root of the widget tree. Also provides access to buttons componnents.
Definition base_controller.hpp:10
Provides the minimum required 2D widget functionalities.
Definition base_widget.hpp:12
virtual void repaint()
Calls for this widget to be repainted.
base_container_widget * get_parent() const
Retrieves the parent widget.
Definition base_widget.hpp:24
base_controller * get_root() const
Retrieves the root widget.
Definition base_widget.hpp:29
The painter class.
Definition painter.hpp:12
Definition presser.hpp:14
Provides the geometric structure of widgets.
Definition rectangle.hpp:8