This commit is contained in:
Tristan Krause 2019-04-04 13:19:11 +02:00
parent 282a0dbc34
commit 793f8a8370
10 changed files with 320 additions and 102 deletions

33
driver/ui/view_info.cpp Normal file
View file

@ -0,0 +1,33 @@
#include "view_info.h"
ViewInfo::ViewInfo()
{
}
void ViewInfo::draw()
{
mvwprintw(win, text_offset_y, text_offset_x, "%s", "hello");
}
std::function<void(int)> ViewInfo::keypress(int& key)
{
std::function<void(int)> ret = nullptr;
switch(key)
{
case KEY_MOUSE:
{
// http://pronix.linuxdelta.de/C/Linuxprogrammierung/Linuxsystemprogrammieren_C_Kurs_Kapitel10b.shtml
MEVENT event;
if(getmouse(&event) == OK && event.bstate & BUTTON1_CLICKED)
key = -1; // do return from view
break;
}
case KEY_ENT:
key = -1; // do return from view
break;
default:
break;
}
return ret;
}