{
"build_module" : "builder",
+ "gen_extended" : false,
"items" : [
{
+ "# JsRender.Node node" : "",
+ "# Palete.Palete palete" : "",
+ "# Project.Project project" : "",
+ "# Xcls_MainWindow window" : "",
"$ modal" : true,
"$ xns" : "Gtk",
+ "@ void complete" : "(JsRender.Node? node)",
"default_height" : 200,
"default_width" : 400,
"items" : [
{
- "$ pack" : "get_content_area().add ",
"$ xns" : "Gtk",
+ "* pack" : "get_content_area().append",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "pack_start,false,false,0",
+ "* pack" : "append",
"Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
- "gint margin" : 3,
+ "int margin_end" : 3,
+ "int margin_start" : 3,
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "pack_start,false,false",
+ "* pack" : "append",
"label" : "Select Template : ",
"xtype" : "Label"
},
{
"$ xns" : "Gtk",
"* init" : "this.el.add_attribute(_this.cellrenderer.el , \"markup\", 1 );",
- "* pack" : "add",
+ "* pack" : "append",
"id" : "combo",
"items" : [
{
},
{
"$ xns" : "Gtk",
- "* pack" : "pack_start,false,false,0",
+ "* pack" : "append",
"Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
- "gint margin" : 3,
+ "int margin_end" : 3,
+ "int margin_start" : 3,
"items" : [
{
"$ xns" : "Gtk",
- "* pack" : "pack_start,false,false",
+ "* pack" : "append",
"label" : "Select Database Table : ",
"xtype" : "Label"
},
{
"$ xns" : "Gtk",
"* init" : "this.el.add_attribute(_this.dbcellrenderer.el , \"markup\", 1 );",
- "* pack" : "add",
+ "* pack" : "append",
"id" : "dbcombo",
"items" : [
{
}
],
"listeners" : {
- "delete_event" : [
- " (self, event) =>{",
- " this.el.hide();",
- " return true;",
- "}"
+ "close_request" : [
+ "( ) => {",
+ "",
+ " this.el.hide();",
+ " return true;;",
+ "}",
+ ""
+ ],
+ "response" : [
+ "(res) => {",
+ "",
+ "\t//var node = _this.node;",
+ "\t//var project = _this.project;",
+ "\treturn;",
+ " /*",
+ " ",
+ " if (this.plugin == null) {",
+ "\t this.plugin = new Xcls_DialogPluginWebkit();",
+ "\t this.plugin.complete.connect((json_str) => {",
+ " \t\t\tprint(\"json_str = %s\\n\", json_str);",
+ " if (json_str.length < 1) {",
+ "\t\t\t\tthis.complete(_this.node);",
+ "\t\t\t\treturn; ",
+ " }",
+ " var pa = new Json.Parser();",
+ " try {",
+ "",
+ "\t \tpa.load_from_data(json_str);",
+ "\t\t\t} catch(Error e) {",
+ "\t\t\t this.complete(node);",
+ " \t\treturn; // 1 = just add it..",
+ " \t\t}",
+ " \t\tvar new_node = pa.get_root();",
+ "\t\t",
+ "\t\t\tif (new_node.get_node_type () != Json.NodeType.OBJECT) {",
+ "\t\t\t\t this.complete(node);",
+ "\t\t\t\t\t\treturn; ",
+ "\t\t\t}",
+ "\t\t\tvar obj = new_node.get_object ();",
+ "",
+ "\t\t\tvar ret = new JsRender.Node();",
+ "",
+ "\t\t\tret.loadFromJson(obj, 1);",
+ "\t \t\tthis.complete(ret);",
+ " \t\t});",
+ " ",
+ " }",
+ " ",
+ " ",
+ " ",
+ "\t",
+ " this.el.hide(); ",
+ " //var ix = _this.combo.el.get_active();",
+ " if (res < 1 ) {",
+ " \tthis.complete(null);",
+ " return; // 0 = cancel.",
+ " }",
+ " if (res < 2 ) {",
+ " this.complete(node);",
+ " return; // 1 = just add it..",
+ " }",
+ " ",
+ " ",
+ " // have they selected a table??",
+ " ",
+ " Gtk.TreeIter iter; ",
+ " Value vfname; ",
+ " if (_this.dbcombo.el.get_active_iter (out iter)) { ",
+ " this.dbmodel.el.get_value (iter, 0, out vfname);",
+ " if (((string)vfname).length > 0 && this.plugin.has_plugin(node.fqn())) {",
+ " this.plugin.showIt(this.window.el, project, node.fqn(), (string)vfname);",
+ " return;",
+ " }",
+ "\t this.complete(node);",
+ " return; // 1 = just add it..",
+ " ",
+ " ",
+ " }",
+ "",
+ " if (!_this.combo.el.get_active_iter (out iter)) {",
+ "",
+ " this.complete(node);",
+ " return; // 1 = just add it../ nothing selected...",
+ " }",
+ " ",
+ " this.model.el.get_value (iter, 0, out vfname);",
+ " ",
+ " this.complete(this.palete.loadTemplate((string)vfname));",
+ " return; // 1 = just add it..",
+ " ",
+ "*/",
+ "}",
+ ""
]
},
"title" : "Add an Object",
"xtype" : "Dialog",
- "| JsRender.Node? show" : [
- " (Xcls_MainWindow mwindow, Palete.Palete pal, JsRender.Node node, Project.Project project) {",
- " ",
- " this.el.show_all();",
- " var opts = pal.listTemplates(node);",
- " if (opts.length() < 1) {",
- " this.el.hide();",
- " return node;",
- " }",
- " this.el.set_attached_to( mwindow.el);",
- " this.el.set_transient_for( mwindow.el);",
- " ",
- " //opts.unshift({ path: '' , name :'Just add Element' });",
- " _this.model.loadData(opts);",
- " _this.combo.el.set_active(-1);",
- " ",
- " ",
- " var db = new Palete.RooDatabase.from_project(project);",
- " _this.dbmodel.loadData(db.readTablesGee());",
- " ",
- " var plug = mwindow.windowstate.webkit_plugin;",
- " ",
- " _this.dbcombo.el.set_active(-1);",
- " ",
- " ",
- " ",
- " var res = this.el.run();",
- " this.el.hide(); ",
- " //var ix = _this.combo.el.get_active();",
- " if (res < 1 ) {",
- " return null; // 0 = cancel.",
- " }",
- " if (res < 2 ) {",
- " return node; // 1 = just add it..",
- " }",
- " ",
- " // have they selected a table??",
- " ",
- " Gtk.TreeIter iter; ",
- " Value vfname; ",
- " if (_this.dbcombo.el.get_active_iter (out iter)) { ",
- " this.dbmodel.el.get_value (iter, 0, out vfname);",
- " if (((string)vfname).length > 0 && plug.has_plugin(node.fqn())) {",
- " var json_str = plug.show(mwindow.el, project, node.fqn(), (string)vfname);",
- " print(\"json_str = %s\\n\", json_str);",
- " if (json_str.length < 1) {",
- "",
- " return node;",
- " }",
- " var pa = new Json.Parser();",
- " try {",
+ "| void showIt" : [
+ " (",
+ " \tXcls_MainWindow mwindow, ",
+ " \tPalete.Palete pal, ",
+ "\t JsRender.Node node, ",
+ "\t Project.Project project",
+ " ) {",
"",
- "\t pa.load_from_data(json_str);",
- "\t } catch(Error e) {",
- "\t return node;",
- "\t }",
- "\t var new_node = pa.get_root();",
- " ",
- "\t if (new_node.get_node_type () != Json.NodeType.OBJECT) {",
- "\t\t return node;",
- "\t }",
- "\t var obj = new_node.get_object ();",
+ "\tthis.el.show();",
"",
- "\t var ret = new JsRender.Node();",
+ "\tvar opts = pal.listTemplates(node);",
+ "\tif (opts.length() < 1) {",
+ "\tthis.el.hide();",
+ "\t\tthis.complete(node);",
+ "\t\treturn; ",
+ "\t}",
+ "\tthis.el.set_transient_for( mwindow.el);",
"",
- "\t ret.loadFromJson(obj, 1);",
- "\t return ret;",
- " }",
- " ",
- " }",
+ "\t//opts.unshift({ path: '' , name :'Just add Element' });",
+ "\t_this.model.loadData(opts);",
+ "\t_this.combo.el.set_active(-1);",
"",
- " if (!_this.combo.el.get_active_iter (out iter)) {",
+ " /*",
+ "\tvar db = new Palete.RooDatabase.from_project((Project.Roo) project);",
+ "\t_this.dbmodel.loadData(db.readTablesGee());",
"",
- " return node; // nothing selected...",
- " }",
+ "*/",
+ "\t_this.dbcombo.el.set_active(-1);",
+ " ",
+ "\tthis.window = mwindow;",
+ "\tthis.palete = pal;",
+ "\tthis.node = node;",
+ "\tthis.project = project;",
" ",
- " this.model.el.get_value (iter, 0, out vfname);",
- " ",
- " ",
- " return pal.loadTemplate((string)vfname);",
- "",
"}",
""
]
}
],
- "modOrder" : "",
- "name" : "DialogTemplateSelect",
- "parent" : "",
- "path" : "/home/alan/gitlive/roobuilder/src/Builder4/DialogTemplateSelect.bjs",
- "permname" : "",
- "title" : ""
+ "name" : "DialogTemplateSelect"
}
\ No newline at end of file