1 static Xcls_DialogPluginWebkit _DialogPluginWebkit;
3 public class Xcls_DialogPluginWebkit : Object
6 private Xcls_DialogPluginWebkit _this;
8 public static Xcls_DialogPluginWebkit singleton()
10 if (_DialogPluginWebkit == null) {
11 _DialogPluginWebkit= new Xcls_DialogPluginWebkit();
13 return _DialogPluginWebkit;
15 public Xcls_webview webview;
20 public Xcls_DialogPluginWebkit()
23 this.el = new Gtk.Dialog();
28 this.el.title = "Add / Edit Component";
29 this.el.default_height = 500;
30 this.el.default_width = 500;
31 this.el.deletable = true;
33 var child_0 = new Xcls_VBox2( _this );
35 this.el.get_content_area().add ( child_0.el );
36 var child_1 = new Xcls_Button5( _this );
38 this.el.add_action_widget ( child_1.el , 0 );
39 var child_2 = new Xcls_Button6( _this );
41 this.el.add_action_widget ( child_2.el , 1 );
44 this.el.delete_event.connect( (self, event) => {
51 // user defined functions
52 public string show (Gtk.Window ?parent, string text) {// JsRender.Node node) {
55 this.el.set_transient_for(parent);
59 _this.webview.el.load_html( text ,
60 //fixme - should be a config option!
61 // or should we catch stuff and fix it up..
62 "xhttp://localhost/app.Builder/"
69 var response_id = this.el.run();
70 if (response_id < 1) {
86 public class Xcls_VBox2 : Object
89 private Xcls_DialogPluginWebkit _this;
95 public Xcls_VBox2(Xcls_DialogPluginWebkit _owner )
98 this.el = new Gtk.VBox( false, 0 );
102 // set gobject values
103 var child_0 = new Xcls_ScrolledWindow3( _this );
105 this.el.pack_start ( child_0.el , false,true,3 );
108 // user defined functions
110 public class Xcls_ScrolledWindow3 : Object
112 public Gtk.ScrolledWindow el;
113 private Xcls_DialogPluginWebkit _this;
119 public Xcls_ScrolledWindow3(Xcls_DialogPluginWebkit _owner )
122 this.el = new Gtk.ScrolledWindow( null, null );
126 // set gobject values
127 this.el.expand = true;
128 var child_0 = new Xcls_webview( _this );
130 this.el.add ( child_0.el );
134 this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
137 // user defined functions
139 public class Xcls_webview : Object
141 public WebKit.WebView el;
142 private Xcls_DialogPluginWebkit _this;
148 public Xcls_webview(Xcls_DialogPluginWebkit _owner )
151 _this.webview = this;
152 this.el = new WebKit.WebView();
156 // set gobject values
161 // this may not work!?
162 var settings = this.el.get_settings();
165 //var fs= new FakeServer(this.el);
167 // this was an attempt to change the url perms.. did not work..
168 // settings.enable_file_access_from_file_uris = true;
169 // settings.enable_offline_web_application_cache - true;
170 // settings.enable_universal_access_from_file_uris = true;
177 // FIXME - base url of script..
178 // we need it so some of the database features work.
179 this.el.load_html( "Render not ready" ,
180 //fixme - should be a config option!
181 // or should we catch stuff and fix it up..
182 "xhttp://localhost/app.Builder/"
191 // user defined functions
193 public class Xcls_Button5 : Object
195 public Gtk.Button el;
196 private Xcls_DialogPluginWebkit _this;
202 public Xcls_Button5(Xcls_DialogPluginWebkit _owner )
205 this.el = new Gtk.Button();
209 // set gobject values
210 this.el.label = "Cancel";
213 // user defined functions
215 public class Xcls_Button6 : Object
217 public Gtk.Button el;
218 private Xcls_DialogPluginWebkit _this;
224 public Xcls_Button6(Xcls_DialogPluginWebkit _owner )
227 this.el = new Gtk.Button();
231 // set gobject values
232 this.el.label = "OK";
235 // user defined functions