4123f43a709242fbafb8c65d29c407f5dd3bda48
[roobuilder] / src / Builder4 / PopoverEditor.bjs
1 {
2  "build_module" : "",
3  "items" : [
4   {
5    "# Editor editor" : "",
6    "$ xns" : "Gtk",
7    "* init" : [
8     "{",
9     "  this.editor = new Editor();",
10     "  this.el.add(this.editor.el);",
11     "}",
12     ""
13    ],
14    "Gtk.PositionType position" : "Gtk.PositionType.RIGHT",
15    "Xcls_MainWindow win" : "",
16    "bool active" : false,
17    "bool hexpand" : false,
18    "bool modal" : true,
19    "id" : "PopoverEditor",
20    "int height_request" : 800,
21    "int width_request" : 900,
22    "listeners" : {
23     "hide" : [
24      "() => {",
25      "\t// save...",
26      "\t _this.editor.saveContents();",
27      "}"
28     ]
29    },
30    "string prop_or_listener" : "\"\"",
31    "xtype" : "Popover",
32    "| void setMainWindow" : [
33     "(Xcls_MainWindow win) {",
34     "\tthis.win = win;",
35     "\tthis.editor.window = win;",
36     "}",
37     ""
38    ],
39    "| void show" : [
40     "(Gtk.Widget on_el, JsRender.JsRender file, JsRender.Node? node, string ptype, string key) {",
41     "\tthis.editor.show( file, node, ptype, key);",
42     "\t",
43     "    int w,h;",
44     "    this.win.el.get_size(out w, out h);",
45     "    ",
46     "    // left tree = 250, editor area = 500?",
47     "    ",
48     "    // min 450?",
49     "\t// max hieght ...",
50     "\t",
51     "\tvar  ww =  on_el.get_allocated_width();",
52     "\t",
53     "\t// width = should be max = w-ww , or 600 at best..?",
54     "\t ",
55     "    this.el.set_size_request( int.min(800,(w - ww)), h);",
56     "",
57     "   ",
58     "\tthis.el.set_modal(true);",
59     "\tthis.el.set_relative_to(on_el);",
60     "",
61     "\tthis.el.set_position(Gtk.PositionType.TOP);",
62     "",
63     "\t// window + header?",
64     " ",
65     "\tthis.el.show_all();",
66     "    //while(Gtk.events_pending()) { ",
67     "    //        Gtk.main_iteration();   // why?",
68     "    //}  ",
69     "",
70     "}",
71     ""
72    ]
73   }
74  ],
75  "modOrder" : "",
76  "name" : "PopoverEditor",
77  "parent" : "",
78  "path" : "/home/alan/gitlive/roobuilder/src/Builder4/PopoverEditor.bjs",
79  "permname" : "",
80  "title" : ""
81 }