mirror of
https://github.com/fltk/fltk.git
synced 2026-06-06 08:32:07 +08:00
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
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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 $".
|
||||
//
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {} {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user