C++ DevKit
C++ set of OOP library
|
A widget is a displayed object on a device screen. This is the base widget, it is derived as GraphicWidget with graphical capabilities and GraphicWidget is derived as TextWidget that adds textual capabilities. More...
#include <widget.h>
Public Member Functions | |
Widget (Model *actual_displayed_model, DisplayDevice *graphic_display_device=nullptr) | |
contructor for generic widget | |
void | add_widget (Widget *_sub_widget) |
add sub_widget to the current widget | |
void | set_display_device (DisplayDevice *_new_display_device) |
Set the display screen object. | |
virtual void | draw ()=0 |
a pure virtual member that is called to effectively draw the widget. | |
Protected Attributes | |
DisplayDevice * | display_device {nullptr} |
the display device where the attached to the frame buffer | |
Model * | actual_displayed_model {nullptr} |
a pointer to the Model actually displayed by the widget | |
std::vector< Widget * > | widgets |
A widget can be composed by several widgets. | |
A widget is a displayed object on a device screen. This is the base widget, it is derived as GraphicWidget with graphical capabilities and GraphicWidget is derived as TextWidget that adds textual capabilities.
USAGE: A widget is defined by a frame with width and height in pixel, and line and column of text if derived as TextualWidget. This frame is located within the display device screen at an anchor point (x,y).
Widget::Widget | ( | Model * | actual_displayed_model, |
DisplayDevice * | graphic_display_device = nullptr ) |
contructor for generic widget
actual_displayed_model | the displayed model of the widget |
graphic_display_device | The display device on which the widget is drawn. This device can be "null". |
void Widget::add_widget | ( | Widget * | _sub_widget | ) |
add sub_widget to the current widget
_sub_widget |
|
pure virtual |
a pure virtual member that is called to effectively draw the widget.
Implemented in TextWidget, WidgetBlinkingSquareLed, WidgetHorizontalBar, WidgetHorizontalBargraph, WidgetSquareLed, and WidgetVerticalBargraph.
void Widget::set_display_device | ( | DisplayDevice * | _new_display_device | ) |
Set the display screen object.
_new_display_device |