On 15.09.2010, at 21:07, Andreas Ekstrand wrote: > Hi Albrecht and Ian, > > I have tried one implementation that actually works fine here, let's see what > you think about it. > > In Fl_Menu_Item.H, I changed the find_shortcut declaration to: > const Fl_Menu_Item* find_shortcut(int *ip=0, const bool&require_alt = false) > const; > > In Fl_Widget.H, I changed the test_shortcut declaration to: > static int test_shortcut(const char*, const bool&require_alt = false); > > In FL_Menu.cxx, I propagate the require_alt parameter in > Fl_Menu_Item::find_shortcut to Fl_Widget::test_shortcut. > > In Fl_Menu_Bar.cxx, I send (0, true) as parameters to find_shortcut. > > In fl_shortcut.cxx, I only check the FL_ALT state if require_alt is true > (still only for WIN32). > > I hope this was clear, let me know if you need the actual code files for > testing. It does it for me - what do you think? Since I only set require_alt > to true from Fl_Menu_Bar I think it should only be valid for top-level menus > as expected. One uncertainty may be changing the API for > Fl_Menu_Item::find_shortcut, but the argument is optional so maybe it's okay?
Thanks for the tests and the patch description. A diff file would have been easier to implement ;-) , but I hope I got it... I converted your description to a patch file [1] and posted it to STR #2243 - please see more comments in the STR and/or in fltk.bugs, resp. Albrecht [1] http://www.fltk.org/strfiles/2243/str_2243_v1.patch _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
