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

[STR New]

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





Link: http://www.fltk.org/str.php?L2243
Version: 1.3-current
Index: src/Fl_Menu_Bar.cxx
===================================================================
--- src/Fl_Menu_Bar.cxx (revision 7704)
+++ src/Fl_Menu_Bar.cxx (working copy)
@@ -65,7 +65,7 @@
     return 1;
   case FL_SHORTCUT:
     if (visible_r()) {
-      v = menu()->find_shortcut();
+      v = menu()->find_shortcut(0, true);
       if (v && v->submenu()) goto J1;
     }
     return test_shortcut() != 0;
Index: src/Fl_Menu.cxx
===================================================================
--- src/Fl_Menu.cxx     (revision 7704)
+++ src/Fl_Menu.cxx     (working copy)
@@ -988,12 +988,12 @@
   Search only the top level menu for a shortcut.  
   Either &x in the label or the shortcut fields are used. 
 */
-const Fl_Menu_Item* Fl_Menu_Item::find_shortcut(int* ip) const {
+const Fl_Menu_Item* Fl_Menu_Item::find_shortcut(int* ip, const bool 
&require_alt) const {
   const Fl_Menu_Item* m = first();
   if (m) for (int ii = 0; m->text; m = m->next(), ii++) {
     if (m->activevisible()) {
       if (Fl::test_shortcut(m->shortcut_)
-        || Fl_Widget::test_shortcut(m->text)) {
+        || Fl_Widget::test_shortcut(m->text, require_alt)) {
        if (ip) *ip=ii;
        return m;
       }
Index: src/fl_shortcut.cxx
===================================================================
--- src/fl_shortcut.cxx (revision 7704)
+++ src/fl_shortcut.cxx (working copy)
@@ -306,10 +306,10 @@
   }
 }
 
-int Fl_Widget::test_shortcut(const char *t) {
+int Fl_Widget::test_shortcut(const char *t, const bool &require_alt) {
   #ifdef WIN32
   // on MSWindows, users expect shortcuts to work only when the Alt modifier 
is pressed
-  if (Fl::event_state(FL_ALT)==0) return 0;
+  if (require_alt && Fl::event_state(FL_ALT)==0) return 0;
   #endif
   if (!t) return 0;
   unsigned int c = fl_utf8decode(Fl::event_text(), 
Fl::event_text()+Fl::event_length(), 0);
Index: FL/Fl_Menu_Item.H
===================================================================
--- FL/Fl_Menu_Item.H   (revision 7704)
+++ FL/Fl_Menu_Item.H   (working copy)
@@ -349,7 +349,7 @@
     const Fl_Menu_Item* title = 0,
     int menubar=0) const;
   const Fl_Menu_Item* test_shortcut() const;
-  const Fl_Menu_Item* find_shortcut(int *ip=0) const;
+  const Fl_Menu_Item* find_shortcut(int *ip=0, const bool &require_alt = 
false) const;
 
   /**
     Calls the Fl_Menu_Item item's callback, and provides the 
Index: FL/Fl_Widget.H
===================================================================
--- FL/Fl_Widget.H      (revision 7704)
+++ FL/Fl_Widget.H      (working copy)
@@ -848,7 +848,7 @@
   /** Internal use only. */
   static unsigned int label_shortcut(const char *t);
   /** Internal use only. */
-  static int test_shortcut(const char*);
+  static int test_shortcut(const char*, const bool &require_alt = false);
 
   /** Checks if w is a child of this widget.
       \param[in] w potential child widget
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to