1 static Xcls_DialogNewComponent _DialogNewComponent;
3 public class Xcls_DialogNewComponent : Object
6 private Xcls_DialogNewComponent _this;
8 public static Xcls_DialogNewComponent singleton()
10 if (_DialogNewComponent == null) {
11 _DialogNewComponent= new Xcls_DialogNewComponent();
13 return _DialogNewComponent;
15 public Xcls_build_module build_module;
16 public Xcls_dbcellrenderer dbcellrenderer;
17 public Xcls_dbmodel dbmodel;
18 public Xcls_name name;
21 public signal void success (Project.Project pr, JsRender.JsRender file);
24 public Xcls_DialogNewComponent()
27 this.el = new Gtk.Dialog();
32 this.el.title = "New Component";
33 this.el.default_height = 200;
34 this.el.default_width = 500;
35 this.el.deletable = true;
37 var child_0 = new Xcls_VBox2( _this );
39 this.el.get_content_area().add ( child_0.el );
40 var child_1 = new Xcls_Button10( _this );
42 this.el.add_action_widget ( child_1.el , 0 );
43 var child_2 = new Xcls_Button11( _this );
45 this.el.add_action_widget ( child_2.el , 1 );
48 this.el.delete_event.connect( (self, event) => {
53 this.el.response.connect( (self, response_id) => {
57 this.el.show.connect( (self) => {
63 // user defined functions
64 public void updateFileFromEntry () {
66 _this.file.title = _this.title.el.get_text();
67 _this.file.region = _this.region.el.get_text();
68 _this.file.parent = _this.parent.el.get_text();
69 _this.file.permname = _this.permname.el.get_text();
70 _this.file.modOrder = _this.modOrder.el.get_text();
72 if (_this.file.name.length > 0 && _this.file.name != _this.name.el.get_text()) {
73 _this.file.renameTo(_this.name.el.get_text());
75 // store the module...
76 _this.file.build_module = "";
78 if (_this.build_module.el.get_active_iter (out iter)) {
80 this.dbmodel.el.get_value (iter, 0, out vfname);
81 if (((string)vfname).length > 0) {
82 _this.file.build_module = (string)vfname;
95 //this.success = c.success;
99 public class Xcls_VBox2 : Object
102 private Xcls_DialogNewComponent _this;
108 public Xcls_VBox2(Xcls_DialogNewComponent _owner )
111 this.el = new Gtk.VBox( true, 0 );
115 // set gobject values
116 var child_0 = new Xcls_Table3( _this );
118 this.el.pack_start ( child_0.el , false,false,0 );
121 // user defined functions
123 public class Xcls_Table3 : Object
126 private Xcls_DialogNewComponent _this;
132 public Xcls_Table3(Xcls_DialogNewComponent _owner )
135 this.el = new Gtk.Table( 3, 2, true );
139 // set gobject values
140 var child_0 = new Xcls_Label4( _this );
142 this.el.attach_defaults ( child_0.el , 0,1,1,2 );
143 var child_1 = new Xcls_build_module( _this );
145 this.el.attach_defaults ( child_1.el , 1,2,1,2 );
146 var child_2 = new Xcls_Label8( _this );
148 this.el.attach_defaults ( child_2.el , 0,1,1,2 );
149 var child_3 = new Xcls_name( _this );
151 this.el.attach_defaults ( child_3.el , 1,2,0,1 );
154 // user defined functions
156 public class Xcls_Label4 : Object
159 private Xcls_DialogNewComponent _this;
165 public Xcls_Label4(Xcls_DialogNewComponent _owner )
168 this.el = new Gtk.Label( "Module to build (Vala only)" );
172 // set gobject values
173 this.el.justify = Gtk.Justification.RIGHT;
174 this.el.xalign = 0.900000f;
175 this.el.visible = true;
178 // user defined functions
181 public class Xcls_build_module : Object
183 public Gtk.ComboBox el;
184 private Xcls_DialogNewComponent _this;
190 public Xcls_build_module(Xcls_DialogNewComponent _owner )
193 _this.build_module = this;
194 this.el = new Gtk.ComboBox();
198 // set gobject values
199 var child_0 = new Xcls_dbcellrenderer( _this );
201 this.el.pack_start ( child_0.el , true );
202 var child_1 = new Xcls_dbmodel( _this );
204 this.el.set_model ( child_1.el );
208 this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
211 // user defined functions
213 public class Xcls_dbcellrenderer : Object
215 public Gtk.CellRendererText el;
216 private Xcls_DialogNewComponent _this;
222 public Xcls_dbcellrenderer(Xcls_DialogNewComponent _owner )
225 _this.dbcellrenderer = this;
226 this.el = new Gtk.CellRendererText();
230 // set gobject values
233 // user defined functions
236 public class Xcls_dbmodel : Object
238 public Gtk.ListStore el;
239 private Xcls_DialogNewComponent _this;
245 public Xcls_dbmodel(Xcls_DialogNewComponent _owner )
248 _this.dbmodel = this;
249 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
253 // set gobject values
256 // user defined functions
257 public void loadData (Gee.ArrayList<string> data, string cur) {
262 /// el.append(out iter);
265 // el.set_value(iter, 0, "");
266 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
271 el.set_value(iter, 0, "");
272 el.set_value(iter, 1, "-- select a module --");
273 _this.build_module.el.set_active_iter(iter);
275 for (var i = 0; i < data.size;i++) {
280 el.set_value(iter, 0, data.get(i));
281 el.set_value(iter, 1, data.get(i));
283 if (data.get(i) == cur) {
284 _this.build_module.el.set_active_iter(iter);
288 this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
294 public class Xcls_Label8 : Object
297 private Xcls_DialogNewComponent _this;
303 public Xcls_Label8(Xcls_DialogNewComponent _owner )
306 this.el = new Gtk.Label( "Component Name" );
310 // set gobject values
311 this.el.justify = Gtk.Justification.RIGHT;
312 this.el.xalign = 0.900000f;
315 // user defined functions
318 public class Xcls_name : Object
321 private Xcls_DialogNewComponent _this;
327 public Xcls_name(Xcls_DialogNewComponent _owner )
331 this.el = new Gtk.Entry();
335 // set gobject values
336 this.el.visible = true;
339 // user defined functions
344 public class Xcls_Button10 : Object
346 public Gtk.Button el;
347 private Xcls_DialogNewComponent _this;
353 public Xcls_Button10(Xcls_DialogNewComponent _owner )
356 this.el = new Gtk.Button();
360 // set gobject values
361 this.el.label = "Cancel";
364 // user defined functions
367 public class Xcls_Button11 : Object
369 public Gtk.Button el;
370 private Xcls_DialogNewComponent _this;
376 public Xcls_Button11(Xcls_DialogNewComponent _owner )
379 this.el = new Gtk.Button();
383 // set gobject values
384 this.el.label = "OK";
387 // user defined functions