Re: [fltk.bugs] [LOW] STR #2591: Keyboard navigation appears to be backwards in mutli-button message boxes

2011-03-17 Thread Albrecht Schlosser
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current


A patch ought to be as simple as adding the buttons in the reverse order,
see attached file button_order.diff.

Please test. If there are no side effects, something like this should do
it.


Link: http://www.fltk.org/str.php?L2591
Version: 1.3-currentIndex: src/fl_ask.cxx
===
--- src/fl_ask.cxx  (Revision 8515)
+++ src/fl_ask.cxx  (Arbeitskopie)
@@ -99,6 +99,7 @@
   o-color(FL_WHITE);
   o-labelcolor(FL_BLUE);
  }
+ w-end(); // don't add the buttons automatically
  // create the buttons (right to left)
  for (int b=0, x=310; b3; b++, x -= 100) {
if (b==1)
@@ -109,6 +110,10 @@
button[b]-callback(button_cb,(void *)b);
  }
  button[0]-shortcut(FL_Escape);
+ // add the buttons (left to right)
+ for (int b=2; b=0; b--)
+   w-add(button[b]);
+ w-begin();
  w-resizable(new Fl_Box(60,10,110-60,27));
  w-end();
  w-set_modal();
___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [LOW] STR #2591: Keyboard navigation appears to be backwards in mutli-button message boxes

2011-03-17 Thread Albrecht Schlosser

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current


Well, my proposed patch seems to change the default focus of fl_input() and
fl_password(), so that the text input doesn't get the focus. I can't see
why that happens right now, but this needs to be checked.

Functions with buttons only seem to work as before WRT default focus,
AFAICS.


Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [LOW] STR #2591: Keyboard navigation appears to be backwards in mutli-button message boxes

2011-03-17 Thread Albrecht Schlosser
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current


Attached file button_order_2.patch fixes the focus issue, but I don't know
*why* it didn't work with the previous patch (it should, IMHO).

Obviously take_focus() only works as expected after the message window has
been show()n, when the patch is applied, but this doesn't make any sense
for me. Strange...

Anyway, I don't have more time to test now, please test and look for other
possible side effects.


Link: http://www.fltk.org/str.php?L2591
Version: 1.3-currentIndex: src/fl_ask.cxx
===
--- src/fl_ask.cxx  (Revision 8515)
+++ src/fl_ask.cxx  (Arbeitskopie)
@@ -99,6 +99,7 @@
   o-color(FL_WHITE);
   o-labelcolor(FL_BLUE);
  }
+ w-end(); // don't add the buttons automatically
  // create the buttons (right to left)
  for (int b=0, x=310; b3; b++, x -= 100) {
if (b==1)
@@ -109,6 +110,10 @@
button[b]-callback(button_cb,(void *)b);
  }
  button[0]-shortcut(FL_Escape);
+ // add the buttons (left to right)
+ for (int b=2; b=0; b--)
+   w-add(button[b]);
+ w-begin();
  w-resizable(new Fl_Box(60,10,110-60,27));
  w-end();
  w-set_modal();
@@ -228,8 +233,6 @@
 
   resizeform();
 
-  if (button[1]-visible()  !input-visible())
-button[1]-take_focus();
   if (enableHotspot)
 message_form-hotspot(button[0]);
   if (b0  Fl_Widget::label_shortcut(b0))
@@ -245,6 +248,12 @@
   Fl_Window* g = Fl::grab();
   if (g) Fl::grab(0);
   message_form-show();
+
+  if (input-visible())
+input-take_focus();
+  else if (button[1]-visible())
+button[1]-take_focus();
+
   while (message_form-shown()) Fl::wait();
   if (g) // regrab the previous popup menu, if there was one
 Fl::grab(g);
___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


[fltk.bugs] [LOW] STR #2591: Keyboard navigation appears to be backwards in mutli-button message boxes

2011-03-16 Thread Ian MacArthur

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current


Whilst playing with the popups demo from the test folder, I notice that, on
popups that have multiple buttons, navigation using the keyboard cursor
keys or tab keys appears to iterate through the buttons in the opposite
direction to what one might expect from the button being pressed (i.e.
pressing the right-arrow on the keypad moves the focus to the button on
the left...)

Probably not a new bug - it transpires that fltk-1.1 also does this, and
fltk-2, though it is annoying now I hve noticed it!


Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [LOW] STR #2591: Keyboard navigation appears to be backwards in mutli-button message boxes

2011-03-16 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current


Which demo program is this? I can't find a popups demo..

Oh, I see, the 'demo' program calls it 'popups', but it's
the demo program called 'message' which basically pops up dialogs.

And yes, looks like the dialog that has three buttons
(choice2, choice1, choice0), the left/right arrow nav is backwards.
Might have to do with the creation order of the buttons in the dialog
causing that.

Not taking this str, just adding more info..


Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [LOW] STR #2591: Keyboard navigation appears to be backwards in mutli-button message boxes

2011-03-16 Thread Ben Stott

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current


Yeah, this was fixed in the latest revision of 2.0.
It's caused by the message box buttons being drawn from right-to-left.
Somewhere in the code in src/message.cxx (or the 1.3 equivalent) was this
line:
bx -= bw + BORDER_W.
Essentially, that moved the next button to the *left* of where the current
button was drawn - but FLTK thinks the child should be to the right.
If there's been no fix by the time I get back home tonight, I'll see if I
can contribute the 1.3 patch (or a starting point, anyway).


Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs