FLUID widget class support fixes.

fluid/Fl_Window_Type.cxx:
    - Fl_Widget_Class::write_code1(): forgot name() in window
      class constructor.

fluid/code.cxx:
    - write_code(): skip nodes as needed when writing code so we
      don't place method code in the constructor.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4252 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2005-04-09 14:17:13 +00:00
parent 25447eeb04
commit 000eca281a
2 changed files with 13 additions and 3 deletions

View File

@ -1342,7 +1342,7 @@ void Fl_Widget_Class_Type::write_code1() {
write_h(" void _%s();\n", name());
write_h("public:\n");
write_h(" %s(int X, int Y, int W, int H, const char *L = 0);\n", name());
write_h(" %s(int W, int H, const char *L = 0);\n");
write_h(" %s(int W, int H, const char *L = 0);\n", name());
write_c("%s::%s(int X, int Y, int W, int H, const char *L)\n", name(), name());
write_c(" : %s(X, Y, W, H, L) {\n", c);

View File

@ -254,14 +254,24 @@ static Fl_Type* write_code(Fl_Type* p) {
// 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;
else {
int level = q->level;
do {
q = q->next;
} while (q && q->level > level);
}
}
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;
else {
int level = q->level;
do {
q = q->next;
} while (q && q->level > level);
}
}
write_h("};\n");