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