protected void addMyVars()
{
- GLib.debug("callinged addMhyVars");
+ GLib.debug("calling addMyVars");
this.addLine();
this.addLine(this.ipad + "// my vars (def)");
continue;
}
+ var isUser = prop.ptype == NodePropType.USER;
+ if (this.node.fqn() == "Gtk.NotebookPage") {
+ isUser= true;
+ }
// is it a class property...
- if (cls != null && cls.props.has_key(prop.name) && prop.ptype != NodePropType.USER) {
+ if (cls != null && cls.props.has_key(prop.name) && !isUser) {
continue;
}
v= v.down();
}
//FIXME -- check for raw string.. "string XXXX"
+ var is_raw = prop.ptype == NodePropType.RAW;
+ // what's the type.. - if it's a string.. then we quote it..
+ if (prop.rtype == "string" && !is_raw) {
+ v = "\"" + v.escape("") + "\"";
+ }
// if it's a string...
prop.start_line = this.cur_line;
GLib.debug("Skipping wrapped properties - could not find class %s" , this.node.fqn());
return;
}
+
+ if (this.node.fqn() == "Gtk.NotebookPage") {
+ return;
+ }
// what are the properties of this class???
this.addLine();
this.addLine(this.ipad + "// set gobject values");
protected void addChildren()
{
//code
+ GLib.debug("addChildren %s, %d", this.node.fqn(), (int)this.node.readItems().size);
if (this.node.readItems().size < 1) {
return;
}
var cols = this.node.has("* columns") ? int.max(1, int.parse(this.node.get_prop("* columns").val)) : 1;
var colpos = 0;
-
+ var nb_child = "";
+ var nb_tab = "";
+ var nb_menu = "";
+
foreach(var child in this.node.readItems()) {
continue;
}
// create the element..
+
// this is only needed if it does not have an ID???
var childname = this.addPropSet(child, child.has("id") ? child.get_prop("id").val : "") ;
- if (!child.has("id")) {
- // must ref new objects..
- this.addLine("%s%s.ref();".printf(ipad, childname));
- }
+ if (!child.has("id") && this.this_el == "this.el.") {
+ this.addLine(this.ipad + childname +".ref();");
+ }
if (child.has("* prop")) {
-
+ if (this.node.fqn() == "Gtk.NotebookPage") {
+ switch (child.get_prop("* prop").val) {
+ case "child":
+ nb_child = childname + (this.this_el == "this.el." ? ".el" : "");
+ break;
+
+ case "tab":
+ nb_tab = childname + (this.this_el == "this.el." ? ".el" : "");
+ break;
+
+ case "menu":
+ nb_menu = childname + (this.this_el == "this.el." ? ".el" : "");
+ break;
+ }
+ continue;
+ }
// fixme special packing!??!?!
if (child.get_prop("* prop").val.contains("[]")) {
- // currently these 'child props
- // used for label[] on Notebook
- // used for button[] on Dialog?
- // columns[] ?
+ // currently this is not used?
+ // and it will not add ref..
this.packChild(child, childname, 0, 0, child.get_prop("* prop").val); /// fixme - this is a bit speciall...
continue;
continue;
}
- if (!child.has("id") && this.this_el == "this.el.") {
- this.addLine(this.ipad + childname +".ref();");
- }
+
this.packChild(child, childname, cols, colpos);
if (child.has("colspan")) {
}
+
+ GLib.debug("got node %s with nb_child= %s", this.node.fqn() , nb_child);
+ if (this.node.fqn() == "Gtk.NotebookPage" && nb_child != "") {
+ var nb = (this.this_el == "this.el." ? "notebook.el" : "notebook");
+
+ if (nb_tab == "" && this.node.has("tab_label")) {
+ nb_tab = "new Gtk.Label(this.tab_label)";
+ }
+
+ if (nb_menu == "" && nb_tab == "") {
+ this.addLine(@"$(ipad)$(nb).append_page( $(nb_child) );");
+ return;
+ }
+ if (nb_menu == "") {
+ this.addLine(@"$(ipad)$(nb).append_page( $(nb_child) , $(nb_tab) );");
+ return;
+ }
+ this.addLine(@"$(ipad)$(nb).append_page_menu( $(nb_child) , $(nb_tab), $(nb_menu) );");
+
+ }
+
}
+ /**
+ var childname = new Xcls_.... (....)
+
+ */
protected string addPropSet(Node child, string child_name)
- {
+ {
var xargs = "";
}
}
*/
+ if (child.fqn() == "Gtk.NotebookPage") {
+ xargs +=" , this";
+ }
this.addLine(this.ipad + @"$(prefix)new $cls( _this $xargs);" );
switch (this.node.fqn()) {
-
+
case "Gtk.Fixed":
return;
case "Gtk.Notebook": // use label
+ if (child.fqn() == "Gtk.NotebookPage") {
+ return;
+ }
var label = child.has("notebook_label") ? child.get_prop("notebook_label").val.escape() : "";
this.addLine(@"$(ipad)$(this_el)append_page( $(childname)$(el_name), new Gtk.Label(\"$(label)\");");