From ba1d83cf47b115df9121b5427f2472287fe1c511 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Tue, 11 Jul 2000 05:36:39 +0000 Subject: [PATCH] Shortcuts for submenu titles in a menubar pop up the submenu (rather than calling the callback) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1250 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Menu_Bar.cxx | 6 +++--- test/menubar.cxx | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Fl_Menu_Bar.cxx b/src/Fl_Menu_Bar.cxx index b412f99d9..82d2efb89 100644 --- a/src/Fl_Menu_Bar.cxx +++ b/src/Fl_Menu_Bar.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_Bar.cxx,v 1.7.2.2 2000/06/05 21:20:54 mike Exp $" +// "$Id: Fl_Menu_Bar.cxx,v 1.7.2.3 2000/07/11 05:36:39 spitzak Exp $" // // Menu bar widget for the Fast Light Tool Kit (FLTK). // @@ -50,14 +50,14 @@ int Fl_Menu_Bar::handle(int event) { picked(v); return 1; case FL_SHORTCUT: + if (visible_r()) {if ((v = menu()->find_shortcut())) goto J1;} v = menu()->test_shortcut(); if (v) {picked(v); return 1;} - if (visible_r() && (v = menu()->find_shortcut())) goto J1; return 0; } return 0; } // -// End of "$Id: Fl_Menu_Bar.cxx,v 1.7.2.2 2000/06/05 21:20:54 mike Exp $". +// End of "$Id: Fl_Menu_Bar.cxx,v 1.7.2.3 2000/07/11 05:36:39 spitzak Exp $". // diff --git a/test/menubar.cxx b/test/menubar.cxx index 50cfea9d1..deca25ea5 100644 --- a/test/menubar.cxx +++ b/test/menubar.cxx @@ -1,5 +1,5 @@ // -// "$Id: menubar.cxx,v 1.6.2.5 2000/06/05 21:21:22 mike Exp $" +// "$Id: menubar.cxx,v 1.6.2.6 2000/07/11 05:36:39 spitzak Exp $" // // Menubar test program for the Fast Light Tool Kit (FLTK). // @@ -85,7 +85,7 @@ Fl_Menu_Item menutable[] = { {"after submenu"}, {0}, {0}, - {"&Edit",0,0,0,FL_SUBMENU}, + {"&Edit",FL_F+2,0,0,FL_SUBMENU}, {"Undo", FL_ALT+'z', 0}, {"Redo", FL_ALT+'r', 0, 0, FL_MENU_DIVIDER}, {"Cut", FL_ALT+'x', 0}, @@ -97,7 +97,7 @@ Fl_Menu_Item menutable[] = { {"Preferences",0, 0}, {"Size", 0, 0}, {0}, - {"&Checkbox",0,0,0,FL_SUBMENU}, + {"&Checkbox",FL_F+3,0,0,FL_SUBMENU}, {"&Alpha", FL_F+2, 0, (void *)1, FL_MENU_TOGGLE}, {"&Beta", 0, 0, (void *)2, FL_MENU_TOGGLE}, {"&Gamma", 0, 0, (void *)3, FL_MENU_TOGGLE}, @@ -216,5 +216,5 @@ int main(int argc, char **argv) { } // -// End of "$Id: menubar.cxx,v 1.6.2.5 2000/06/05 21:21:22 mike Exp $". +// End of "$Id: menubar.cxx,v 1.6.2.6 2000/07/11 05:36:39 spitzak Exp $". //