MenuWindow::MenuWindow(int x, int y, int w, int h, LineStyle *linestyle) : Window(x, y, w, h, NULL) { const gchar *context = "menuwindow"; border = new Panel(*this, 0, 0, w, h, linestyle); listbox = new ListBox(*this, 1, 1, w-2, h-2); SetFocusChild(listbox); Window::AddWidget(border); Window::AddWidget(listbox); //ClearBindables(); //DeclareBindable(context, "focus-previous", sigc::mem_fun(listbox, &Container::FocusCyclePrevious), // _("Focusses the previous menu item"), InputProcessor::Bindable_Normal); //DeclareBindable(context, "focus-next", sigc::mem_fun(listbox, &Container::FocusCycleNext), // _("Focusses the next menu item"), InputProcessor::Bindable_Normal); DeclareBindable(context, "close-window", sigc::mem_fun(this, &Window::Close), _("Close the window"), InputProcessor::Bindable_Normal); //TODO get real binding from config //BindAction(context, "focus-previous", Keys::Instance()->Key_up(), false); //BindAction(context, "focus-next", Keys::Instance()->Key_down(), false); BindAction(context, "close-window", Keys::Instance()->Key_esc(), false); }
TestApp::TestApp() { mngr = CppConsUI::CoreManager::Instance(); KEYCONFIG->AddDefaultKeyBind("testapp", "quit", "F10"); KEYCONFIG->RegisterDefaultKeyBinds(); g_log_set_default_handler(g_log_func_, this); DeclareBindable("testapp", "quit", sigc::mem_fun(mngr, &CppConsUI::CoreManager::QuitMainLoop), InputProcessor::BINDABLE_OVERRIDE); }
void CoreManager::DeclareBindables() { DeclareBindable("coremanager", "redraw-screen", sigc::mem_fun(this, &CoreManager::RedrawScreen), InputProcessor::BINDABLE_OVERRIDE); }
void FreeWindow::DeclareBindables() { DeclareBindable("window", "close-window", sigc::mem_fun(this, &FreeWindow::ActionClose), InputProcessor::BINDABLE_NORMAL); }