Author: spitzak
Date: 2007-06-17 12:04:31 -0400 (Sun, 17 Jun 2007)
New Revision: 5910
Log:
Suggested change for making the menu accelerators work.
Modified:
trunk/src/MenuBar.cxx
trunk/src/Menu_popup.cxx
Modified: trunk/src/MenuBar.cxx
===================================================================
--- trunk/src/MenuBar.cxx 2007-06-17 15:45:10 UTC (rev 5909)
+++ trunk/src/MenuBar.cxx 2007-06-17 16:04:31 UTC (rev 5910)
@@ -44,6 +44,7 @@
#include <config.h>
#include <fltk/Item.h> // for TOGGLE, RADIO
#define checkmark(item) (item->type()>=Item::TOGGLE &&
item->type()<=Item::RADIO)
+#include <stdio.h>
using namespace fltk;
@@ -103,7 +104,7 @@
for (i = 0; i < children; i++) {
Widget* w = child(i);
if (w->active() && w->test_label_shortcut()) {
- if (w->is_group()) {value(i); goto J1;} // menu title
+ if (w->is_group()) {value(i); printf("Picking %s\n", w->label());
goto J1;} // menu title
focus_index(Group::find(w)); // Set focus_index, so Menu::get_item()
works
if (checkmark(w)) { w->invert_flag(STATE); redraw(); }
execute(w); // button in the menu bar
Modified: trunk/src/Menu_popup.cxx
===================================================================
--- trunk/src/Menu_popup.cxx 2007-06-17 15:45:10 UTC (rev 5909)
+++ trunk/src/Menu_popup.cxx 2007-06-17 16:04:31 UTC (rev 5910)
@@ -911,10 +911,12 @@
p.menus[0] = &toplevel;
p.fakemenu = 0;
+ track_mouse = true; //event_state(ANY_BUTTON);
if (menubar) {
- if (value() < 0)
+ if (value() < 0) {
toplevel.handle(PUSH); // get menu mouse points at to appear
- else {
+ } else {
+ track_mouse = false;
p.indexes[0] = value();
p.indexes[1] = -1;
p.level = 0;
@@ -962,7 +964,6 @@
Widget* saved_modal = modal(); bool saved_grab = grab();
p.state = INITIAL_STATE;
- track_mouse = true; //event_state(ANY_BUTTON);
#ifdef DEBUG
#define MODAL false
#else
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit