B15F
Board 15 Famulus Edition
view_promt.h
1 #ifndef VIEW_PROMT_H
2 #define VIEW_PROMT_H
3 
4 #include <vector>
5 #include <string>
6 #include "view.h"
7 
8 class ViewPromt : public View
9 {
10 public:
11  virtual void draw(void) override;
12  virtual void setMessage(std::string message);
13  virtual void setConfirm(std::string name, call_t call);
14  virtual void setCancel(std::string name, bool cancelable);
15  virtual std::string getInput(void);
16  virtual call_t keypress(int& key) override;
17 
18 protected:
19  size_t selection = 1;
20  std::string input;
21  std::string message = "Input";
22  std::string label_confirm = "[ OK ]";
23  std::string sep = " ";
24  std::string label_cancel = "[ Cancel ]";
25  call_t call_confirm = nullptr;
26  bool cancelable = true;
27  int button_offset_x = 0, button_offset_y = 0;
28  constexpr static int text_offset_x = 2;
29  constexpr static int text_offset_y = 2;
30 };
31 
32 #endif // VIEW_PROMT_H
View
Definition: view.h:17
ViewPromt
Definition: view_promt.h:8