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