- glTranslatef(designer.get_font().get_string_width(text.substr(0, pos)), 0, 0);
- glDisable(GL_TEXTURE_2D);
- glBegin(GL_LINES);
- glVertex2f(0, 0);
- glVertex2f(0, 1);
- glEnd();
- glPopMatrix();
+ entry->set_focus();
+}
+
+void InputDialog::key_press(unsigned key, unsigned mod)
+{
+ if(key==Msp::Input::KEY_ENTER)
+ response(1);
+ else if(key==Msp::Input::KEY_ESC)
+ response(0);
+ else
+ Dialog::key_press(key, mod);
+}
+
+void InputDialog::on_response(int code)
+{
+ if(code)
+ signal_accept.emit(entry->get_text());