From 0884e2ba0de126599e212f8a98f06d3a1df7a609 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sat, 3 Nov 2001 19:24:22 +0000 Subject: Update all non-text widgets that take keyboard focus to check Fl::visible_focus() before taking or accepting focus; this allows one to disable the new 1.1 keyboard focus stuff completely (not much sense allowing focus if you can't see it...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1679 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Menu_Button.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Fl_Menu_Button.cxx') diff --git a/src/Fl_Menu_Button.cxx b/src/Fl_Menu_Button.cxx index 4abb2fe08..1d39416d2 100644 --- a/src/Fl_Menu_Button.cxx +++ b/src/Fl_Menu_Button.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_Button.cxx,v 1.4.2.3.2.1 2001/08/04 20:17:10 easysw Exp $" +// "$Id: Fl_Menu_Button.cxx,v 1.4.2.3.2.2 2001/11/03 19:24:22 easysw Exp $" // // Menu button widget for the Fast Light Tool Kit (FLTK). // @@ -65,7 +65,7 @@ int Fl_Menu_Button::handle(int e) { } else if (type()) { if (!(type() & (1 << (Fl::event_button()-1)))) return 0; } - take_focus(); + if (Fl::visible_focus()) take_focus(); popup(); return 1; case FL_KEYBOARD: @@ -78,7 +78,7 @@ int Fl_Menu_Button::handle(int e) { return test_shortcut() != 0; case FL_FOCUS: case FL_UNFOCUS: - if (box()) { + if (box() && Fl::visible_focus()) { redraw(); return 1; } @@ -93,5 +93,5 @@ Fl_Menu_Button::Fl_Menu_Button(int X,int Y,int W,int H,const char *l) } // -// End of "$Id: Fl_Menu_Button.cxx,v 1.4.2.3.2.1 2001/08/04 20:17:10 easysw Exp $". +// End of "$Id: Fl_Menu_Button.cxx,v 1.4.2.3.2.2 2001/11/03 19:24:22 easysw Exp $". // -- cgit v1.2.3