resources/RooUsage.txt
[app.Builder.js] / src / Builder4 / DialogSaveTemplate.bjs
1 {
2  "name" : "DialogSaveTemplate",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/DialogSaveTemplate.bjs",
6  "permname" : "",
7  "modOrder" : "",
8  "build_module" : "builder",
9  "items" : [
10   {
11    "listeners" : {
12     "delete_event" : " (self, event) => {\n   this.el.response(Gtk.ResponseType.CANCEL);\n    return true;\n    \n}"
13    },
14    "default_width" : 400,
15    "|    void show" : " (Gtk.Window parent, Palete.Palete palete, JsRender.Node data) {\n \n    \n        this.el.set_transient_for(parent);\n        this.el.modal = true;\n        \n          this.name.el.set_text(\"\");\n        this.el.show_all();\n         var   name = \"\";\n        while (true) {\n            var response_id = this.el.run();\n            if (response_id < 1) {\n                this.el.hide();\n                 return;\n            }\n            \n            name = _this.name.el.get_text();\n            if (name.length < 1) {\n                StandardErrorDialog.singleton().show(\n                     _this.el,\n                    \"You must give the template a name. \"\n                );\n                continue;\n            }\n            if (!Regex.match_simple (\"^[A-Za-z][A-Za-z0-9. ]+$\", name) )\n            {\n                StandardErrorDialog.singleton().show(\n                     _this.el,\n                    \"Template Name must contain only letters dots\"\n                );\n                continue;\n            }\n            break;\n        }\n        palete.saveTemplate(name, data);\n        \n        // now we save it..\n        this.el.hide();\n        \n         \n  \n   \n}\n",
16    "xtype" : "Dialog",
17    "default_height" : 200,
18    "# Palete.Palete palete" : "",
19    "$ modal" : true,
20    "# JsRender.Node data" : "",
21    "$ xns" : "Gtk",
22    "items" : [
23     {
24      "xtype" : "Box",
25      "$ pack" : " get_content_area().add\n\n",
26      "$ xns" : "Gtk",
27      "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
28      "items" : [
29       {
30        "label" : "Name",
31        "xtype" : "Label",
32        "* pack" : "add",
33        "$ xns" : "Gtk"
34       },
35       {
36        "id" : "name",
37        "xtype" : "Entry",
38        "* pack" : "add",
39        "$ xns" : "Gtk"
40       }
41      ]
42     },
43     {
44      "label" : "Cancel",
45      "xtype" : "Button",
46      "* pack" : "add_action_widget,0",
47      "$ xns" : "Gtk"
48     },
49     {
50      "label" : "OK",
51      "xtype" : "Button",
52      "* pack" : "add_action_widget,1",
53      "$ xns" : "Gtk"
54     }
55    ]
56   }
57  ]
58 }