Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
gui_observer.h
Go to the documentation of this file.
1 #ifndef GUI_OBSERVER_H
2 #define GUI_OBSERVER_H
3 
4 #include "gui_element.h"
5 #include "app_workspace.h"
6 
16 };
17 
23 class gui_observer : public gui_element {
24  private:
25  observed_type type;
26  void* target;
27  const char *label = nullptr;
29 
30  public:
41  gui_observer(observed_type type, void* target, int x = -1, int y = -1, int width = -1,
43 
45  void render_element();
46 };
47 
48 #endif
Paren class for other gui elements.
Definition: gui_element.h:8
Allows to create a label, that automatically updates to observed variable value. This class doesn't w...
Definition: gui_observer.h:23
void render_element()
gui_observer(observed_type type, void *target, int x=-1, int y=-1, int width=-1, app_workspace_ns::font_size font_size=app_workspace_ns::font_size::NORMAL_FONT)
Construct a new gui observer object.
Definition: gui_observer.cpp:6
observed_type
Types, that can be observed.
Definition: gui_observer.h:11
@ OBS_INT
Definition: gui_observer.h:12
@ OBS_FLOAT
Definition: gui_observer.h:14
@ OBS_LONG
Definition: gui_observer.h:13
@ OBS_STRING
Definition: gui_observer.h:15
font_size
This enum defines sizes of corresponding fonts. E.g.: SMALL_FONT is 12px.