2 #include <msp/gl/texture.h>
3 #include <msp/gltk/button.h>
4 #include <msp/gltk/column.h>
5 #include <msp/gltk/row.h>
6 #include <msp/input/keys.h>
13 InputDialog::InputDialog(Designer &d, const string &title, const string &text):
16 set_layout(new GLtk::Layout);
17 GLtk::Column col(*layout);
20 add(*(lbl=new GLtk::Label(title)));
21 lbl->set_style("title");
23 add(*(entry=new GLtk::Entry(text)));
24 entry->set_edit_size(60, 1);
29 GLtk::Row row(*layout);
31 add_button(*(btn=new GLtk::Button("Cncl")), 0);
32 btn->set_style("red");
34 add_button(*(btn=new GLtk::Button("OK")), 1);
35 btn->set_style("green");
41 void InputDialog::key_press(unsigned key, unsigned mod)
43 if(key==Msp::Input::KEY_ENTER)
45 else if(key==Msp::Input::KEY_ESC)
48 Dialog::key_press(key, mod);
51 void InputDialog::on_response(int code)
54 signal_accept.emit(entry->get_text());