Test.GtkWriter.vala.c
[app.Builder.js] / Builder4 / WindowRightPalete.bjs
1 {
2     "id": "file-gtk-11",
3     "name": "WindowRightPalete",
4     "parent": "",
5     "title": false,
6     "path": "/home/alan/gitlive/app.Builder.js/Builder4/WindowRightPalete.bjs",
7     "items": [
8         {
9             ".signal:void:drag_end()": "",
10             ".Project.Project:provider": "",
11             "id": "RightPalete",
12             "pack": "pack_start,false,false",
13             "xtype": "VBox",
14             "|void:hide": " () {\n    \n      _this.buttonbar.el.show();\n      _this.viewbox.el.hide();\n  //    print(\"TRIED TO HIDE\");\n}\n",
15             "|void:show": "function() {\n    _this.buttonbar.el.hide();\n    _this.viewbox.el.show();\n   // this.get('model').expanded();\n            \n}\n",
16             "|xns": "Gtk",
17             "items": [
18                 {
19                     "|xns": "Gtk",
20                     "xtype": "VBox",
21                     "pack": "add",
22                     "id": "buttonbar",
23                     "items": [
24                         {
25                             "listeners": {
26                                 "clicked": "  (self) => {\n\t_this..show();\n}"
27                             },
28                             "pack": "pack_start,false,true",
29                             "xtype": "Button",
30                             "|xns": "Gtk",
31                             "items": [
32                                 {
33                                     "|xns": "Gtk",
34                                     "xtype": "Image",
35                                     "pack": "add",
36                                     "|stock": "Gtk.STOCK_GOTO_FIRST",
37                                     "|icon_size": "Gtk.IconSize.MENU"
38                                 }
39                             ]
40                         },
41                         {
42                             "listeners": {
43                                 "enter_notify_event": " (self, event) => {\n    RightPalete.show();\n    return false;\n}"
44                             },
45                             "angle": 270,
46                             "label": "Palete",
47                             "pack": "add",
48                             "xtype": "Label",
49                             "|init": " this.el.add_events ( Gdk.EventMask.BUTTON_MOTION_MASK );\n \n",
50                             "|xns": "Gtk"
51                         }
52                     ]
53                 },
54                 {
55                     "|xns": "Gtk",
56                     "xtype": "VBox",
57                     "pack": "add",
58                     "id": "viewbox",
59                     "items": [
60                         {
61                             "|xns": "Gtk",
62                             "xtype": "HBox",
63                             "pack": "pack_start,false,true",
64                             "items": [
65                                 {
66                                     "|xns": "Gtk",
67                                     "xtype": "Label",
68                                     "pack": "add",
69                                     "label": "Palete"
70                                 },
71                                 {
72                                     "listeners": {
73                                         "clicked": "function (self) {\n\t_this.RightPalete.hide();\n}"
74                                     },
75                                     "pack": "pack_start,false,true",
76                                     "xtype": "Button",
77                                     "|xns": "Gtk",
78                                     "items": [
79                                         {
80                                             "|xns": "Gtk",
81                                             "xtype": "Image",
82                                             "pack": "add",
83                                             "|stock": "Gtk.STOCK_GOTO_LAST",
84                                             "|icon_size": "Gtk.IconSize.MENU"
85                                         }
86                                     ]
87                                 }
88                             ]
89                         },
90                         {
91                             "pack": "add",
92                             "xtype": "ScrolledWindow",
93                             "|init": "  this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n   this.el.set_size_request(-1,200);\n \n",
94                             "|shadow_type": "Gtk.ShadowType.IN",
95                             "|xns": "Gtk",
96                             "items": [
97                                 {
98                                     "listeners": {
99                                         "drag_begin": "  ( ctx) => {\n    // we could fill this in now...\n//        Seed.print('SOURCE: drag-begin');\n        \n        \n        \n        Gtk.TreeIter iter;\n        var s = _this.selection;\n        \n        s.get_selected(_this.model.el, out iter);\n        var path = _this.model.el.get_path(iter);\n        \n        /// pix is a surface..\n        var pix = this.el.create_row_drag_icon ( path);\n            \n                \n        Gtk.drag_set_icon_surface (ctx, pix);\n        Glib.Value val;\n        \n\n        _this.model.el.get_value(iter, 0, out value);\n        if (_this.provider == null) {\n            return false;\n        }\n        //if (!this.get('/RightPalete').provider) {\n        //    return false;\n        //}\n        this.dropList = _this.provider.getDropList((string)value);\n        this.dragData = (string) value;\n         \n        \n        return true;\n}",
100                                         "drag_data_get": "  (drag_context, selection_data, info, time) => {\n \t//Seed.print('Palete: drag-data-get: ' + target_type);\n        if (this.el.dragData.length > 0 ) {\n            selection_data.set_text(this.dragData ,this.dragData.length);\n        }\n        \n        \n        //this.el.dragData = \"TEST from source widget\";\n        \n        \n}",
101                                         "drag_end": "( drag_context)  => {\n \t//Seed.print('SOURCE: drag-end');\n\t\n\tthis.dragData = \"\";\n\tthis.dropList = null;\n\t_this.drag_end(); // call signal..\n\t//this.get('/LeftTree.view').highlight(false);\n\treturn true;\n}",
102                                         "button_press_event": " ( event) => {\n\n //\tif (!this.get('/Editor').save()) {\n //\t    // popup!! - click handled.. \n// \t    return true;\n//        }\n    return false;\n}"
103                                     },
104                                     ".GLib.List:dropList": "",
105                                     ".string:dragData": "",
106                                     "pack": "add",
107                                     "xtype": "TreeView",
108                                     "|enable_tree_lines": "true",
109                                     "|headers_visible": "false",
110                                     "|init": " {\n    this.el.set_size_request(150,-1);\n                          //  set_reorderable: [1]\n                                  \n    var description = new Pango.FontDescription();\n    description.set_size(8000);\n    this.el.modify_font(description);\n    \n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n   // this.selection.signal['changed'].connect(function() {\n    //    _view.listeners['cursor-changed'].apply(_view, [ _view, '']);\n    //});\n    // see: http://live.gnome.org/GnomeLove/DragNDropTutorial\n     \n    Gtk.drag_source_set (\n            this.el,            /* widget will be drag-able */\n            Gdk.ModifierType.BUTTON1_MASK,       /* modifier that will start a drag */\n            null,            /* lists of target to support */\n            0,              /* size of list */\n            Gdk.DragAction.COPY         /* what to do with data after dropped */\n    );\n    //Gtk.drag_source_set_target_list(this.el, LeftTree.targetList);\n   \n    Gtk.drag_source_set_target_list(this.el, Application.targetList);\n    Gtk.drag_source_add_text_targets(this.el); \n \n}\n",
111                                     "|xns": "Gtk",
112                                     "items": [
113                                         {
114                                             "columns": "typeof(string),typeof(string)",
115                                             "id": "model",
116                                             "n_columns": 2,
117                                             "pack": "set_model",
118                                             "xtype": "ListStore",
119                                             "|void:load": " (GLib.List<string> tr, Gtk.TreeIter? iter)\n{\n    if (iter == null) {\n        this.el.clear();\n    }\n    //console.log('Project tree load: ' + tr.length);\n\n    Gtk.TreeIter citer;\n    //this.insert(citer,iter,0);\n    for(var i =0 ; i < tr.length(); i++) {\n        if (iter == null) {\n            \n            this.el.append(out citer);   \n        } else {\n            this.el.insert(out citer,iter,-1);\n        }\n        \n        var r = tr.nth_data(i);\n        //Seed.print(r);\n        this.el.set_value(citer, 0,   r ); // title \n        \n        //this.el.set_value(citer, 1,  new GObject.Value( r)); //id\n        //if (r.cn && r.cn.length) {\n        //    this.load(r.cn, citer);\n        //}\n    }\n    \n    \n}",
120                                             "|string:getValue": " (Gtk.TreeIter iter, int col)  {\n    GLib.Value gval;\n     this.el.get_value(iter, col , out gval);\n    return  (string)gval;\n    \n    \n}",
121                                             "|xns": "Gtk"
122                                         },
123                                         {
124                                             "pack": "append_column",
125                                             "xtype": "TreeViewColumn",
126                                             "|init": " this.el.add_attribute(_this.txtrender , \"markup\", 0 );\n \n",
127                                             "|xns": "Gtk",
128                                             "items": [
129                                                 {
130                                                     "id": "txtrender",
131                                                     "pack": "pack_start",
132                                                     "xtype": "CellRendererText",
133                                                     "|xns": "Gtk"
134                                                 }
135                                             ]
136                                         }
137                                     ]
138                                 }
139                             ]
140                         }
141                     ]
142                 }
143             ]
144         }
145     ],
146     "permname": "",
147     "modOrder": ""
148 }