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_title title;
17 public Xcls_region region;
18 public Xcls_parent parent;
19 public Xcls_permname permname;
20 public Xcls_modOrder modOrder;
21 public Xcls_build_module build_module;
22 public Xcls_dbcellrenderer dbcellrenderer;
23 public Xcls_dbmodel dbmodel;
28 public Xcls_DialogNewComponent()
31 this.el = new Gtk.Dialog();
36 this.el.title = "New Component";
37 this.el.default_height = 200;
38 this.el.default_width = 500;
39 this.el.deletable = true;
41 var child_0 = new Xcls_VBox2( _this );
43 this.el.get_content_area().add ( child_0.el );
44 var child_1 = new Xcls_Button20( _this );
46 this.el.add_action_widget ( child_1.el , 0 );
47 var child_2 = new Xcls_Button21( _this );
49 this.el.add_action_widget ( child_2.el , 1 );
52 this.el.delete_event.connect( (self, event) => {
57 this.el.response.connect( (self, response_id) => {
61 this.el.show.connect( (self) => {
67 // user defined functions
68 public void updateFileFromEntry () {
70 _this.file.title = _this.title.el.get_text();
71 _this.file.region = _this.region.el.get_text();
72 _this.file.parent = _this.parent.el.get_text();
73 _this.file.permname = _this.permname.el.get_text();
74 _this.file.modOrder = _this.modOrder.el.get_text();
76 if (_this.file.name.length > 0 && _this.file.name != _this.name.el.get_text()) {
77 _this.file.renameTo(_this.name.el.get_text());
79 // store the module...
80 _this.file.build_module = "";
82 if (_this.build_module.el.get_active_iter (out iter)) {
84 this.dbmodel.el.get_value (iter, 0, out vfname);
85 if (((string)vfname).length > 0) {
86 _this.file.build_module = (string)vfname;
99 //this.success = c.success;
103 public class Xcls_VBox2 : Object
106 private Xcls_DialogNewComponent _this;
112 public Xcls_VBox2(Xcls_DialogNewComponent _owner )
115 this.el = new Gtk.VBox( true, 0 );
119 // set gobject values
120 var child_0 = new Xcls_Table3( _this );
122 this.el.pack_start ( child_0.el , false,false,0 );
125 // user defined functions
127 public class Xcls_Table3 : Object
130 private Xcls_DialogNewComponent _this;
136 public Xcls_Table3(Xcls_DialogNewComponent _owner )
139 this.el = new Gtk.Table( 3, 2, true );
143 // set gobject values
144 var child_0 = new Xcls_Label4( _this );
146 this.el.attach_defaults ( child_0.el , 0,1,0,1 );
147 var child_1 = new Xcls_name( _this );
149 this.el.attach_defaults ( child_1.el , 1,2,0,1 );
150 var child_2 = new Xcls_Label6( _this );
152 this.el.attach_defaults ( child_2.el , 0,1,1,2 );
153 var child_3 = new Xcls_title( _this );
155 this.el.attach_defaults ( child_3.el , 1,2,1,2 );
156 var child_4 = new Xcls_Label8( _this );
158 this.el.attach_defaults ( child_4.el , 0,1,2,3 );
159 var child_5 = new Xcls_region( _this );
161 this.el.attach_defaults ( child_5.el , 1,2,2,3 );
162 var child_6 = new Xcls_Label10( _this );
164 this.el.attach_defaults ( child_6.el , 0,1,3,4 );
165 var child_7 = new Xcls_parent( _this );
167 this.el.attach_defaults ( child_7.el , 1,2,3,4 );
168 var child_8 = new Xcls_Label12( _this );
170 this.el.attach_defaults ( child_8.el , 0,1,4,5 );
171 var child_9 = new Xcls_permname( _this );
173 this.el.attach_defaults ( child_9.el , 1,2,4,5 );
174 var child_10 = new Xcls_Label14( _this );
176 this.el.attach_defaults ( child_10.el , 0,1,5,6 );
177 var child_11 = new Xcls_modOrder( _this );
179 this.el.attach_defaults ( child_11.el , 1,2,5,6 );
180 var child_12 = new Xcls_Label16( _this );
182 this.el.attach_defaults ( child_12.el , 0,1,6,7 );
183 var child_13 = new Xcls_build_module( _this );
185 this.el.attach_defaults ( child_13.el , 1,2,6,7 );
188 // user defined functions
190 public class Xcls_Label4 : Object
193 private Xcls_DialogNewComponent _this;
199 public Xcls_Label4(Xcls_DialogNewComponent _owner )
202 this.el = new Gtk.Label( "Component Name" );
206 // set gobject values
207 this.el.justify = Gtk.Justification.RIGHT;
208 this.el.xalign = 0.900000f;
211 // user defined functions
214 public class Xcls_name : Object
217 private Xcls_DialogNewComponent _this;
223 public Xcls_name(Xcls_DialogNewComponent _owner )
227 this.el = new Gtk.Entry();
231 // set gobject values
232 this.el.visible = true;
235 // user defined functions
238 public class Xcls_Label6 : Object
241 private Xcls_DialogNewComponent _this;
247 public Xcls_Label6(Xcls_DialogNewComponent _owner )
250 this.el = new Gtk.Label( "Title" );
254 // set gobject values
255 this.el.justify = Gtk.Justification.RIGHT;
256 this.el.xalign = 0.900000f;
257 this.el.visible = true;
260 // user defined functions
263 public class Xcls_title : Object
266 private Xcls_DialogNewComponent _this;
272 public Xcls_title(Xcls_DialogNewComponent _owner )
276 this.el = new Gtk.Entry();
280 // set gobject values
281 this.el.visible = true;
284 // user defined functions
287 public class Xcls_Label8 : Object
290 private Xcls_DialogNewComponent _this;
296 public Xcls_Label8(Xcls_DialogNewComponent _owner )
299 this.el = new Gtk.Label( "Region" );
303 // set gobject values
304 this.el.justify = Gtk.Justification.RIGHT;
305 this.el.xalign = 0.900000f;
306 this.el.tooltip_text = "center, north, south, east, west";
307 this.el.visible = true;
310 // user defined functions
313 public class Xcls_region : Object
316 private Xcls_DialogNewComponent _this;
322 public Xcls_region(Xcls_DialogNewComponent _owner )
326 this.el = new Gtk.Entry();
330 // set gobject values
331 this.el.visible = true;
334 // user defined functions
337 public class Xcls_Label10 : Object
340 private Xcls_DialogNewComponent _this;
346 public Xcls_Label10(Xcls_DialogNewComponent _owner )
349 this.el = new Gtk.Label( "Parent Name" );
353 // set gobject values
354 this.el.justify = Gtk.Justification.RIGHT;
355 this.el.xalign = 0.900000f;
356 this.el.visible = true;
359 // user defined functions
362 public class Xcls_parent : Object
365 private Xcls_DialogNewComponent _this;
371 public Xcls_parent(Xcls_DialogNewComponent _owner )
375 this.el = new Gtk.Entry();
379 // set gobject values
380 this.el.visible = true;
383 // user defined functions
386 public class Xcls_Label12 : Object
389 private Xcls_DialogNewComponent _this;
395 public Xcls_Label12(Xcls_DialogNewComponent _owner )
398 this.el = new Gtk.Label( "Permission Name" );
402 // set gobject values
403 this.el.justify = Gtk.Justification.RIGHT;
404 this.el.xalign = 0.900000f;
405 this.el.visible = true;
408 // user defined functions
411 public class Xcls_permname : Object
414 private Xcls_DialogNewComponent _this;
420 public Xcls_permname(Xcls_DialogNewComponent _owner )
423 _this.permname = this;
424 this.el = new Gtk.Entry();
428 // set gobject values
429 this.el.visible = true;
432 // user defined functions
435 public class Xcls_Label14 : Object
438 private Xcls_DialogNewComponent _this;
444 public Xcls_Label14(Xcls_DialogNewComponent _owner )
447 this.el = new Gtk.Label( "Order (for tabs)" );
451 // set gobject values
452 this.el.justify = Gtk.Justification.RIGHT;
453 this.el.xalign = 0.900000f;
454 this.el.visible = true;
457 // user defined functions
460 public class Xcls_modOrder : Object
463 private Xcls_DialogNewComponent _this;
469 public Xcls_modOrder(Xcls_DialogNewComponent _owner )
472 _this.modOrder = this;
473 this.el = new Gtk.Entry();
477 // set gobject values
478 this.el.visible = true;
481 // user defined functions
484 public class Xcls_Label16 : Object
487 private Xcls_DialogNewComponent _this;
493 public Xcls_Label16(Xcls_DialogNewComponent _owner )
496 this.el = new Gtk.Label( "Module to build (Vala only)" );
500 // set gobject values
501 this.el.justify = Gtk.Justification.RIGHT;
502 this.el.xalign = 0.900000f;
503 this.el.visible = true;
506 // user defined functions
509 public class Xcls_build_module : Object
511 public Gtk.ComboBox el;
512 private Xcls_DialogNewComponent _this;
518 public Xcls_build_module(Xcls_DialogNewComponent _owner )
521 _this.build_module = this;
522 this.el = new Gtk.ComboBox();
526 // set gobject values
527 var child_0 = new Xcls_dbcellrenderer( _this );
529 this.el.pack_start ( child_0.el , true );
530 var child_1 = new Xcls_dbmodel( _this );
532 this.el.set_model ( child_1.el );
536 this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
539 // user defined functions
541 public class Xcls_dbcellrenderer : Object
543 public Gtk.CellRendererText el;
544 private Xcls_DialogNewComponent _this;
550 public Xcls_dbcellrenderer(Xcls_DialogNewComponent _owner )
553 _this.dbcellrenderer = this;
554 this.el = new Gtk.CellRendererText();
558 // set gobject values
561 // user defined functions
564 public class Xcls_dbmodel : Object
566 public Gtk.ListStore el;
567 private Xcls_DialogNewComponent _this;
573 public Xcls_dbmodel(Xcls_DialogNewComponent _owner )
576 _this.dbmodel = this;
577 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
581 // set gobject values
584 // user defined functions
585 public void loadData (Gee.ArrayList<string> data, string cur) {
590 /// el.append(out iter);
593 // el.set_value(iter, 0, "");
594 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
599 el.set_value(iter, 0, "");
600 el.set_value(iter, 1, "-- select a module --");
601 _this.build_module.el.set_active_iter(iter);
603 for (var i = 0; i < data.size;i++) {
608 el.set_value(iter, 0, data.get(i));
609 el.set_value(iter, 1, data.get(i));
611 if (data.get(i) == cur) {
612 _this.build_module.el.set_active_iter(iter);
616 this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
624 public class Xcls_Button20 : Object
626 public Gtk.Button el;
627 private Xcls_DialogNewComponent _this;
633 public Xcls_Button20(Xcls_DialogNewComponent _owner )
636 this.el = new Gtk.Button();
640 // set gobject values
641 this.el.label = "Cancel";
644 // user defined functions
647 public class Xcls_Button21 : Object
649 public Gtk.Button el;
650 private Xcls_DialogNewComponent _this;
656 public Xcls_Button21(Xcls_DialogNewComponent _owner )
659 this.el = new Gtk.Button();
663 // set gobject values
664 this.el.label = "OK";
667 // user defined functions