DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2790
Version: 1.3-feature


Here is a patch that allow fluid generate constructors without parameters
for widget_class, it does the same as the last change that made it
possible to do this for windows.

In fact it's only a reorder of the code that write the constructors.


Link: http://www.fltk.org/str.php?L2790
Version: 1.3-feature
Index: Fl_Window_Type.cxx
===================================================================
--- Fl_Window_Type.cxx  (revision 9204)
+++ Fl_Window_Type.cxx  (working copy)
@@ -1499,12 +1499,13 @@
   if (!c) c = "Fl_Group";
 
   write_h("\nclass %s : public %s {\n", name(), c);
+  write_h("  void _%s();\n", trimclassname(name()));
+  write_h("public:\n");
+  write_h("  %s();\n", trimclassname(name()));
   if (strstr(c, "Window")) {
-    write_h("  void _%s();\n", trimclassname(name()));
-    write_h("public:\n");
+
     write_h("  %s(int X, int Y, int W, int H, const char *L = 0);\n", 
trimclassname(name()));
     write_h("  %s(int W, int H, const char *L = 0);\n", trimclassname(name()));
-    write_h("  %s();\n", trimclassname(name()));
 
     // a constructor with all four dimensions plus label
     write_c("%s::%s(int X, int Y, int W, int H, const char *L)\n", name(), 
trimclassname(name()));
@@ -1519,6 +1520,19 @@
     write_c("  _%s();\n", trimclassname(name()));
     write_c("}\n\n");
     
+//    write_c("  %s *w = this;\n", name());
+  } else {
+    write_h("  %s(int X, int Y, int W, int H, const char *L = 0);\n", 
trimclassname(name()));
+
+    write_c("%s::%s(int X, int Y, int W, int H, const char *L)\n", name(), 
trimclassname(name()));
+    if (wc_relative)
+      write_c("  : %s(0, 0, W, H, L) {\n", c);
+    else
+      write_c("  : %s(X, Y, W, H, L) {\n", c);
+    write_c("  _%s();\n", trimclassname(name()));
+    write_c("}\n\n");
+  }
+
     // a constructor that takes size and label from the Fluid database
     write_c("%s::%s()\n", name(), trimclassname(name()));
     write_c("  : %s(0, 0, %d, %d, ", c, o->w(), o->h());
@@ -1526,23 +1540,11 @@
     if (cstr) write_cstring(cstr);
     else write_c("0");
     write_c(") {\n");
-    write_c("  clear_flag(16);\n");
+    if (strstr(c, "Window")) write_c("  clear_flag(16);\n");
     write_c("  _%s();\n", trimclassname(name()));
     write_c("}\n\n");
     
     write_c("void %s::_%s() {\n", name(), trimclassname(name()));
-//    write_c("  %s *w = this;\n", name());
-  } else {
-    write_h("public:\n");
-    write_h("  %s(int X, int Y, int W, int H, const char *L = 0);\n", 
trimclassname(name()));
-
-    write_c("%s::%s(int X, int Y, int W, int H, const char *L)\n", name(), 
trimclassname(name()));
-    if (wc_relative)
-      write_c("  : %s(0, 0, W, H, L) {\n", c);
-    else
-      write_c("  : %s(X, Y, W, H, L) {\n", c);
-  }
-
 //  write_c("  %s *o = this;\n", name());
 
   write_widget_code();
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to