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