Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
gui_combobox.h
Go to the documentation of this file.
1 #ifndef GUI_COMBOBOX_H
2 #define GUI_COMBOBOX_H
3 
4 #include "gui_element.h"
5 #include "app_workspace.h"
6 
11 class gui_combobox : public gui_element {
12  private:
14  int si = 0, list_size = 0; // si = selected_index (internal use only)
15  int *selected_index;
16  const char **list = nullptr;
17  const char *label = nullptr;
18  const char *selected_item = nullptr;
20  void (*callback)() = nullptr;
21 
22  public:
35  gui_combobox(const char** list, int list_size, int *selected_index, const char *label = nullptr,
36  int x = -1, int y = -1, int width = -1,
39  void render_element();
42  int get_selected_index();
44  const char* get_selected_item();
46  void set_value_change_action(void (*callback)());
47 };
48 
49 #endif
Wrapper for ImGui combo box structure.
Definition: gui_combobox.h:11
const char * get_selected_item()
void render_element()
void set_value_change_action(void(*callback)())
gui_combobox(const char **list, int list_size, int *selected_index, const char *label=nullptr, 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 combobox object.
Definition: gui_combobox.cpp:4
int get_selected_index()
Paren class for other gui elements.
Definition: gui_element.h:8
font_size
This enum defines sizes of corresponding fonts. E.g.: SMALL_FONT is 12px.