From e36d3a07ce69b648b9157cf97c2aafb8f67461a9 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 24 Jan 2007 20:32:54 +0000 Subject: - Fluid avoids writing unsopported combinations of the "when()" flags (STR #1501) - Fl_Browser_ would allow keyboard callbacks even though "when()" was set to "never" (STR #1501) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5639 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/Fl_Widget_Type.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'fluid') diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 910f332d7..d7851f9c5 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -2223,9 +2223,15 @@ void Fl_Widget_Type::write_widget_code() { if (i & FL_ALIGN_INSIDE) write_c("|FL_ALIGN_INSIDE"); write_c(");\n"); } - if (o->when() != tplate->when() || subclass()) + // avoid the unsupported combination of flegs when user sets + // "when" to "FL_WHEN_NEVER", but keeps the "no change" set. + // FIXME: This could be reflected in the GUI by graying out the button. + Fl_When ww = o->when(); + if (ww==FL_WHEN_NOT_CHANGED) + ww = FL_WHEN_NEVER; + if (ww != tplate->when() || subclass()) write_c("%s%s->when(%s);\n", indent(), var, - item_name(whensymbolmenu, o->when())); + item_name(whensymbolmenu, ww)); if (!o->visible() && o->parent()) write_c("%s%s->hide();\n", indent(), var); if (!o->active()) -- cgit v1.2.3