From 81fd6777b28786413ca990f4261f4c6a7813fd6e Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 29 Mar 2005 13:28:43 +0000 Subject: [PATCH] Finished changes needed to support full widget classes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4201 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/Fl_Window_Type.cxx | 2 -- fluid/code.cxx | 22 ++++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index ba1541bd3..5d05ecd5d 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -1384,8 +1384,6 @@ void Fl_Widget_Class_Type::write_code2() { if (((Fl_Window*)o)->resizable() == o) write_c("%sresizable(this);\n", indent()); write_c("}\n"); - - write_h("};\n"); } diff --git a/fluid/code.cxx b/fluid/code.cxx index f8fd58e6e..d04d390fd 100644 --- a/fluid/code.cxx +++ b/fluid/code.cxx @@ -250,8 +250,26 @@ static Fl_Type* write_code(Fl_Type* p) { if (!(p==Fl_Type::last && p->is_comment())) p->write_code1(); Fl_Type* q; - for (q = p->next; q && q->level > p->level;) q = write_code(q); - p->write_code2(); + if (p->is_widget() && p->is_class()) { + // Handle widget classes specially + for (q = p->next; q && q->level > p->level;) { + if (strcmp(q->type_name(), "Function")) q = write_code(q); + else q = q->next; + } + + p->write_code2(); + + for (q = p->next; q && q->level > p->level;) { + if (!strcmp(q->type_name(), "Function")) q = write_code(q); + else q = q->next; + } + + write_h("};\n"); + } else { + for (q = p->next; q && q->level > p->level;) q = write_code(q); + + p->write_code2(); + } return q; }