From b2290975d4c70e66f58fdc462d0869e9e55cd317 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 19 Jan 1999 19:05:39 +0000 Subject: [PATCH] Fix from Bill - global shortcuts now work for the menubar as well. git-svn-id: file:///fltk/svn/fltk/trunk@231 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Menu_Bar.cxx | 7 +++---- src/Fl_Menu_global.cxx | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Fl_Menu_Bar.cxx b/src/Fl_Menu_Bar.cxx index b01e8cabb..514b2ef29 100644 --- a/src/Fl_Menu_Bar.cxx +++ b/src/Fl_Menu_Bar.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_Bar.cxx,v 1.6 1999/01/13 15:45:49 mike Exp $" +// "$Id: Fl_Menu_Bar.cxx,v 1.7 1999/01/19 19:05:39 mike Exp $" // // Menu bar widget for the Fast Light Tool Kit (FLTK). // @@ -52,13 +52,12 @@ int Fl_Menu_Bar::handle(int event) { case FL_SHORTCUT: v = menu()->test_shortcut(); if (v) {picked(v); return 1;} - v = menu()->find_shortcut(); - if (v) goto J1; + if (visible_r() && (v = menu()->find_shortcut())) goto J1; return 0; } return 0; } // -// End of "$Id: Fl_Menu_Bar.cxx,v 1.6 1999/01/13 15:45:49 mike Exp $". +// End of "$Id: Fl_Menu_Bar.cxx,v 1.7 1999/01/19 19:05:39 mike Exp $". // diff --git a/src/Fl_Menu_global.cxx b/src/Fl_Menu_global.cxx index 0558669bc..e6410ecf5 100644 --- a/src/Fl_Menu_global.cxx +++ b/src/Fl_Menu_global.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_global.cxx,v 1.4 1999/01/07 19:17:23 mike Exp $" +// "$Id: Fl_Menu_global.cxx,v 1.5 1999/01/19 19:05:39 mike Exp $" // // Global menu shortcut code for the Fast Light Tool Kit (FLTK). // @@ -34,7 +34,7 @@ static Fl_Menu_* the_widget; static int handler(int e) { if (e != FL_SHORTCUT || Fl::modal()) return 0; - return the_widget->test_shortcut() != 0; + return the_widget->handle(e); } void Fl_Menu_::global() { @@ -43,5 +43,5 @@ void Fl_Menu_::global() { } // -// End of "$Id: Fl_Menu_global.cxx,v 1.4 1999/01/07 19:17:23 mike Exp $". +// End of "$Id: Fl_Menu_global.cxx,v 1.5 1999/01/19 19:05:39 mike Exp $". //