summaryrefslogtreecommitdiff
path: root/fluid/Fl_Menu_Type.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-07-23 22:56:27 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-07-23 22:56:27 +0000
commit9688b0b1c3f34bf44399ee120ab5c3f0c826d7df (patch)
treeca31e52a8543ab6e29a6d50cfcb0441f8ffe794d /fluid/Fl_Menu_Type.cxx
parente9f7f4ce4999d6a48bb89aae3b9f9b01668f99d3 (diff)
Fluid was casting Fl_Input_Choice to Fl_Menu_ at two occasions which is wrong since Input_Choice is derived from Fl_Group. Fixed.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4451 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Menu_Type.cxx')
-rw-r--r--fluid/Fl_Menu_Type.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx
index 7cb6f7724..72b5005eb 100644
--- a/fluid/Fl_Menu_Type.cxx
+++ b/fluid/Fl_Menu_Type.cxx
@@ -492,6 +492,24 @@ void Fl_Input_Choice_Type::copy_properties() {
d->textsize(s->textsize());
}
+Fl_Type* Fl_Input_Choice_Type::click_test(int, int) {
+ if (selected) return 0; // let user move the widget
+ Fl_Menu_* w = ((Fl_Input_Choice*)o)->menubutton();
+ if (!menusize) return 0;
+ const Fl_Menu_Item* save = w->mvalue();
+ w->value((Fl_Menu_Item*)0);
+ Fl::pushed(w);
+ w->handle(FL_PUSH);
+ const Fl_Menu_Item* m = w->mvalue();
+ if (m) {
+ // restore the settings of toggles & radio items:
+ if (m->flags & (FL_MENU_RADIO | FL_MENU_TOGGLE)) build_menu();
+ return (Fl_Type*)(m->user_data());
+ }
+ w->value(save);
+ return this;
+}
+
////////////////////////////////////////////////////////////////
Fl_Menu_Bar_Type Fl_Menu_Bar_type;