summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>1999-01-24 15:27:35 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>1999-01-24 15:27:35 +0000
commitec2a5e3a1908f42e41a3bdafd3eb77f1f5f51370 (patch)
tree8220457d90198e4867110940ebc2afdc1f8d4449
parentdc70b69502de6769c8fe109161f984494a0c00b8 (diff)
Patch from Bill to allow users to click outside a menu to hide it without
making a selection. git-svn-id: file:///fltk/svn/fltk/trunk@238 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/Fl_Menu.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 0f874a0db..b96cd57a7 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Menu.cxx,v 1.13 1999/01/19 19:12:51 mike Exp $"
+// "$Id: Fl_Menu.cxx,v 1.14 1999/01/24 15:27:35 mike Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
@@ -362,10 +362,9 @@ int menuwindow::find_selected(int mx, int my) {
}
return i;
}
- if (mx < 0 || mx >= w()) return -1;
+ if (mx < Fl::box_dx(box()) || mx >= w()) return -1;
int i = (my-Fl::box_dx(box())-1)/itemheight;
- if (i>=numitems) i = numitems-1;
- else if (i < 0) i = 0;
+ if (i < 0 || i>=numitems) return -1;
return i;
}
@@ -709,5 +708,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}
//
-// End of "$Id: Fl_Menu.cxx,v 1.13 1999/01/19 19:12:51 mike Exp $".
+// End of "$Id: Fl_Menu.cxx,v 1.14 1999/01/24 15:27:35 mike Exp $".
//