summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-03-29 13:28:43 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-03-29 13:28:43 +0000
commit81fd6777b28786413ca990f4261f4c6a7813fd6e (patch)
tree1367130fe61567aef94c50fda73450616293daa0
parentaf10e22140f34e25508a040820f8725df5e1c19d (diff)
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
-rw-r--r--fluid/Fl_Window_Type.cxx2
-rw-r--r--fluid/code.cxx22
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;
}