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