src/Builder4/ValaCompileResults.bjs
[app.Builder.js] / src / Builder4 / ValaCompileResults.vala
1 static Xcls_ValaCompileResults  _ValaCompileResults;
2
3 public class Xcls_ValaCompileResults : Object
4 {
5     public Gtk.Popover el;
6     private Xcls_ValaCompileResults  _this;
7
8     public static Xcls_ValaCompileResults singleton()
9     {
10         if (_ValaCompileResults == null) {
11             _ValaCompileResults= new Xcls_ValaCompileResults();
12         }
13         return _ValaCompileResults;
14     }
15     public Xcls_compile_view compile_view;
16     public Xcls_sourceview sourceview;
17
18         // my vars (def)
19     public Xcls_MainWindow window;
20     public bool active;
21
22     // ctor
23     public Xcls_ValaCompileResults()
24     {
25         _this = this;
26         this.el = new Gtk.Popover( null );
27
28         // my vars (dec)
29         this.active = false;
30
31         // set gobject values
32         this.el.width_request = 600;
33         this.el.height_request = 400;
34         this.el.modal = true;
35         this.el.position = Gtk.PositionType.TOP;
36         var child_0 = new Xcls_compile_view( _this );
37         child_0.ref();
38         this.el.add (  child_0.el  );
39     }
40
41     // user defined functions
42     public void show ( Gtk.Widget onbtn, bool reset) {
43         this.window.el.get_size(out w, out h);
44         
45         // left tree = 250, editor area = 500?
46         
47         var new_w = int.min(500, w-100);
48         if (new_w > (w-100)) {
49             new_w = w-100;
50         }
51         this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));
52      
53     
54         if (this.el.relative_to == null) {
55             this.el.set_relative_to(onbtn);
56         }
57         this.el.show_all();
58        // not sure why..
59        
60        
61        
62         while(Gtk.events_pending()) { 
63                 Gtk.main_iteration();
64         }
65         if (reset) {
66                 var buf = (Gtk.SourceBuffer)this.sourceview.el.get_buffer();
67                 buf.set_text("",0);
68         }
69         
70         
71     }
72     public class Xcls_compile_view : Object
73     {
74         public Gtk.Box el;
75         private Xcls_ValaCompileResults  _this;
76
77
78             // my vars (def)
79
80         // ctor
81         public Xcls_compile_view(Xcls_ValaCompileResults _owner )
82         {
83             _this = _owner;
84             _this.compile_view = this;
85             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
86
87             // my vars (dec)
88
89             // set gobject values
90             this.el.homogeneous = false;
91             var child_0 = new Xcls_ScrolledWindow3( _this );
92             child_0.ref();
93             this.el.pack_end (  child_0.el , true,true,0 );
94         }
95
96         // user defined functions
97     }
98     public class Xcls_ScrolledWindow3 : Object
99     {
100         public Gtk.ScrolledWindow el;
101         private Xcls_ValaCompileResults  _this;
102
103
104             // my vars (def)
105
106         // ctor
107         public Xcls_ScrolledWindow3(Xcls_ValaCompileResults _owner )
108         {
109             _this = _owner;
110             this.el = new Gtk.ScrolledWindow( null, null );
111
112             // my vars (dec)
113
114             // set gobject values
115             this.el.hexpand = true;
116             var child_0 = new Xcls_sourceview( _this );
117             child_0.ref();
118             this.el.add (  child_0.el  );
119
120             // init method
121
122             {
123              this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
124              
125             
126             }
127         }
128
129         // user defined functions
130     }
131     public class Xcls_sourceview : Object
132     {
133         public Gtk.SourceView el;
134         private Xcls_ValaCompileResults  _this;
135
136
137             // my vars (def)
138
139         // ctor
140         public Xcls_sourceview(Xcls_ValaCompileResults _owner )
141         {
142             _this = _owner;
143             _this.sourceview = this;
144             this.el = new Gtk.SourceView();
145
146             // my vars (dec)
147
148             // set gobject values
149             this.el.show_line_numbers = true;
150
151             // init method
152
153             {
154             
155                 var description =   Pango.FontDescription.from_string("monospace");
156                 description.set_size(8000);
157                 this.el.override_font(description);
158             
159             
160             }
161         }
162
163         // user defined functions
164     }
165
166
167
168 }