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;
26 public signal void success (Project.Project pr, JsRender.JsRender file);
29 public Xcls_DialogNewComponent()
32 this.el = new Gtk.Dialog();
37 this.el.title = "New Component";
38 this.el.default_height = 200;
39 this.el.default_width = 500;
40 this.el.deletable = true;
42 var child_0 = new Xcls_VBox2( _this );
44 this.el.get_content_area().add ( child_0.el );
45 var child_1 = new Xcls_Button20( _this );
47 this.el.add_action_widget ( child_1.el , 0 );
48 var child_2 = new Xcls_Button21( _this );
50 this.el.add_action_widget ( child_2.el , 1 );
53 this.el.delete_event.connect( (self, event) => {
58 this.el.response.connect( (self, response_id) => {
62 this.el.show.connect( (self) => {
68 // user defined functions
69 public void updateFileFromEntry () {
71 _this.file.title = _this.title.el.get_text();
72 _this.file.region = _this.region.el.get_text();
73 _this.file.parent = _this.parent.el.get_text();
74 _this.file.permname = _this.permname.el.get_text();
75 _this.file.modOrder = _this.modOrder.el.get_text();
77 if (_this.file.name.length > 0 && _this.file.name != _this.name.el.get_text()) {
78 _this.file.renameTo(_this.name.el.get_text());
80 // store the module...
81 _this.file.build_module = "";
83 if (_this.build_module.el.get_active_iter (out iter)) {
85 this.dbmodel.el.get_value (iter, 0, out vfname);
86 if (((string)vfname).length > 0) {
87 _this.file.build_module = (string)vfname;
100 //this.success = c.success;
104 public class Xcls_VBox2 : Object
107 private Xcls_DialogNewComponent _this;
113 public Xcls_VBox2(Xcls_DialogNewComponent _owner )
116 this.el = new Gtk.VBox( true, 0 );
120 // set gobject values
121 var child_0 = new Xcls_Table3( _this );
123 this.el.pack_start ( child_0.el , false,false,0 );
126 // user defined functions
128 public class Xcls_Table3 : Object
131 private Xcls_DialogNewComponent _this;
137 public Xcls_Table3(Xcls_DialogNewComponent _owner )
140 this.el = new Gtk.Table( 3, 2, true );
144 // set gobject values
145 var child_0 = new Xcls_Label4( _this );
147 this.el.attach_defaults ( child_0.el , 0,1,0,1 );
148 var child_1 = new Xcls_name( _this );
150 this.el.attach_defaults ( child_1.el , 1,2,0,1 );
151 var child_2 = new Xcls_Label6( _this );
153 this.el.attach_defaults ( child_2.el , 0,1,1,2 );
154 var child_3 = new Xcls_title( _this );
156 this.el.attach_defaults ( child_3.el , 1,2,1,2 );
157 var child_4 = new Xcls_Label8( _this );
159 this.el.attach_defaults ( child_4.el , 0,1,2,3 );
160 var child_5 = new Xcls_region( _this );
162 this.el.attach_defaults ( child_5.el , 1,2,2,3 );
163 var child_6 = new Xcls_Label10( _this );
165 this.el.attach_defaults ( child_6.el , 0,1,3,4 );
166 var child_7 = new Xcls_parent( _this );
168 this.el.attach_defaults ( child_7.el , 1,2,3,4 );
169 var child_8 = new Xcls_Label12( _this );
171 this.el.attach_defaults ( child_8.el , 0,1,4,5 );
172 var child_9 = new Xcls_permname( _this );
174 this.el.attach_defaults ( child_9.el , 1,2,4,5 );
175 var child_10 = new Xcls_Label14( _this );
177 this.el.attach_defaults ( child_10.el , 0,1,5,6 );
178 var child_11 = new Xcls_modOrder( _this );
180 this.el.attach_defaults ( child_11.el , 1,2,5,6 );
181 var child_12 = new Xcls_Label16( _this );
183 this.el.attach_defaults ( child_12.el , 0,1,6,7 );
184 var child_13 = new Xcls_build_module( _this );
186 this.el.attach_defaults ( child_13.el , 1,2,6,7 );
189 // user defined functions
191 public class Xcls_Label4 : Object
194 private Xcls_DialogNewComponent _this;
200 public Xcls_Label4(Xcls_DialogNewComponent _owner )
203 this.el = new Gtk.Label( "Component Name" );
207 // set gobject values
208 this.el.justify = Gtk.Justification.RIGHT;
209 this.el.xalign = 0.900000f;
212 // user defined functions
215 public class Xcls_name : Object
218 private Xcls_DialogNewComponent _this;
224 public Xcls_name(Xcls_DialogNewComponent _owner )
228 this.el = new Gtk.Entry();
232 // set gobject values
233 this.el.visible = true;
236 // user defined functions
239 public class Xcls_Label6 : Object
242 private Xcls_DialogNewComponent _this;
248 public Xcls_Label6(Xcls_DialogNewComponent _owner )
251 this.el = new Gtk.Label( "Title" );
255 // set gobject values
256 this.el.justify = Gtk.Justification.RIGHT;
257 this.el.xalign = 0.900000f;
258 this.el.visible = true;
261 // user defined functions
264 public class Xcls_title : Object
267 private Xcls_DialogNewComponent _this;
273 public Xcls_title(Xcls_DialogNewComponent _owner )
277 this.el = new Gtk.Entry();
281 // set gobject values
282 this.el.visible = true;
285 // user defined functions
288 public class Xcls_Label8 : Object
291 private Xcls_DialogNewComponent _this;
297 public Xcls_Label8(Xcls_DialogNewComponent _owner )
300 this.el = new Gtk.Label( "Region" );
304 // set gobject values
305 this.el.justify = Gtk.Justification.RIGHT;
306 this.el.xalign = 0.900000f;
307 this.el.tooltip_text = "center, north, south, east, west";
308 this.el.visible = true;
311 // user defined functions
314 public class Xcls_region : Object
317 private Xcls_DialogNewComponent _this;
323 public Xcls_region(Xcls_DialogNewComponent _owner )
327 this.el = new Gtk.Entry();
331 // set gobject values
332 this.el.visible = true;
335 // user defined functions
338 public class Xcls_Label10 : Object
341 private Xcls_DialogNewComponent _this;
347 public Xcls_Label10(Xcls_DialogNewComponent _owner )
350 this.el = new Gtk.Label( "Parent Name" );
354 // set gobject values
355 this.el.justify = Gtk.Justification.RIGHT;
356 this.el.xalign = 0.900000f;
357 this.el.visible = true;
360 // user defined functions
363 public class Xcls_parent : Object
366 private Xcls_DialogNewComponent _this;
372 public Xcls_parent(Xcls_DialogNewComponent _owner )
376 this.el = new Gtk.Entry();
380 // set gobject values
381 this.el.visible = true;
384 // user defined functions
387 public class Xcls_Label12 : Object
390 private Xcls_DialogNewComponent _this;
396 public Xcls_Label12(Xcls_DialogNewComponent _owner )
399 this.el = new Gtk.Label( "Permission Name" );
403 // set gobject values
404 this.el.justify = Gtk.Justification.RIGHT;
405 this.el.xalign = 0.900000f;
406 this.el.visible = true;
409 // user defined functions
412 public class Xcls_permname : Object
415 private Xcls_DialogNewComponent _this;
421 public Xcls_permname(Xcls_DialogNewComponent _owner )
424 _this.permname = this;
425 this.el = new Gtk.Entry();
429 // set gobject values
430 this.el.visible = true;
433 // user defined functions
436 public class Xcls_Label14 : Object
439 private Xcls_DialogNewComponent _this;
445 public Xcls_Label14(Xcls_DialogNewComponent _owner )
448 this.el = new Gtk.Label( "Order (for tabs)" );
452 // set gobject values
453 this.el.justify = Gtk.Justification.RIGHT;
454 this.el.xalign = 0.900000f;
455 this.el.visible = true;
458 // user defined functions
461 public class Xcls_modOrder : Object
464 private Xcls_DialogNewComponent _this;
470 public Xcls_modOrder(Xcls_DialogNewComponent _owner )
473 _this.modOrder = this;
474 this.el = new Gtk.Entry();
478 // set gobject values
479 this.el.visible = true;
482 // user defined functions
485 public class Xcls_Label16 : Object
488 private Xcls_DialogNewComponent _this;
494 public Xcls_Label16(Xcls_DialogNewComponent _owner )
497 this.el = new Gtk.Label( "Module to build (Vala only)" );
501 // set gobject values
502 this.el.justify = Gtk.Justification.RIGHT;
503 this.el.xalign = 0.900000f;
504 this.el.visible = true;
507 // user defined functions
510 public class Xcls_build_module : Object
512 public Gtk.ComboBox el;
513 private Xcls_DialogNewComponent _this;
519 public Xcls_build_module(Xcls_DialogNewComponent _owner )
522 _this.build_module = this;
523 this.el = new Gtk.ComboBox();
527 // set gobject values
528 var child_0 = new Xcls_dbcellrenderer( _this );
530 this.el.pack_start ( child_0.el , true );
531 var child_1 = new Xcls_dbmodel( _this );
533 this.el.set_model ( child_1.el );
537 this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
540 // user defined functions
542 public class Xcls_dbcellrenderer : Object
544 public Gtk.CellRendererText el;
545 private Xcls_DialogNewComponent _this;
551 public Xcls_dbcellrenderer(Xcls_DialogNewComponent _owner )
554 _this.dbcellrenderer = this;
555 this.el = new Gtk.CellRendererText();
559 // set gobject values
562 // user defined functions
565 public class Xcls_dbmodel : Object
567 public Gtk.ListStore el;
568 private Xcls_DialogNewComponent _this;
574 public Xcls_dbmodel(Xcls_DialogNewComponent _owner )
577 _this.dbmodel = this;
578 this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
582 // set gobject values
585 // user defined functions
586 public void loadData (Gee.ArrayList<string> data, string cur) {
591 /// el.append(out iter);
594 // el.set_value(iter, 0, "");
595 // el.set_value(iter, 1, "aaa - Just add Element - aaa");
600 el.set_value(iter, 0, "");
601 el.set_value(iter, 1, "-- select a module --");
602 _this.build_module.el.set_active_iter(iter);
604 for (var i = 0; i < data.size;i++) {
609 el.set_value(iter, 0, data.get(i));
610 el.set_value(iter, 1, data.get(i));
612 if (data.get(i) == cur) {
613 _this.build_module.el.set_active_iter(iter);
617 this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);
625 public class Xcls_Button20 : Object
627 public Gtk.Button el;
628 private Xcls_DialogNewComponent _this;
634 public Xcls_Button20(Xcls_DialogNewComponent _owner )
637 this.el = new Gtk.Button();
641 // set gobject values
642 this.el.label = "Cancel";
645 // user defined functions
648 public class Xcls_Button21 : Object
650 public Gtk.Button el;
651 private Xcls_DialogNewComponent _this;
657 public Xcls_Button21(Xcls_DialogNewComponent _owner )
660 this.el = new Gtk.Button();
664 // set gobject values
665 this.el.label = "OK";
668 // user defined functions