2 valac --pkg gio-2.0 --pkg posix --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0 --pkg libwnck-3.0 \
3 /tmp/DialogNewComponent.vala -o /tmp/DialogNewComponent
8 static int main (string[] args) {
10 new Xcls_DialogNewComponent();
11 DialogNewComponent.show_all();
18 public static Xcls_DialogNewComponent DialogNewComponent;
20 public class Xcls_DialogNewComponent
23 private static Xcls_DialogNewComponent _this;
25 public Xcls_name name;
26 public Xcls_title title;
27 public Xcls_region region;
28 public Xcls_parent parent;
29 public Xcls_permname permname;
30 public Xcls_modOrder modOrder;
35 public Xcls_DialogNewComponent()
37 this.el = new Gtk.Dialog();
39 DialogNewComponent = this;
44 this.el.default_height = 200;
45 this.el.default_width = 500;
46 this.el.deletable = false;
48 this.el.title = "New Component";
49 var child_0 = new Xcls_VBox2();
50 this.el.add ( child_0.el );
51 var child_1 = new Xcls_Button16();
52 this.el.add_action_widget ( child_1.el , 0 );
53 var child_2 = new Xcls_Button17();
54 this.el.add_action_widget ( child_2.el , 1 );
57 this.el.delete_event.connect( (self, event) => {
61 this.el.response.connect( (self, response_id) => {
62 if (response_id < 1) { // cancel!
67 if (DialogNewComponent.name.el.get_text().length < 1) {
68 StandardErrorDialog.show(
69 "You haDe to set Project name "
74 var isNew = this.file.name.length > 0 ? false : true;
76 if (this.file.name.length > 0 && this.file.name != _this.name.el.get_text()) {
77 StandardErrorDialog.show(
78 "Sorry changing names does not work yet. "
83 // FIXME - this may be more complicated...
84 //for (var i in this.def) {
85 // this.file[i] = this.get(i).el.get_text();
97 //for (var i in this.project.paths) {
105 if (GLib.file_test (GLib.dir + "/" + this.file.name + ".bjs", GLib.FileTest.EXISTS)) {
106 StandardErrorDialog.show(
107 "That file already exists"
114 //var tmpl = this.project.loadFileOnly(DialogNewComponent.get('template').getValue());
116 var nf = _this.project.create(dir + "/" + this.file.name + ".bjs");
117 //for (var i in this.file) {
118 // nf[i] = this.file[i];
121 if (DialogNewComponent.success != null) {
122 DialogNewComponent.success(_this.project, nf);
125 this.el.show.connect( (self) => {
130 // userdefined functions
132 // skip listeners - not pipe
134 // skip default_height - already used
136 // skip default_width - already used
138 // skip id - not pipe
140 // skip title - already used
142 // skip xtype - not pipe
144 // skip |deletable - already used
146 // skip |modal - already used
148 // skip |show - could not find seperator
150 // skip |xns - could not find seperator
152 // skip items - not pipe
154 // skip xvala_cls - not pipe
156 // skip xvala_xcls - not pipe
158 // skip xvala_id - not pipe
159 public class Xcls_VBox2
168 this.el = new Gtk.VBox( true, 0 );
172 // set gobject values
173 var child_0 = new Xcls_Table3();
174 this.el.pack_start ( child_0.el , false,false,0 );
177 // userdefined functions
179 // skip |xns - could not find seperator
181 // skip xtype - not pipe
183 // skip |pack - already used
185 // skip items - not pipe
187 // skip xvala_cls - not pipe
189 // skip xvala_xcls - not pipe
191 // skip xvala_id - not pipe
193 public class Xcls_Table3
202 this.el = new Gtk.Table();
206 // set gobject values
207 this.el.homogeneous = false;
208 this.el.n_columns = 2;
210 var child_0 = new Xcls_Label4();
211 this.el.add ( child_0.el );
212 var child_1 = new Xcls_name();
213 this.el.add ( child_1.el );
214 var child_2 = new Xcls_Label6();
215 this.el.add ( child_2.el );
216 var child_3 = new Xcls_title();
217 this.el.add ( child_3.el );
218 var child_4 = new Xcls_Label8();
219 this.el.add ( child_4.el );
220 var child_5 = new Xcls_region();
221 this.el.add ( child_5.el );
222 var child_6 = new Xcls_Label10();
223 this.el.add ( child_6.el );
224 var child_7 = new Xcls_parent();
225 this.el.add ( child_7.el );
226 var child_8 = new Xcls_Label12();
227 this.el.add ( child_8.el );
228 var child_9 = new Xcls_permname();
229 this.el.add ( child_9.el );
230 var child_10 = new Xcls_Label14();
231 this.el.add ( child_10.el );
232 var child_11 = new Xcls_modOrder();
233 this.el.add ( child_11.el );
236 // userdefined functions
238 // skip n_columns - already used
240 // skip n_rows - already used
242 // skip pack - not pipe
244 // skip xtype - not pipe
246 // skip |homogeneous - already used
248 // skip |xns - could not find seperator
250 // skip items - not pipe
252 // skip xvala_cls - not pipe
254 // skip xvala_xcls - not pipe
256 // skip xvala_id - not pipe
258 public class Xcls_Label4
267 this.el = new Gtk.Label();
271 // set gobject values
272 this.el.justify = Gtk.Justification.RIGHT;
273 this.el.label = "Component Name";
274 this.el.xalign = 0.9;
277 // userdefined functions
279 // skip label - already used
281 // skip pack - not pipe
283 // skip x_options - not pipe
285 // skip xalign - already used
287 // skip xtype - not pipe
289 // skip |justify - already used
291 // skip |xns - could not find seperator
293 // skip xvala_cls - not pipe
295 // skip xvala_xcls - not pipe
297 // skip xvala_id - not pipe
299 public class Xcls_name
308 this.el = new Gtk.Entry();
313 // set gobject values
314 this.el.visible = true;
317 // userdefined functions
319 // skip id - not pipe
321 // skip pack - not pipe
323 // skip xtype - not pipe
325 // skip |visible - already used
327 // skip |xns - could not find seperator
329 // skip xvala_cls - not pipe
331 // skip xvala_xcls - not pipe
333 // skip xvala_id - not pipe
335 public class Xcls_Label6
344 this.el = new Gtk.Label();
348 // set gobject values
349 this.el.justify = Gtk.Justification.RIGHT;
350 this.el.label = "Title";
351 this.el.visible = true;
352 this.el.xalign = 0.9;
355 // userdefined functions
357 // skip label - already used
359 // skip pack - not pipe
361 // skip x_options - not pipe
363 // skip xalign - already used
365 // skip xtype - not pipe
367 // skip |justify - already used
369 // skip |visible - already used
371 // skip |xns - could not find seperator
373 // skip xvala_cls - not pipe
375 // skip xvala_xcls - not pipe
377 // skip xvala_id - not pipe
379 public class Xcls_title
388 this.el = new Gtk.Entry();
393 // set gobject values
394 this.el.visible = true;
397 // userdefined functions
399 // skip id - not pipe
401 // skip pack - not pipe
403 // skip xtype - not pipe
405 // skip |visible - already used
407 // skip |xns - could not find seperator
409 // skip xvala_cls - not pipe
411 // skip xvala_xcls - not pipe
413 // skip xvala_id - not pipe
415 public class Xcls_Label8
424 this.el = new Gtk.Label();
428 // set gobject values
429 this.el.justify = Gtk.Justification.RIGHT;
430 this.el.label = "Region";
431 this.el.tooltip_text = "center, north, south, east, west";
432 this.el.visible = true;
433 this.el.xalign = 0.9;
436 // userdefined functions
438 // skip label - already used
440 // skip pack - not pipe
442 // skip tooltip_text - already used
444 // skip x_options - not pipe
446 // skip xalign - already used
448 // skip xtype - not pipe
450 // skip |justify - already used
452 // skip |visible - already used
454 // skip |xns - could not find seperator
456 // skip xvala_cls - not pipe
458 // skip xvala_xcls - not pipe
460 // skip xvala_id - not pipe
462 public class Xcls_region
471 this.el = new Gtk.Entry();
476 // set gobject values
477 this.el.visible = true;
480 // userdefined functions
482 // skip id - not pipe
484 // skip pack - not pipe
486 // skip xtype - not pipe
488 // skip |visible - already used
490 // skip |xns - could not find seperator
492 // skip xvala_cls - not pipe
494 // skip xvala_xcls - not pipe
496 // skip xvala_id - not pipe
498 public class Xcls_Label10
505 public Xcls_Label10()
507 this.el = new Gtk.Label();
511 // set gobject values
512 this.el.justify = Gtk.Justification.RIGHT;
513 this.el.label = "Parent Name";
514 this.el.visible = true;
515 this.el.xalign = 0.9;
518 // userdefined functions
520 // skip label - already used
522 // skip pack - not pipe
524 // skip x_options - not pipe
526 // skip xalign - already used
528 // skip xtype - not pipe
530 // skip |justify - already used
532 // skip |visible - already used
534 // skip |xns - could not find seperator
536 // skip xvala_cls - not pipe
538 // skip xvala_xcls - not pipe
540 // skip xvala_id - not pipe
542 public class Xcls_parent
551 this.el = new Gtk.Entry();
556 // set gobject values
557 this.el.visible = true;
560 // userdefined functions
562 // skip id - not pipe
564 // skip pack - not pipe
566 // skip xtype - not pipe
568 // skip |visible - already used
570 // skip |xns - could not find seperator
572 // skip xvala_cls - not pipe
574 // skip xvala_xcls - not pipe
576 // skip xvala_id - not pipe
578 public class Xcls_Label12
585 public Xcls_Label12()
587 this.el = new Gtk.Label();
591 // set gobject values
592 this.el.justify = Gtk.Justification.RIGHT;
593 this.el.label = "Permission Name";
594 this.el.visible = true;
595 this.el.xalign = 0.9;
598 // userdefined functions
600 // skip label - already used
602 // skip pack - not pipe
604 // skip x_options - not pipe
606 // skip xalign - already used
608 // skip xtype - not pipe
610 // skip |justify - already used
612 // skip |visible - already used
614 // skip |xns - could not find seperator
616 // skip xvala_cls - not pipe
618 // skip xvala_xcls - not pipe
620 // skip xvala_id - not pipe
622 public class Xcls_permname
629 public Xcls_permname()
631 this.el = new Gtk.Entry();
632 _this.permname = this;
636 // set gobject values
637 this.el.visible = true;
640 // userdefined functions
642 // skip id - not pipe
644 // skip pack - not pipe
646 // skip xtype - not pipe
648 // skip |visible - already used
650 // skip |xns - could not find seperator
652 // skip xvala_cls - not pipe
654 // skip xvala_xcls - not pipe
656 // skip xvala_id - not pipe
658 public class Xcls_Label14
665 public Xcls_Label14()
667 this.el = new Gtk.Label();
671 // set gobject values
672 this.el.justify = Gtk.Justification.RIGHT;
673 this.el.label = "Order (for tabs)";
674 this.el.visible = true;
675 this.el.xalign = 0.9;
678 // userdefined functions
680 // skip label - already used
682 // skip pack - not pipe
684 // skip x_options - not pipe
686 // skip xalign - already used
688 // skip xtype - not pipe
690 // skip |justify - already used
692 // skip |visible - already used
694 // skip |xns - could not find seperator
696 // skip xvala_cls - not pipe
698 // skip xvala_xcls - not pipe
700 // skip xvala_id - not pipe
702 public class Xcls_modOrder
709 public Xcls_modOrder()
711 this.el = new Gtk.Entry();
712 _this.modOrder = this;
716 // set gobject values
717 this.el.visible = true;
720 // userdefined functions
722 // skip id - not pipe
724 // skip pack - not pipe
726 // skip xtype - not pipe
728 // skip |visible - already used
730 // skip |xns - could not find seperator
732 // skip xvala_cls - not pipe
734 // skip xvala_xcls - not pipe
736 // skip xvala_id - not pipe
738 public class Xcls_Button16
740 public Gtk.Button el;
745 public Xcls_Button16()
747 this.el = new Gtk.Button();
751 // set gobject values
752 this.el.label = "Cancel";
755 // userdefined functions
757 // skip |xns - could not find seperator
759 // skip xtype - not pipe
761 // skip pack - not pipe
763 // skip label - already used
765 // skip xvala_cls - not pipe
767 // skip xvala_xcls - not pipe
769 // skip xvala_id - not pipe
771 public class Xcls_Button17
773 public Gtk.Button el;
778 public Xcls_Button17()
780 this.el = new Gtk.Button();
784 // set gobject values
785 this.el.label = "OK";
788 // userdefined functions
790 // skip |xns - could not find seperator
792 // skip xtype - not pipe
794 // skip pack - not pipe
796 // skip label - already used
798 // skip xvala_cls - not pipe
800 // skip xvala_xcls - not pipe
802 // skip xvala_id - not pipe