basic ui
This commit is contained in:
parent
282a0dbc34
commit
793f8a8370
10 changed files with 320 additions and 102 deletions
33
driver/ui/view_info.cpp
Normal file
33
driver/ui/view_info.cpp
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue