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