From 987d9e05f2c502138ecf648d76c02886f0534740 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 30 May 2006 09:38:19 +0000 Subject: Fixed shortcut and default focus for message dialogs (STR #1298). Default focus is now on the button that also reacts to the 'Enter' key. This should avoid confusion about Enter triggering the button1 or button 0. Also, I changed the shortcut call to the new convention which works on MSWindows. I don't have a Linux system right now for testing... . Fixed focus issues (STR #1286, STR #1289, STR #1296) fl_xfocus was not always updated, making widgets or even whole windows loose focus when any focus changes were not accompanied by a click into the same window. Also, Fl_Tabs would not redraw correctly if focus returned to the active tab. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5165 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/fl_ask.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/fl_ask.cxx') diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx index 454ecff77..6ab7e53d5 100644 --- a/src/fl_ask.cxx +++ b/src/fl_ask.cxx @@ -80,7 +80,7 @@ static Fl_Window *makeform() { o->labelcolor(FL_BLUE); } button[0] = new Fl_Button(310, 70, 90, 23); - button[0]->shortcut("^["); + button[0]->shortcut(FL_Escape); button[0]->align(FL_ALIGN_INSIDE|FL_ALIGN_WRAP); button[1] = new Fl_Return_Button(210, 70, 90, 23); button[1]->align(FL_ALIGN_INSIDE|FL_ALIGN_WRAP); @@ -198,6 +198,8 @@ static int innards(const char* fmt, va_list ap, resizeform(); + if (button[1]->visible() && !input->visible()) + button[1]->take_focus(); message_form->hotspot(button[0]); message_form->show(); int r; -- cgit v1.2.3