DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR Pending]
Link: http://www.fltk.org/str.php?L2420
Version: 1.4-feature
Fix Version: 1.3.0
Greg, thanks for the demo program. What you describe is what I expected,
and I can't replicate the faulty behavior on Windows as well.
I tried even harder to give the focus to a *deactivated* button and then
try to move it by keyboard navigation, please see attached file
navigation.cxx:
I added a shortcut to toggle the [de-]activation (use ALT-A) to avoid
moving the focus to the "Activate" button, and I tried to give the focus
to the button B5 after activation and deactivation of the group in the
callback.
(1) none of the commented-out "take_focus()" statements works when
deactivating the button (that's expected and correct behavior)
(2) only *forcing* the focus to B5 with Fl::focus() works so far that
button B5 gets the focus, even while it is deactivated. There is nothing
we can do to prevent this, since this is exactly what it is intended to do
(when calling Fl::focus() explicitly).
(3) even if/when B5 has the focus in its deactivated state, moving the
focus to another deactivated button with TAB doesn't work (it moves to
another /active/ button).
The only difference I might have expected was that *maybe* keyboard
navigation to another deactivated button in case (3) above had been
possible, but even this is not the case.
Conclusion: As I said before, I still can't imagine how the described
faulty behavior could happen; hence I believe that there must be some
other problem in the OP's application.
To the OP: please post the requested example, otherwise we will have to
close this STR.
Link: http://www.fltk.org/str.php?L2420
Version: 1.4-feature
Fix Version: 1.3.0
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Light_Button.H>
void Activate_CB(Fl_Widget *w, void *data) {
Fl_Light_Button *tb = (Fl_Light_Button*)w;
Fl_Group *group = (Fl_Group*)data;
if ( tb->value() ) {
group->activate();
//group->child(1)->take_focus(); // *try* to give focus to B5
} else {
group->deactivate();
//group->child(1)->take_focus(); // *try* to give focus to B5
}
// group->child(1)->take_focus(); // *try* to give focus to B5
Fl::focus(group->child(1)); // *give* focus to B5
group->window()->redraw();
}
int main( int argc, char** argv) {
Fl_Window win(400,400);
win.begin();
Fl_Button b1(10,10+0,140,25,"B1");
Fl_Button b2(10,10+30,140,25,"B2");
Fl_Button b3(10,10+60,140,25,"B3");
Fl_Group g1(10,10+120,140+20,200,"Deactivated Group");
g1.box(FL_ENGRAVED_FRAME);
g1.begin();
Fl_Button b4(20,10+130+0,140,25,"B4");
Fl_Button b5(20,10+130+30,140,25,"B5");
Fl_Button b6(20,10+130+60,140,25,"B6");
g1.end();
g1.deactivate();
Fl_Light_Button activate_but(200,10+0,140,25,"&Activate");
activate_but.value(0);
activate_but.callback(Activate_CB, (void*)&g1);
win.end();
win.show(argc,argv);
return Fl::run();
}
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs