C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
widget_horizontal_bar.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "sw/ui_core/ui_core.h"
14#include "sw/widget/widget.h"
15
16
20{
21private:
23 int level;
29 uint8_t px_max;
31 uint8_t px_min;
33 uint8_t px_position;
38
41
42protected:
43public:
45 void draw();
46
54 WidgetHorizontalBar(Model *bar_value_model,
55 GraphicDisplayDevice *graphic_display_screen,
56 int max_value, int min_value,
58 CanvasFormat format);
59
63 void set_level(int value);
64};
CanvasFormat
the format of the canvas
Definition canvas.h:61
This is the abstract class to handle all generic behavior of physical graphic display devices (e....
Definition display_device.h:58
GraphicWidget(GraphicDisplayDevice *graphic_display_screen, struct_ConfigGraphicWidget graph_cfg, CanvasFormat canvas_format, Model *displayed_object=nullptr)
Construct a new Graphic Widget object.
Definition widget.cpp:52
This is the Model abstract class of Model_View_Control design pattern.
Definition ui_core.h:37
uint8_t px_max
the x-position of the max level value
Definition widget_horizontal_bar.h:29
int level_offset
the offset of the conversion level-> pixel
Definition widget_horizontal_bar.h:37
uint8_t px_min
the y-position of the min level value
Definition widget_horizontal_bar.h:31
void set_level(int value)
set the level to value
Definition widget_horizontal_bar.cpp:62
int min_value
the min value of the level
Definition widget_horizontal_bar.h:27
int level
the filled level of the widget
Definition widget_horizontal_bar.h:23
void draw()
the draw function of the widget
Definition widget_horizontal_bar.cpp:10
WidgetHorizontalBar(Model *bar_value_model, GraphicDisplayDevice *graphic_display_screen, int max_value, int min_value, struct_ConfigGraphicWidget graph_cfg, CanvasFormat format)
Construct a new GraphicWidget Horizontal Bar object.
Definition widget_horizontal_bar.cpp:42
void convert_level_value_to_px()
the conversion fucntion level -> value
Definition widget_horizontal_bar.cpp:4
float level_coef
the proportional coefficient of the conversion level-> pixel
Definition widget_horizontal_bar.h:35
uint8_t px_position
the converted x-position pixel for the level value
Definition widget_horizontal_bar.h:33
int max_value
the max value of the level
Definition widget_horizontal_bar.h:25
data structure used to configure graphic framebuffer
Definition canvas.h:81