diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2002-11-03 00:01:21 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2002-11-03 00:01:21 +0000 |
| commit | c3de2a22c058b26700cce7ebeb26ca20072dc50f (patch) | |
| tree | bcbd8e2be5c70d29fbd1d65028a3abac64c77310 /fluid/Fl_Widget_Type.cxx | |
| parent | f3078e51e015215432c375ccd24a2d3c93342c52 (diff) | |
Replaced 'callback' and 'code' input in FLUID with Fl_Text_Editor.
Made widget pannel resize only text fields (which I see as the
logical way to do it. Opinions welcome).
Matthias
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2822 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Widget_Type.cxx')
| -rw-r--r-- | fluid/Fl_Widget_Type.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 971a76187..f0820ae10 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.20 2002/11/01 14:17:36 easysw Exp $" +// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.21 2002/11/03 00:01:19 matthiaswm Exp $" // // Widget type code for the Fast Light Tool Kit (FLTK). // @@ -251,6 +251,8 @@ Fl_Type *sort(Fl_Type *parent) { #include "widget_panel.h" #include <FL/fl_show_colormap.H> +static Fl_Window *the_panel; + // All the callbacks use the argument to indicate whether to load or store. // This avoids the need for pointers to all the widgets, and keeps the // code localized in the callbacks. @@ -267,12 +269,12 @@ void name_cb(Fl_Input* o, void *v) { if (numselected != 1) { static char buf[16]; sprintf(buf,"(%d widgets)",numselected); - ((Fl_Window*)(o->parent()->parent()->parent()))->label(buf); + the_panel->label(buf); o->hide(); } else { o->static_value(current_widget->name()); o->show(); - ((Fl_Window*)(o->parent()->parent()->parent()))->label(current_widget->title()); + the_panel->label(current_widget->title()); } } else { if (numselected == 1) { @@ -939,11 +941,12 @@ void align_cb(Fl_Button* i, void *v) { //////////////////////////////////////////////////////////////// -void callback_cb(Fl_Input* i, void *v) { +void callback_cb(Fl_Text_Editor* i, void *v) { if (v == LOAD) { - i->static_value(current_widget->callback()); + const char *cbtext = current_widget->callback(); + i->buffer()->text( cbtext ? cbtext : "" ); } else { - const char *c = i->value(); + const char *c = i->buffer()->text(); const char *d = c_check(c); if (d) {fl_message("Error in callback: %s",d); haderror = 1; return;} for (Fl_Type *o = Fl_Type::first; o; o = o->next) if (o->selected) { @@ -1216,8 +1219,6 @@ void subtype_cb(Fl_Choice* i, void* v) { //////////////////////////////////////////////////////////////// -static Fl_Window *the_panel; - void propagate_load(Fl_Group* g, void* v) { if (v == LOAD) { Fl_Widget*const* a = g->array(); @@ -1970,5 +1971,5 @@ int Fl_Widget_Type::read_fdesign(const char* propname, const char* value) { } // -// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.20 2002/11/01 14:17:36 easysw Exp $". +// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.21 2002/11/03 00:01:19 matthiaswm Exp $". // |
