@@ -34,6 +34,22 @@ void set_focus(FormInput *focus) {
3434 }
3535}
3636
37+ struct FormTextInput : public TextEditInput {
38+ FormTextInput (const char *text, int chW, int chH, int x, int y, int w, int h):
39+ TextEditInput (text, chW, chH, x, y, w, h) {
40+ }
41+
42+ void clicked (int x, int y, bool pressed) {
43+ TextEditInput::clicked (x, y, pressed);
44+ if (pressed && g_system->isRunning ()) {
45+ set_focus (this );
46+ updateForm (form);
47+ mode = m_selected;
48+ g_system->getOutput ()->setDirty ();
49+ }
50+ }
51+ };
52+
3753// returns setBG when the program colours are default
3854int FormInput::getBackground (int buttonColor) const {
3955 int result = _bg;
@@ -241,7 +257,7 @@ FormInput *create_input(var_p_t v_field) {
241257 text = value->v .p .ptr ;
242258 }
243259 if (h * 2 >= charHeight) {
244- widget = new TextEditInput (text, charWidth, charHeight, x, y, w, h);
260+ widget = new FormTextInput (text, charWidth, charHeight, x, y, w, h);
245261 } else {
246262 widget = new FormLineInput (text, maxSize, false , x, y, w, h);
247263 }
0 commit comments