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

#include <view_selection.h>

+ Inheritance diagram for ViewSelection:

Public Member Functions

virtual void draw (void) override
 
virtual void addChoice (std::string name, call_t call)
 
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

size_t selection = 0
 
std::vector< std::string > choices
 
- 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 choice_offset_x = 2
 
constexpr static int choice_offset_y = 3
 
- 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

View for user selection input.

Definition at line 10 of file view_selection.h.

Member Function Documentation

◆ draw()

void ViewSelection::draw ( void  )
overridevirtual

Abstract function for drawing ths particular view. Gets overridden in the derived classes to paints for example a promt.

Implements View.

Definition at line 3 of file view_selection.cpp.

◆ keypress()

call_t ViewSelection::keypress ( int &  key)
overridevirtual

Abstract function for the view to reacted on a keypress. Gets overridden in the derived classes to close for example a view on ESC.

Implements View.

Definition at line 22 of file view_selection.cpp.


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