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        if (reset) {
61                 var buf = (Gtk.SourceBuffer)this.sourceview.el.get_buffer();
62                 buf.set_text("",0);
63         }
64        
65         while(Gtk.events_pending()) { 
66                 Gtk.main_iteration();
67         }
68         
69         
70         
71     }
72     public void addLine (string str) {
73         var buf = (Gtk.SourceBuffer)this.sourceview.el.get_buffer();
74         TextIter iter;
75         buf.get_end_iter (out  iter);
76         buf.insert(ref iter, str, str.length);
77         /// scroll..
78         
79     
80     }
81     public class Xcls_compile_view : Object
82     {
83         public Gtk.Box el;
84         private Xcls_ValaCompileResults  _this;
85
86
87             // my vars (def)
88
89         // ctor
90         public Xcls_compile_view(Xcls_ValaCompileResults _owner )
91         {
92             _this = _owner;
93             _this.compile_view = this;
94             this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
95
96             // my vars (dec)
97
98             // set gobject values
99             this.el.homogeneous = false;
100             var child_0 = new Xcls_ScrolledWindow3( _this );
101             child_0.ref();
102             this.el.pack_end (  child_0.el , true,true,0 );
103         }
104
105         // user defined functions
106     }
107     public class Xcls_ScrolledWindow3 : Object
108     {
109         public Gtk.ScrolledWindow el;
110         private Xcls_ValaCompileResults  _this;
111
112
113             // my vars (def)
114
115         // ctor
116         public Xcls_ScrolledWindow3(Xcls_ValaCompileResults _owner )
117         {
118             _this = _owner;
119             this.el = new Gtk.ScrolledWindow( null, null );
120
121             // my vars (dec)
122
123             // set gobject values
124             this.el.hexpand = true;
125             var child_0 = new Xcls_sourceview( _this );
126             child_0.ref();
127             this.el.add (  child_0.el  );
128
129             // init method
130
131             {
132              this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
133              
134             
135             }
136         }
137
138         // user defined functions
139     }
140     public class Xcls_sourceview : Object
141     {
142         public Gtk.SourceView el;
143         private Xcls_ValaCompileResults  _this;
144
145
146             // my vars (def)
147
148         // ctor
149         public Xcls_sourceview(Xcls_ValaCompileResults _owner )
150         {
151             _this = _owner;
152             _this.sourceview = this;
153             this.el = new Gtk.SourceView();
154
155             // my vars (dec)
156
157             // set gobject values
158             this.el.editable = false;
159             this.el.show_line_numbers = true;
160
161             // init method
162
163             {
164             
165                 var description =   Pango.FontDescription.from_string("monospace");
166                 description.set_size(8000);
167                 this.el.override_font(description);
168             
169             
170             }
171         }
172
173         // user defined functions
174     }
175
176
177
178 }