sync
[app.Builder.js] / oldbuilder / AddPropertyPopup.js
1 //<Script type="text/javascript">
2 Gtk = imports.gi.Gtk;
3 GLib = imports.gi.GLib;
4 GObject = imports.gi.GObject;
5
6 XObject = imports.XObject.XObject;
7 console = imports.console;
8  
9
10
11
12 AddPropertyPopup = new XObject({
13     
14         
15     xtype : Gtk.Menu,
16     
17      
18     items :  [
19         {
20             xtype : Gtk.MenuItem,
21             pack : [ 'append' ],
22             label : 'Add "id"',
23             tooltip_markup : "Using this.get('*someid') will find any id in an application.",
24             listeners : {
25                 activate : function () {
26                     var LeftPanel = imports.Builder.LeftPanel.LeftPanel;
27                     LeftPanel.get('model').add( {
28                         key : 'id', 
29                         type : 'string',
30                         val : '',
31                         //skel  : skel,
32                         etype : 'props'
33                     }) //, skel);
34                 }
35             }
36         },
37         {
38             xtype : Gtk.MenuItem,
39             pack : [ 'append' ],
40             label : 'Gtk - Add "pack"',
41             tooltip_markup : "Set what type of packing is to be used.",
42             listeners : {
43                 activate : function () {
44                     var LeftPanel = imports.Builder.LeftPanel.LeftPanel;
45                     LeftPanel.get('model').add( {
46                         key : 'pack', 
47                         type : 'string',
48                         val : 'add',
49                         //skel  : skel,
50                         etype : 'props'
51                     }) //, skel);
52                 }
53             }
54         },
55         {
56             xtype : Gtk.MenuItem,
57             pack : [ 'append' ],
58             label : 'Gtk - Add "init"',
59             tooltip_markup : "Set what type of packing is to be used.",
60             listeners : {
61                 activate : function () {
62                     var LeftPanel = imports.Builder.LeftPanel.LeftPanel;
63                     LeftPanel.get('model').add( {
64                         key : '|init', 
65                         type : 'function',
66                         val  : "function() {\n    XObject.prototype.init.call(this);\n}\n",
67                         etype : 'props'
68                     }) //, skel);
69                 }
70             }
71         },
72     
73        
74         {
75             xtype : Gtk.MenuItem,
76             pack : [ 'append' ],
77             label : 'Add String Property (User defined)',
78             listeners : {
79                 activate : function () {
80                     var LeftPanel = imports.Builder.LeftPanel.LeftPanel;
81                     LeftPanel.get('model').add( {
82                         key : '', 
83                         type : 'string',
84                         val  : "",
85                         etype : 'props'
86                     });
87                    
88                 }
89             }
90             
91         },
92         {
93             xtype : Gtk.MenuItem,
94             pack : [ 'append' ],
95             label : 'Add Number Property (User defined)',
96             listeners : {
97                 activate : function () {
98                     var LeftPanel = imports.Builder.LeftPanel.LeftPanel;
99                     LeftPanel.get('model').add( {
100                         key : '', 
101                         type : 'number',
102                         val  : 0,
103                         etype : 'props'
104                     });
105                    
106                 }
107             }
108             
109         },
110         {
111             xtype : Gtk.MenuItem,
112             pack : [ 'append' ],
113             label : 'Add Boolean Property (User defined)',
114             listeners : {
115                 activate : function () {
116                     var LeftPanel = imports.Builder.LeftPanel.LeftPanel;
117                     LeftPanel.get('model').add( {
118                         key : '', 
119                         type : 'boolean',
120                         val  : false,
121                         etype : 'props'
122                     });
123                    
124                 }
125             }
126             
127         },
128         {
129             
130             
131             xtype : Gtk.MenuItem,
132             pack : [ 'append' ],
133             label : 'Add Function (User defined)',
134             listeners : {
135                 activate : function () {
136                     var LeftPanel = imports.Builder.LeftPanel.LeftPanel;
137                     LeftPanel.get('model').add( {
138                         key : '|', 
139                         type : 'function',
140                         val  : "function() {\n    \n}\n",
141                         etype : 'props'
142                     }) //, skel);
143                 }
144             }
145             
146         },
147     ]
148 });