diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-10-19 21:00:26 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-10-19 21:00:26 +0000 |
| commit | 90e8eb7a4501562728d016eddc31225e7a4bd7fc (patch) | |
| tree | c63dc0778f8c6385cf230aa66978a116426e0d9d /fluid | |
| parent | 1a86a0ede02de76c617165fb3555c192f0b74347 (diff) | |
More changes from Bill Spitzak.
git-svn-id: file:///fltk/svn/fltk/trunk@20 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid')
| -rw-r--r-- | fluid/Fl_Function_Type.cxx | 12 | ||||
| -rw-r--r-- | fluid/Fl_Widget_Type.cxx | 3 | ||||
| -rw-r--r-- | fluid/Fl_Window_Type.cxx | 1 | ||||
| -rw-r--r-- | fluid/about_panel.cxx | 3 | ||||
| -rw-r--r-- | fluid/alignment_panel.cxx | 3 | ||||
| -rw-r--r-- | fluid/fluid.cxx | 1 | ||||
| -rw-r--r-- | fluid/widget_panel.cxx | 5 |
7 files changed, 10 insertions, 18 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index 32926e1ca..21bdb5b37 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -66,8 +66,6 @@ const char *c_check(const char *c, int type) { class Fl_Function_Type : public Fl_Type { const char* return_type; - const char* actual_return_type; - const char* star; char public_, constructor, havewidgets; public: Fl_Type *make(); @@ -168,21 +166,21 @@ void Fl_Function_Type::write_code1() { Fl_Type *child; const char* widget_type = 0; for (child = next; child && child->level > level; child = child->next) - if (child->is_widget() && child->level == level+1) { + if (child->is_widget()) { havewidgets = 1; widget_type = subclassname(child); + break; } write_c("\n"); if (ismain()) write_c("int main(int argc, char **argv) {\n"); else { const char* t = return_type; - star = ""; + const char* star = ""; if (!t) { if (havewidgets) {t = widget_type; star = "*";} else t = "void"; } - actual_return_type=t; const char* k = class_name(); if (k) { write_public(public_); @@ -202,7 +200,7 @@ void Fl_Function_Type::write_code1() { write_c("%s%s %s {\n", t, star, name()); } } - if (havewidgets) write_c(" Fl_Window* w;\n"); + if (havewidgets) write_c(" %s* w;\n", widget_type); indentation += 2; } @@ -211,7 +209,7 @@ void Fl_Function_Type::write_code2() { if (havewidgets) write_c(" w->show(argc, argv);\n"); write_c(" return Fl::run();\n"); } else if (havewidgets && !constructor) - write_c(" return (%s%s)w;\n", actual_return_type, star); + write_c(" return w;\n"); write_c("}\n"); indentation = 0; } diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index c979799ac..96c22acea 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1267,7 +1267,7 @@ void Fl_Widget_Type::write_code1() { if (varused) write_c("{ %s* o = ", t); if (name()) write_c("%s = ", name()); if (is_window()) { - write_c("new %s(%d, %d", t, o->w(), o->h()); + write_c("w = new %s(%d, %d", t, o->w(), o->h()); // prevent type() code from being emitted: ((Fl_Widget_Type*)factory)->o->type(o->type()); } else { @@ -1279,7 +1279,6 @@ void Fl_Widget_Type::write_code1() { } write_c(");\n"); indentation += 2; - if (is_window()) write_c("%sw = o;\n", indent()); if (varused) write_widget_code(); } diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index cc3f94942..714ec4b30 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -53,7 +53,6 @@ void header_input_cb(Fl_Input* i, void*) { } void code_input_cb(Fl_Input* i, void*) { code_file_name = i->value(); - printf("code file name set to %s\n", code_file_name); } void include_H_from_C_button_cb(Fl_Light_Button* b, void*) { diff --git a/fluid/about_panel.cxx b/fluid/about_panel.cxx index 78b48a6bb..a880d39dd 100644 --- a/fluid/about_panel.cxx +++ b/fluid/about_panel.cxx @@ -19,8 +19,7 @@ static void cb_OK(Fl_Return_Button* o, void*) { Fl_Window* make_about_panel(const char *copyright) { Fl_Window* w; - { Fl_Window* o = about_panel = new Fl_Window(309, 221, "about fluid"); - w = o; + { Fl_Window* o = about_panel = w = new Fl_Window(309, 221, "about fluid"); o->box(FL_UP_BOX); o->color(97); o->selection_color(47); diff --git a/fluid/alignment_panel.cxx b/fluid/alignment_panel.cxx index bb5691ab7..b5ab1f91d 100644 --- a/fluid/alignment_panel.cxx +++ b/fluid/alignment_panel.cxx @@ -22,8 +22,7 @@ Fl_Light_Button *include_H_from_C_button; Fl_Window* make_alignment_window() { Fl_Window* w; - { Fl_Window* o = alignment_window = new Fl_Window(210, 310, "fluid Preferences"); - w = o; + { Fl_Window* o = alignment_window = w = new Fl_Window(210, 310, "fluid Preferences"); { Fl_Box* o = new Fl_Box(10, 20, 190, 100, "ALIGNMENT:"); o->box(FL_ENGRAVED_FRAME); o->labelsize(10); diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 3ad9e827c..384eb5104 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -365,7 +365,6 @@ int main(int argc,char **argv) { } const char *c = argv[i]; make_main_window(); - include_H_from_C=1; if (c) set_filename(c); if (!compile_only) { Fl::visual((Fl_Mode)(FL_DOUBLE|FL_INDEX)); diff --git a/fluid/widget_panel.cxx b/fluid/widget_panel.cxx index 46e74066a..23ee01e19 100644 --- a/fluid/widget_panel.cxx +++ b/fluid/widget_panel.cxx @@ -5,9 +5,8 @@ Fl_Input *v_input[4]; Fl_Window* make_widget_panel() { - Fl_Window* w; - { Fl_Window* o = new Fl_Window(370, 480); - w = o; + Fl_Window *w; + { Fl_Window* o = w = new Fl_Window(370, 480); w->hotspot(o); { Fl_Input* o = new Fl_Input(90, 10, 210, 20, "name:"); o->box(FL_THIN_UP_BOX); |
