diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2003-03-26 01:16:41 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2003-03-26 01:16:41 +0000 |
| commit | 216453a981b2012a7517597efa1a5ffd8f780645 (patch) | |
| tree | ac0d2b48a7db8dd7f73130c16b2f8596752bd054 | |
| parent | 52f7cb86a0aea36cac1e63f2681bed6d8c8d1a52 (diff) | |
Fix widget callback code error check and assignment.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2953 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | CHANGES | 4 | ||||
| -rw-r--r-- | fluid/Fl_Widget_Type.cxx | 10 | ||||
| -rw-r--r-- | fluid/widget_panel.cxx | 6 | ||||
| -rw-r--r-- | fluid/widget_panel.fl | 13 | ||||
| -rw-r--r-- | fluid/widget_panel.h | 2 |
5 files changed, 21 insertions, 14 deletions
@@ -1,5 +1,9 @@ CHANGES IN FLTK 1.1.4 + - FLUID could crash after displaying a syntax error + dialog for the callback code. + - FLUID would reset the callback code if you opened the + widget panel for multiple widgets. - Added a NULL check to Fl_Text_Display (SF Bug #706921). - The fltk-config script placed the LDFLAGS at the wrong place in the linker options. diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 88a530fa3..75f49e3e3 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.22 2002/11/05 06:45:40 matthiaswm Exp $" +// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.23 2003/03/26 01:16:36 easysw Exp $" // // Widget type code for the Fast Light Tool Kit (FLTK). // @@ -948,7 +948,11 @@ void callback_cb(Fl_Text_Editor* i, void *v) { } else { char *c = i->buffer()->text(); const char *d = c_check(c); - if (d) {fl_message("Error in callback: %s",d); haderror = 1; return;} + if (d) { + fl_message("Error in callback: %s",d); + if (i->window()) i->window()->make_current(); + haderror = 1; + } for (Fl_Type *o = Fl_Type::first; o; o = o->next) if (o->selected) { o->callback(c); } @@ -1972,5 +1976,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.22 2002/11/05 06:45:40 matthiaswm Exp $". +// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.23 2003/03/26 01:16:36 easysw Exp $". // diff --git a/fluid/widget_panel.cxx b/fluid/widget_panel.cxx index 1147c3907..3b9bdee04 100644 --- a/fluid/widget_panel.cxx +++ b/fluid/widget_panel.cxx @@ -1,4 +1,4 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0103 +// generated by Fast Light User Interface Designer (fluid) version 1.0104 #include "widget_panel.h" @@ -19,6 +19,7 @@ Fl_Double_Window* make_widget_panel() { { Fl_Group* o = new Fl_Group(10, 30, 395, 295, "GUI"); o->callback((Fl_Callback*)propagate_load); o->when(FL_WHEN_NEVER); + o->hide(); { Fl_Group* o = new Fl_Group(95, 40, 301, 280); o->callback((Fl_Callback*)propagate_load); { Fl_Group* o = new Fl_Group(95, 40, 300, 20); @@ -383,7 +384,6 @@ Fl_Double_Window* make_widget_panel() { { Fl_Group* o = new Fl_Group(10, 30, 395, 295, "C++"); o->callback((Fl_Callback*)propagate_load); o->when(FL_WHEN_NEVER); - o->hide(); { Fl_Group* o = new Fl_Group(100, 40, 295, 132); o->callback((Fl_Callback*)propagate_load); { Fl_Group* o = new Fl_Group(100, 40, 295, 20); @@ -449,10 +449,10 @@ Fl_Double_Window* make_widget_panel() { o->textfont(4); o->callback((Fl_Callback*)callback_cb); o->align(FL_ALIGN_LEFT); + o->when(FL_WHEN_CHANGED); Fl_Group::current()->resizable(o); o->buffer(new Fl_Text_Buffer()); o->textfont(FL_COURIER); - o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE); } o->end(); Fl_Group::current()->resizable(o); diff --git a/fluid/widget_panel.fl b/fluid/widget_panel.fl index 8c0fa5b2a..1c47d05a9 100644 --- a/fluid/widget_panel.fl +++ b/fluid/widget_panel.fl @@ -1,5 +1,5 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0103 +version 1.0104 header_name {.h} code_name {.cxx} Function {make_widget_panel()} {open @@ -13,8 +13,8 @@ Function {make_widget_panel()} {open } { Fl_Group {} { label GUI - callback propagate_load open selected - xywh {10 30 395 295} when 0 resizable + callback propagate_load open + xywh {10 30 395 295} when 0 hide resizable } { Fl_Group {} { callback propagate_load open @@ -349,7 +349,7 @@ image} Fl_Group {} { label {C++} callback propagate_load - xywh {10 30 395 295} when 0 hide + xywh {10 30 395 295} when 0 } { Fl_Group {} { callback propagate_load open @@ -413,11 +413,10 @@ image} } { Fl_Text_Editor {} { label {Callback:} - callback callback_cb - tooltip {The callback function or code for the widget.} xywh {102 177 291 86} box NO_BOX align 4 textfont 4 resizable + callback callback_cb selected + tooltip {The callback function or code for the widget.} xywh {102 177 291 86} box NO_BOX align 4 when 1 textfont 4 resizable code0 {o->buffer(new Fl_Text_Buffer());} code1 {o->textfont(FL_COURIER);} - code2 {o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE);} } } Fl_Group {} { diff --git a/fluid/widget_panel.h b/fluid/widget_panel.h index 0ba760eed..cda30f37c 100644 --- a/fluid/widget_panel.h +++ b/fluid/widget_panel.h @@ -1,4 +1,4 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0103 +// generated by Fast Light User Interface Designer (fluid) version 1.0104 #ifndef widget_panel_h #define widget_panel_h |
