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_name name;
16 public Xcls_build_module build_module;
17 public Xcls_dbcellrenderer dbcellrenderer;
18 public Xcls_dbmodel dbmodel;
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,0,1 );
143 var child_1 = new Xcls_name( _this );
145 this.el.attach_defaults ( child_1.el , 1,2,0,1 );
146 var child_2 = new Xcls_Label6( _this );
148 this.el.attach_defaults ( child_2.el , 0,1,6,7 );
149 var child_3 = new Xcls_build_module( _this );
151 this.el.attach_defaults ( child_3.el , 1,2,6,7 );
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( "Component Name" );
172 // set gobject values
173 this.el.justify = Gtk.Justification.RIGHT;
174 this.el.xalign = 0.900000f;
177 // user defined functions
180 public class Xcls_name : Object
183 private Xcls_DialogNewComponent _this;
189 public Xcls_name(Xcls_DialogNewComponent _owner )
193 this.el = new Gtk.Entry();
197 // set gobject values
198 this.el.visible = true;
201 // user defined functions
204 public class Xcls_Label6 : Object
207 private Xcls_DialogNewComponent _this;
213 public Xcls_Label6(Xcls_DialogNewComponent _owner )
216 this.el = new Gtk.Label( "Module to build (Vala only)" );
220 // set gobject values
221 this.el.justify = Gtk.Justification.RIGHT;
222 this.el.xalign = 0.900000f;
223 this.el.visible = true;
226 // user defined functions
229 public class Xcls_build_module : Object
231 public Gtk.ComboBox el;
232 private Xcls_DialogNewComponent _this;
238 public Xcls_build_module(Xcls_DialogNewComponent _owner )
241 _this.build_module = this;
242 this.el = new Gtk.ComboBox();
246 // set gobject values
247 var child_0 = new Xcls_dbcellrenderer( _this );
249 this.el.pack_start ( child_0.el , true );
250 var child_1 = new Xcls_dbmodel( _this );
252 this.el.set_model ( child_1.el );
256 this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
259 // user defined functions
261 public class Xcls_dbcellrenderer : Object
263 public Gtk.CellRendererText el;
264 private Xcls_DialogNewComponent _this;
270 public Xcls_dbcellrenderer(Xcls_DialogNewComponent _owner )
273 _this.dbcellrenderer = this;
274 this.el = new Gtk.CellRendererText();
278 // set gobject values
281 // user defined functions
284 public class Xcls_dbmodel : Object
286 public Gtk.ListStore el;
287 private Xcls_DialogNewComponent _this;
293 public Xcls_dbmodel(Xcls_DialogNewComponent _owner )
296 _this.dbmodel = this;
297 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
301 // set gobject values
304 // user defined functions
305 public void loadData (Gee.ArrayList<string> data, string cur) {
310 /// el.append(out iter);
313 // el.set_value(iter, 0, "");
314 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
319 el.set_value(iter, 0, "");
320 el.set_value(iter, 1, "-- select a module --");
321 _this.build_module.el.set_active_iter(iter);
323 for (var i = 0; i < data.size;i++) {
328 el.set_value(iter, 0, data.get(i));
329 el.set_value(iter, 1, data.get(i));
331 if (data.get(i) == cur) {
332 _this.build_module.el.set_active_iter(iter);
336 this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
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