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

@ -2,6 +2,7 @@
ViewInfo::ViewInfo()
{
calls.push_back(nullptr);
}
void ViewInfo::setText(std::string text)
@ -14,6 +15,11 @@ void ViewInfo::setLabelClose(std::string label)
this->label_close = label;
}
void ViewInfo::setCall(std::function<void(int)> call)
{
calls[0] = call;
}
void ViewInfo::draw()
{
int li = 0;
@ -30,7 +36,6 @@ void ViewInfo::draw()
std::function<void(int)> ViewInfo::keypress(int& key)
{
std::function<void(int)> ret = nullptr;
switch(key)
{
@ -53,5 +58,5 @@ std::function<void(int)> ViewInfo::keypress(int& key)
default:
break;
}
return ret;
return calls[0];
}