{ "build_module" : "builder", "items" : [ { "# JsRender.Node data" : "", "# Palete.Palete palete" : "", "$ xns" : "Gtk", "bool modal" : true, "default_height" : 200, "default_width" : 400, "items" : [ { "$ xns" : "Gtk", "* pack" : " get_content_area().append", "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", "items" : [ { "$ xns" : "Gtk", "* pack" : "append", "label" : "Name", "xtype" : "Label" }, { "$ xns" : "Gtk", "* pack" : "append", "id" : "name", "xtype" : "Entry" } ], "xtype" : "Box" }, { "$ xns" : "Gtk", "* pack" : "add_action_widget,0", "label" : "Cancel", "xtype" : "Button" }, { "$ xns" : "Gtk", "* pack" : "add_action_widget,1", "label" : "OK", "xtype" : "Button" } ], "listeners" : { "close_request" : [ "( ) => {", "", "\t this.el.response(Gtk.ResponseType.CANCEL);", " return true;", " ", "}", "" ], "response" : [ "(response_id) => {", "\t ", " if (response_id < 1) {", "\t this.el.hide();", "\t return;", "\t}", "\t", "\tvar name = _this.name.el.get_text();", "\tif (name.length < 1) {", "\t Xcls_StandardErrorDialog.singleton().show(", "\t _this.el,", "\t \"You must give the template a name. \"", "\t );", "\t return;", "\t}", "\tif (!Regex.match_simple (\"^[A-Za-z][A-Za-z0-9. ]+$\", name) )", "\t{", "\t Xcls_StandardErrorDialog.singleton().show(", "\t _this.el,", "\t \"Template Name must contain only letters dots\"", "\t );", "\t return;", "\t}", "\t", " this.palete.saveTemplate(name, data);", " ", " // now we save it..", " this.el.hide();", " ", "", "}", "" ] }, "xtype" : "Dialog", "| void showIt" : [ " (Gtk.Window parent, Palete.Palete palete, JsRender.Node data) {", " ", " \tthis.palete = palete;", " this.el.set_transient_for(parent);", " this.el.modal = true;", " ", " this.name.el.set_text(\"\");", " this.el.show();", " ", " ", " ", " ", "}", "" ] } ], "modOrder" : "", "name" : "DialogSaveTemplate", "parent" : "", "path" : "/home/alan/gitlive/roobuilder/src/Builder4/DialogSaveTemplate.bjs", "permname" : "", "title" : "" }