B15F
Board 15 Famulus Edition
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ViewInfo Class Reference

#include <view_info.h>

+ Inheritance diagram for ViewInfo:

Public Member Functions

 ViewInfo (void)
 
virtual void setText (std::string text)
 
virtual void setLabelClose (std::string label)
 
virtual void setCall (call_t call)
 
virtual void draw (void) override
 
virtual call_t keypress (int &key) override
 
- Public Member Functions inherited from View
 View (void)
 
virtual ~View (void)
 
virtual void setTitle (std::string title)
 
virtual void repaint (void)
 

Protected Attributes

std::string text
 Benachrichtigungstext dieser View.
 
std::string label_close
 Beschriftung für Button zum Schließen.
 
int close_offset_x = 0
 Relative X Koordinate des Buttons zum Schließen im Window.
 
int close_offset_y = 0
 Relative Y Koordinate des Buttons zum Schließen im Window.
 
- Protected Attributes inherited from View
int width
 width of view in terminal characters
 
int height
 height of view in terminal characters
 
int start_x = 0
 x offset (characters) in the terminal, used to center the window on repaint()
 
int start_y = 0
 y offset (characters) in the terminal, used to center the window on repaint()
 
std::string title
 title of the view
 
std::vector< call_t > calls
 calls (function pointers) for different button actions in the view (if any)
 

Static Protected Attributes

constexpr static int text_offset_x = 2
 Relativer Abstand des Textes zum linken Rahmen.
 
constexpr static int text_offset_y = 3
 Relativer Abstand des Textes zum oberen Rahmen.
 
- Static Protected Attributes inherited from View
static WINDOW * win = nullptr
 static window contexts for all views
 
constexpr static int KEY_ENT = 10
 Key value for the Enter key.
 

Additional Inherited Members

- Static Public Member Functions inherited from View
static void setWinContext (WINDOW *win)
 
static WINDOW * getWinContext (void)
 
static std::vector< std::string > str_split (const std::string &str, const std::string delim)
 

Detailed Description

Klasse für einfache Textausgaben (Benachrichtigungen). Diese können mit einem Button geschlossen werden.

Definition at line 11 of file view_info.h.

Constructor & Destructor Documentation

◆ ViewInfo()

ViewInfo::ViewInfo ( void  )

Standard-Konstruktor ohne Argumente

Definition at line 3 of file view_info.cpp.

Member Function Documentation

◆ draw()

void ViewInfo::draw ( void  )
overridevirtual

Zeichnet diese View mit dem Benachrichtigungstext.

Implements View.

Definition at line 23 of file view_info.cpp.

◆ keypress()

call_t ViewInfo::keypress ( int &  key)
overridevirtual

Verarbeitet einen Tastendruck, z.B. Enter = Button angewählt.

Parameters
keygedrückte Taste
Returns
Call, der nach dem keypress ausgeführt werden soll

Implements View.

Reimplemented in ViewMonitor.

Definition at line 37 of file view_info.cpp.

◆ setCall()

void ViewInfo::setCall ( call_t  call)
virtual

Setzt den Call der aufgerufen wird, wenn der Button angewählt wird. Wurde setCall weggelassen oder setCall(nullptr) gesetzt, wird diese View nur geschlossen und keine weitere Aktion ausgelöst.

Parameters
callNachfolge-Aktion

Definition at line 18 of file view_info.cpp.

◆ setLabelClose()

void ViewInfo::setLabelClose ( std::string  label)
virtual

Setzt die Beschriftung des Buttons zum Schließen

Parameters
labelBeschriftung des Buttons

Definition at line 13 of file view_info.cpp.

◆ setText()

void ViewInfo::setText ( std::string  text)
virtual

Setzt den Text dieser Benachrichtigungs-View

Parameters
textText der View

Definition at line 8 of file view_info.cpp.


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