mirror of
https://github.com/fltk/fltk.git
synced 2026-06-07 00:55:23 +08:00
Added callbacks to Fl_Text_Editor.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2824 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.9 2002/11/03 00:01:19 matthiaswm Exp $"
|
||||
// "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.10 2002/11/05 06:45:40 matthiaswm Exp $"
|
||||
//
|
||||
// C function type code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <FL/fl_show_input.H>
|
||||
#include "../src/flstring.h"
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
|
||||
extern int i18n_type;
|
||||
extern const char* i18n_include;
|
||||
@@ -337,9 +338,10 @@ void Fl_Code_Type::open() {
|
||||
else if (w == code_panel_ok) break;
|
||||
else if (!w) Fl::wait();
|
||||
}
|
||||
const char*c = code_input->buffer()->text();
|
||||
char*c = code_input->buffer()->text();
|
||||
message = c_check(c); if (message) continue;
|
||||
name(c);
|
||||
free(c);
|
||||
break;
|
||||
}
|
||||
BREAK2:
|
||||
@@ -705,5 +707,5 @@ void Fl_Class_Type::write_code2() {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.9 2002/11/03 00:01:19 matthiaswm Exp $".
|
||||
// End of "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.10 2002/11/05 06:45:40 matthiaswm Exp $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.21 2002/11/03 00:01:19 matthiaswm Exp $"
|
||||
// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.22 2002/11/05 06:45:40 matthiaswm Exp $"
|
||||
//
|
||||
// Widget type code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -946,12 +946,13 @@ void callback_cb(Fl_Text_Editor* i, void *v) {
|
||||
const char *cbtext = current_widget->callback();
|
||||
i->buffer()->text( cbtext ? cbtext : "" );
|
||||
} else {
|
||||
const char *c = i->buffer()->text();
|
||||
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) {
|
||||
o->callback(c);
|
||||
}
|
||||
free(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1971,5 +1972,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.21 2002/11/03 00:01:19 matthiaswm Exp $".
|
||||
// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.22 2002/11/05 06:45:40 matthiaswm Exp $".
|
||||
//
|
||||
|
||||
@@ -54,7 +54,7 @@ Function {make_code_panel()} {open
|
||||
Fl_Group {} {open
|
||||
xywh {10 10 525 120} box DOWN_FRAME resizable
|
||||
} {
|
||||
Fl_Text_Editor code_input {selected
|
||||
Fl_Text_Editor code_input {
|
||||
xywh {12 12 521 116} box NO_BOX resizable
|
||||
code0 {o->buffer(new Fl_Text_Buffer);}
|
||||
code1 {o->textfont(FL_COURIER);}
|
||||
@@ -399,7 +399,7 @@ Function {make_widgetbin()} {open
|
||||
}
|
||||
Fl_Button {} {
|
||||
user_data {"Fl_Output"}
|
||||
callback type_make_cb
|
||||
callback type_make_cb selected
|
||||
tooltip Output xywh {284 4 24 24} box THIN_UP_BOX
|
||||
code0 {o->image(pixmap[27]);}
|
||||
}
|
||||
|
||||
@@ -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,6 +449,7 @@ Fl_Double_Window* make_widget_panel() {
|
||||
o->textfont(4);
|
||||
o->callback((Fl_Callback*)callback_cb);
|
||||
o->align(FL_ALIGN_LEFT);
|
||||
o->when(FL_WHEN_RELEASE_ALWAYS);
|
||||
Fl_Group::current()->resizable(o);
|
||||
o->buffer(new Fl_Text_Buffer());
|
||||
o->textfont(FL_COURIER);
|
||||
|
||||
@@ -13,8 +13,8 @@ Function {make_widget_panel()} {open
|
||||
} {
|
||||
Fl_Group {} {
|
||||
label GUI
|
||||
callback propagate_load selected
|
||||
xywh {10 30 395 295} when 0 resizable
|
||||
callback propagate_load
|
||||
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
|
||||
@@ -413,8 +413,8 @@ 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 6 textfont 4 resizable
|
||||
code0 {o->buffer(new Fl_Text_Buffer());}
|
||||
code1 {o->textfont(FL_COURIER);}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user