basic choices view
This commit is contained in:
parent
9f4aebef64
commit
d508c308b5
10 changed files with 69 additions and 53 deletions
24
driver/ui/view_selection.h
Normal file
24
driver/ui/view_selection.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
#ifndef VIEW_SELECTION_H
|
||||
#define VIEW_SELECTION_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "view.h"
|
||||
|
||||
class ViewSelection : public View
|
||||
{
|
||||
public:
|
||||
virtual void draw(void) override;
|
||||
virtual void addChoice(std::string name, std::function<void(int)> call);
|
||||
virtual std::function<void(int)> keypress(int& key) override;
|
||||
|
||||
|
||||
protected:
|
||||
size_t selection = 0;
|
||||
std::vector<std::string> choices;
|
||||
|
||||
constexpr static int choice_offset_x = 2;
|
||||
constexpr static int choice_offset_y = 3;
|
||||
};
|
||||
|
||||
#endif // VIEW_SELECTION_H
|
Loading…
Add table
Add a link
Reference in a new issue