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
This commit is contained in:
parent
e9f7f4ce49
commit
9688b0b1c3
1
CHANGES
1
CHANGES
@ -2,6 +2,7 @@ CHANGES IN FLTK 1.1.7
|
||||
|
||||
- Documentation fixes (STR #648, STR #692, STR #730, STR
|
||||
#744, STR #745, STR #942)
|
||||
- Fixed integration of Fl_Input_Choice into Fluid (STR #879)
|
||||
- New windows touching the right screen border would be
|
||||
positioned all the way to the left (STR #898)
|
||||
- Made pie drawing size for WIN32 and OS X the same as X11 (STR #905)
|
||||
|
@ -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;
|
||||
|
@ -643,10 +643,10 @@ public:
|
||||
#include <FL/Fl_Input_Choice.H>
|
||||
class Fl_Input_Choice_Type : public Fl_Menu_Type {
|
||||
int textstuff(int w, Fl_Font& f, int& s, Fl_Color& c) {
|
||||
Fl_Menu_ *myo = (Fl_Menu_*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
|
||||
Fl_Input_Choice *myo = (Fl_Input_Choice*)(w==4 ? ((Fl_Widget_Type*)this->factory)->o : this->o);
|
||||
switch (w) {
|
||||
case 4:
|
||||
case 0: f = myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break;
|
||||
case 0: f = (Fl_Font)myo->textfont(); s = myo->textsize(); c = myo->textcolor(); break;
|
||||
case 1: myo->textfont(f); break;
|
||||
case 2: myo->textsize(s); break;
|
||||
case 3: myo->textcolor(c); break;
|
||||
@ -665,6 +665,7 @@ public:
|
||||
if (w < (15 + h)) w = 15 + h;
|
||||
}
|
||||
virtual const char *type_name() {return "Fl_Input_Choice";}
|
||||
virtual Fl_Type* click_test(int,int);
|
||||
Fl_Widget *widget(int X,int Y,int W,int H) {
|
||||
Fl_Input_Choice *myo = new Fl_Input_Choice(X,Y,W,H,"input choice:");
|
||||
myo->menu(dummymenu);
|
||||
|
Loading…
Reference in New Issue
Block a user