basic choices view

This commit is contained in:
Tristan Krause 2019-04-05 08:33:31 +02:00
parent 9f4aebef64
commit d508c308b5
10 changed files with 69 additions and 53 deletions

View 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