summaryrefslogtreecommitdiff
path: root/fluid/Fl_Widget_Type.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-07-19 12:12:15 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-07-19 12:12:15 +0000
commitf64d694799dce27c44858d2b2c7d80b203d83ed3 (patch)
treee3402904af00009421f12cd222aaffea120e9057 /fluid/Fl_Widget_Type.cxx
parentd1808c6165626f5ee5c9664f0c61da57b5475307 (diff)
Better support for Live mode in Fluid. Most Widget attributes are now supported including pulldown menus (in a very simple, but working way).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4433 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Widget_Type.cxx')
-rw-r--r--fluid/Fl_Widget_Type.cxx45
1 files changed, 21 insertions, 24 deletions
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx
index 89034db48..43f371aa6 100644
--- a/fluid/Fl_Widget_Type.cxx
+++ b/fluid/Fl_Widget_Type.cxx
@@ -2315,25 +2315,12 @@ void Fl_Widget_Type::copy_properties() {
if (!live_widget)
return;
+ // copy all attributes common to all widget types
Fl_Widget *w = live_widget;
w->label(o->label());
w->tooltip(o->tooltip());
w->type(o->type());
w->box(o->box());
-/* move this into the derived _type classes
- if (is_button()) {
- Fl_Button* d = (Fl_Button*)live_widget, *s = (Fl_Button*)o;
- d->down_box(s->down_box());
- d->shortcut(s->shortcut());
- d->value(s->value());
- } else if (!strcmp(type_name(), "Fl_Input_Choice")) {
- Fl_Input_Choice* d = (Fl_Input_Choice*)live_widget, *s = (Fl_Input_Choice*)o;
- d->down_box(s->down_box());
- } else if (is_menu_button()) {
- Fl_Menu_* d = (Fl_Menu_*)live_widget, *s = (Fl_Menu_*)o;
- d->down_box(s->down_box());
- }
-*/
w->color(o->color());
w->selection_color(o->selection_color());
w->labeltype(o->labeltype());
@@ -2341,28 +2328,38 @@ void Fl_Widget_Type::copy_properties() {
w->labelsize(o->labelsize());
w->labelcolor(o->labelcolor());
w->align(o->align());
-/* move this into the derived _type classes
+
+ // copy all attributes specific to widgets derived from Fl_Button
+ if (is_button()) {
+ Fl_Button* d = (Fl_Button*)live_widget, *s = (Fl_Button*)o;
+ d->down_box(s->down_box());
+ d->shortcut(s->shortcut());
+ d->value(s->value());
+ }
+
+ // copy all attributes specific to Fl_Valuator and derived classes
if (is_valuator()) {
Fl_Valuator* d = (Fl_Valuator*)live_widget, *s = (Fl_Valuator*)o;
d->minimum(s->minimum());
d->maximum(s->maximum());
d->step(s->step());
d->value(s->value());
- //if (is_valuator()==2) {
- // double x = ((Fl_Slider*)v)->slider_size();
- // double y = ((Fl_Slider*)f)->slider_size();
- // if (x != y) write_string("slider_size %g", x);
- //}
- }
-*/
-/* move this into the derived _type classes
+ if (is_valuator()==2) {
+ Fl_Slider *d = (Fl_Slider*)live_widget, *s = (Fl_Slider*)o;
+ d->slider_size(s->slider_size());
+ }
+ }
+
+/* TODO: implement this
{Fl_Font ff; int fs; Fl_Color fc; if (textstuff(4,ff,fs,fc)) {
Fl_Font f; int s; Fl_Color c; textstuff(0,f,s,c);
if (f != ff) write_string("textfont %d", f);
if (s != fs) write_string("textsize %d", s);
if (c != fc) write_string("textcolor %d", c);
}}*/
- /// hmmm: if (!o->visible()) write_string("hide");
+
+ if (!o->visible())
+ w->hide();
if (!o->active())
w->deactivate();
if (resizable() && w->parent())