2 #include <msp/gl/texture.h>
3 #include <msp/gltk/button.h>
4 #include <msp/gltk/mixedrows.h>
5 #include <msp/input/keys.h>
12 InputDialog::InputDialog(Designer &d, const string &title, const string &text):
15 GLtk::MixedRows *rows = new GLtk::MixedRows;
19 add(*(lbl=new GLtk::Label(title)));
20 layout->set_expand(*lbl, true, false);
21 lbl->set_style("title");
24 add(*(entry=new GLtk::Entry(text)));
25 entry->set_edit_size(60, 1);
30 rows->split_columns();
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");
40 void InputDialog::key_press(unsigned key, unsigned mod)
42 if(key==Msp::Input::KEY_ENTER)
44 else if(key==Msp::Input::KEY_ESC)
47 Dialog::key_press(key, mod);
50 void InputDialog::on_response(int code)
53 signal_accept.emit(entry->get_text());