Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
Public Member Functions | Public Attributes | Protected Attributes | List of all members
gui_element Class Reference

Paren class for other gui elements. More...

#include <gui_element.h>

Inheritance diagram for gui_element:
gui_button gui_combobox gui_direct gui_input gui_label gui_observer gui_selectable

Public Member Functions

void set_refresh_screen (bool *refresh_flag)
 
virtual void render_element ()
 

Public Attributes

int index = -1
 

Protected Attributes

int width = -1
 
int x = -1
 
int y = -1
 
bool * refresh_screen = nullptr
 

Detailed Description

Paren class for other gui elements.

Definition at line 8 of file gui_element.h.

Member Function Documentation

◆ render_element()

void gui_element::render_element ( )
virtual

This function calls the element rendering. This is required to be overriden for the element to be rendered

Reimplemented in gui_selectable, gui_observer, gui_label, gui_input, gui_direct, gui_combobox, and gui_button.

Definition at line 9 of file gui_element.cpp.

9  {
10  // if positions is set
11  if (x > -1)
12  ImGui::SetCursorPosX((float) x);
13  if (y > -1)
14  ImGui::SetCursorPosY((float) y);
15 
16  // if width is set
17  // if (width > -1)
18  // ImGui::PushItemWidth((float) width);
19 }

◆ set_refresh_screen()

void gui_element::set_refresh_screen ( bool *  refresh_flag)

Allows to set refresh screen flag. When this is set, the screen elements are reloaded

Definition at line 5 of file gui_element.cpp.

5  {
6  this->refresh_screen = refresh_flag;
7 }
bool * refresh_screen
Definition: gui_element.h:14

Member Data Documentation

◆ index

int gui_element::index = -1

Definition at line 20 of file gui_element.h.

◆ refresh_screen

bool* gui_element::refresh_screen = nullptr
protected

Definition at line 14 of file gui_element.h.

◆ width

int gui_element::width = -1
protected

Definition at line 10 of file gui_element.h.

◆ x

int gui_element::x = -1
protected

Definition at line 11 of file gui_element.h.

◆ y

int gui_element::y = -1
protected

Definition at line 11 of file gui_element.h.


The documentation for this class was generated from the following files: