public override void Initialize() { base.Initialize(); socket = new GTK.Socket(); Widget = socket; this.Widget.Realized += delegate { var size = new System.Drawing.Size(Widget.WidthRequest, Widget.HeightRequest); view = new SWF.WebBrowser(); view.Size = size; var browser_handle = view.Handle; IntPtr window_handle = (IntPtr)socket.Id; SetParent(browser_handle, window_handle); if (url != null) { view.Navigate(url); } //return false; }; Widget.Show(); }
private void DisposeView() { if (_loaded) { if (_editorProcess != null) { _editorProcess.Dispose(); _editorProcess = null; } if (_propGridSocket != null) { _propGridSocket.Dispose(); _propGridSocket = null; } if (_designerSocket != null) { _surfaceFrame.Remove(_designerSocket); _designerSocket.Dispose(); _designerSocket = null; } _loaded = false; } }
void DestroyEditorAndSockets() { if (proxy != null) { proxy.Dispose(); proxy = null; } if (editorProcess != null) { editorProcess.Dispose(); editorProcess = null; } if (propGridSocket != null) { propertyFrame.Remove(propGridSocket); propGridSocket.Dispose(); propGridSocket = null; } if (designerSocket != null) { designerFrame.Remove(designerSocket); designerSocket.Dispose(); designerSocket = null; } }
private void InitializeView() { _designerSocket = new Gtk.Socket(); _designerSocket.Show(); _surfaceFrame.Add(_designerSocket); _surfaceFrame.ShowAll(); _propGridSocket = new Gtk.Socket(); _propGridSocket.Show(); _propertyGridFrame.Add(_propGridSocket); _editorProcess = (EditorProcess)Runtime.ProcessService.CreateExternalProcessObject(typeof(EditorProcess), false); if (_designerSocket.IsRealized) { _editorProcess.AttachDesigner(_designerSocket.Id); } if (_propGridSocket.IsRealized) { _editorProcess.AttachPropertyGrid(_propGridSocket.Id); } _designerSocket.Realized += delegate { _editorProcess.AttachDesigner(_designerSocket.Id); }; _propGridSocket.Realized += delegate { _editorProcess.AttachPropertyGrid(_propGridSocket.Id); }; _editorProcess.Initialize(_designerFile); }
public override void Initialize () { base.Initialize (); socket = new Socket (); Widget = socket; this.Widget.Realized += HandleGtkRealized; this.Widget.SizeAllocated += HandleGtkSizeAllocated; Widget.Show(); }
public void InitIE(Gtk.Box w) { HoldingWidget = w; Browser = new System.Windows.Forms.WebBrowser(); w.SetSizeRequest(500, 500); Browser.Height = 500; // w.GdkWindow.FrameExtents.Height; Browser.Width = 500; // w.GdkWindow.FrameExtents.Width; Browser.Navigate("about:blank"); Browser.Document.Write(String.Empty); WebSocket = new Gtk.Socket(); WebSocket.SetSizeRequest(Browser.Width, Browser.Height); w.Add(WebSocket); WebSocket.Realize(); WebSocket.Show(); WebSocket.UnmapEvent += Socket_UnmapEvent; IntPtr browser_handle = Browser.Handle; IntPtr window_handle = (IntPtr)WebSocket.Id; NativeMethods.SetParent(browser_handle, window_handle); /// Another interesting issue is that on Windows, the WebBrowser control by default is /// effectively an IE7 browser, and I don't think you can easily change that without /// changing registry settings. The lack of JSON parsing in IE7 triggers errors in google maps. /// See https://code.google.com/p/gmaps-api-issues/issues/detail?id=9004 for the details. /// Including the meta tag of <meta http-equiv="X-UA-Compatible" content="IE=edge"/> /// fixes the problem, but we can't do that in the HTML that we set as InnerHtml in the /// LoadHTML function, as the meta tag triggers a restart of the browser, so it /// just reloads "about:blank", without the new innerHTML, and we get a blank browser. /// Hence we set the browser type here. /// Another way to get around this problem is to add JSON.Parse support available from /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON /// into the HTML Script added when loading Google Maps /// I am taking the belts-and-braces approach of doing both, primarily because the /// meta tag, while probably the technically better" solution, sometimes doesn't work. /// 10/8/17 - I've added yet another "fix" for this problem: the installer now writes a /// registry key requesting that IE 11 be used for ApsimNG.exe (and for ApsimNG.vshost.exe, /// so it also works when run from Visual Studio). Browser.DocumentText = @"<!DOCTYPE html> <html> <head> <meta http-equiv=""X-UA-Compatible"" content=""IE=edge,10""/> </head> </html>"; }
// Protected implementation of Dispose pattern. protected virtual void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { wb.Dispose(); wb = null; socket.Dispose(); socket = null; } // Free any unmanaged objects here. // disposed = true; }
public override void Initialize() { base.Initialize (); socket = new GTK.Socket (); Widget = socket; this.Widget.Realized += delegate { var size = new System.Drawing.Size (Widget.WidthRequest, Widget.HeightRequest); view = new SWF.WebBrowser (); view.Size = size; var browser_handle = view.Handle; IntPtr window_handle = (IntPtr)socket.Id; SetParent (browser_handle, window_handle); if (url != null) view.Navigate (url); //return false; }; Widget.Show(); }
/* Private members */ private void InitializeSocket () { socket = new Socket(); socket.ModifyBg(StateType.Normal, socket.Style.Black); frame.Child = socket; socket.Realize(); socket.Show(); }
public void InitIE(Gtk.Box w) { wb = new System.Windows.Forms.WebBrowser(); w.SetSizeRequest(500, 500); wb.Height = 500; // w.GdkWindow.FrameExtents.Height; wb.Width = 500; // w.GdkWindow.FrameExtents.Width; wb.Navigate("about:blank"); wb.Document.Write(String.Empty); socket = new Gtk.Socket(); socket.SetSizeRequest(wb.Width, wb.Height); w.Add(socket); socket.Realize(); socket.Show(); socket.UnmapEvent += Socket_UnmapEvent; IntPtr browser_handle = wb.Handle; IntPtr window_handle = (IntPtr)socket.Id; SetParent(browser_handle, window_handle); /// Another interesting issue is that on Windows, the WebBrowser control by default is /// effectively an IE7 browser, and I don't think you can easily change that without /// changing registry settings. The lack of JSON parsing in IE7 triggers errors in google maps. /// See https://code.google.com/p/gmaps-api-issues/issues/detail?id=9004 for the details. /// Including the meta tag of <meta http-equiv="X-UA-Compatible" content="IE=edge"/> /// fixes the problem, but we can't do that in the HTML that we set as InnerHtml in the /// LoadHTML function, as the meta tag triggers a restart of the browser, so it /// just reloads "about:blank", without the new innerHTML, and we get a blank browser. /// Hence we set the browser type here. /// Another way to get around this problem is to add JSON.Parse support available from /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON /// into the HTML Script added when loading Google Maps /// I am taking the belts-and-braces approach of doing both, primarily because the /// meta tag, while probably the technically better" solution, sometimes doesn't work. wb.DocumentText = @"<!DOCTYPE html> <html> <head> <meta http-equiv=""X-UA-Compatible"" content=""IE=edge,10""/> </head> </html>"; }
public override void Selected() { //check that the Mozilla extension is installed correctly, and if not, display an error if (extensionError != null) { return; } else if (!CheckExtension(ref extensionError)) { LoggingService.LogError(extensionError); Label errorlabel = new Label(extensionError); errorlabel.Wrap = true; HBox box = new HBox(false, 10); Image errorImage = new Image(Gtk.Stock.DialogError, Gtk.IconSize.Dialog); box.PackStart(new Label(), true, true, 0); box.PackStart(errorImage, false, false, 10); box.PackStart(errorlabel, true, false, 10); box.PackStart(new Label(), true, true, 0); designerFrame.Add(box); designerFrame.ShowAll(); return; } else { extensionError = null; } if (editorProcess != null) { throw new Exception("Editor should be null when document is selected"); } designerSocket = new Gtk.Socket(); designerSocket.Show(); designerFrame.Add(designerSocket); propGridSocket = new Gtk.Socket(); propGridSocket.Show(); propertyFrame.Add(propGridSocket); editorProcess = (EditorProcess)Runtime.ProcessService.CreateExternalProcessObject(typeof(EditorProcess), false); if (designerSocket.IsRealized) { editorProcess.AttachDesigner(designerSocket.Id); } if (propGridSocket.IsRealized) { editorProcess.AttachPropertyGrid(propGridSocket.Id); } designerSocket.Realized += delegate { editorProcess.AttachDesigner(designerSocket.Id); }; propGridSocket.Realized += delegate { editorProcess.AttachPropertyGrid(propGridSocket.Id); }; //designerSocket.FocusOutEvent += delegate { // MonoDevelop.DesignerSupport.DesignerSupport.Service.PropertyPad.BlankPad (); }; //hook up proxy for event binding string codeBehind = null; if (viewContent.Project != null) { string mimeType = DesktopService.GetMimeTypeForUri(viewContent.ContentName); var cu = MonoDevelop.Projects.Dom.Parser.ProjectDomService.Parse(viewContent.Project, viewContent.ContentName) as MonoDevelop.AspNet.Parser.AspNetParsedDocument; if (cu != null && cu.PageInfo != null && !string.IsNullOrEmpty(cu.PageInfo.InheritedClass)) { codeBehind = cu.PageInfo.InheritedClass; } } proxy = new MonoDevelopProxy(viewContent.Project, codeBehind); ITextBuffer textBuf = (ITextBuffer)viewContent.GetContent(typeof(ITextBuffer)); editorProcess.Initialise(proxy, textBuf.Text, viewContent.ContentName); activated = true; //FIXME: track 'dirtiness' properly viewContent.IsDirty = true; }
void DestroyEditorAndSockets () { if (proxy != null) { proxy.Dispose (); proxy = null; } if (editorProcess != null) { editorProcess.Dispose (); editorProcess = null; } if (propGridSocket != null) { propertyFrame.Remove (propGridSocket); propGridSocket.Dispose (); propGridSocket = null; } if (designerSocket != null) { designerFrame.Remove (designerSocket); designerSocket.Dispose (); designerSocket = null; } }
public override void Selected () { //check that the Mozilla extension is installed correctly, and if not, display an error if (extensionError != null) { return; } else if (!CheckExtension (ref extensionError)) { LoggingService.LogError (extensionError); Label errorlabel = new Label (extensionError); errorlabel.Wrap = true; HBox box = new HBox (false, 10); Image errorImage = new Image (Gtk.Stock.DialogError, Gtk.IconSize.Dialog); box.PackStart (new Label (), true, true, 0); box.PackStart (errorImage, false, false, 10); box.PackStart (errorlabel, true, false, 10); box.PackStart (new Label (), true, true, 0); designerFrame.Add (box); designerFrame.ShowAll (); return; } else { extensionError = null; } if (editorProcess != null) throw new Exception ("Editor should be null when document is selected"); designerSocket = new Gtk.Socket (); designerSocket.Show (); designerFrame.Add (designerSocket); propGridSocket = new Gtk.Socket (); propGridSocket.Show (); propertyFrame.Add (propGridSocket); editorProcess = (EditorProcess) Runtime.ProcessService.CreateExternalProcessObject (typeof (EditorProcess), false); if (designerSocket.IsRealized) editorProcess.AttachDesigner (designerSocket.Id); if (propGridSocket.IsRealized) editorProcess.AttachPropertyGrid (propGridSocket.Id); designerSocket.Realized += delegate { editorProcess.AttachDesigner (designerSocket.Id); }; propGridSocket.Realized += delegate { editorProcess.AttachPropertyGrid (propGridSocket.Id); }; //designerSocket.FocusOutEvent += delegate { // MonoDevelop.DesignerSupport.DesignerSupport.Service.PropertyPad.BlankPad (); }; //hook up proxy for event binding string codeBehind = null; if (viewContent.Project != null) { string mimeType = DesktopService.GetMimeTypeForUri (viewContent.ContentName); MonoDevelop.AspNet.Parser.AspNetParsedDocument cu = MonoDevelop.Projects.Dom.Parser.ProjectDomService.Parse ( null, viewContent.ContentName, mimeType) as MonoDevelop.AspNet.Parser.AspNetParsedDocument; if (cu != null && cu.PageInfo != null && !string.IsNullOrEmpty (cu.PageInfo.InheritedClass)) codeBehind = cu.PageInfo.InheritedClass; } proxy = new MonoDevelopProxy (viewContent.Project, codeBehind); ITextBuffer textBuf = (ITextBuffer) viewContent.GetContent (typeof(ITextBuffer)); editorProcess.Initialise (proxy, textBuf.Text, viewContent.ContentName); activated = true; //FIXME: track 'dirtiness' properly viewContent.IsDirty = true; }
private void DisposeView() { if (_loaded) { if (_editorProcess != null) { _editorProcess.Dispose (); _editorProcess = null; } if (_propGridSocket != null) { _propGridSocket.Dispose (); _propGridSocket = null; } if (_designerSocket != null) { _surfaceFrame.Remove (_designerSocket); _designerSocket.Dispose (); _designerSocket = null; } _loaded = false; } }
private void InitializeView () { _designerSocket = new Gtk.Socket (); _designerSocket.Show (); _surfaceFrame.Add (_designerSocket); _surfaceFrame.ShowAll (); _propGridSocket = new Gtk.Socket (); _propGridSocket.Show (); _propertyGridFrame.Add (_propGridSocket); _editorProcess = (EditorProcess) Runtime.ProcessService.CreateExternalProcessObject (typeof (EditorProcess), false); if (_designerSocket.IsRealized) _editorProcess.AttachDesigner (_designerSocket.Id); if (_propGridSocket.IsRealized) _editorProcess.AttachPropertyGrid (_propGridSocket.Id); _designerSocket.Realized += delegate { _editorProcess.AttachDesigner (_designerSocket.Id); }; _propGridSocket.Realized += delegate { _editorProcess.AttachPropertyGrid (_propGridSocket.Id); }; _editorProcess.Initialize (_designerFile); }
public override void Initialize() { base.Initialize (); view = new SWF.WebBrowser(); view.ScriptErrorsSuppressed = true; view.AllowWebBrowserDrop = false; view.ProgressChanged += HandleProgressChanged; view.Navigating += HandleNavigating; view.Navigated += HandleNavigated; view.DocumentTitleChanged += HandleDocumentTitleChanged; view.DocumentCompleted += HandleDocumentCompleted; view.DocumentText = ""; // force Document initialization socket = new Socket (); Widget = socket; this.Widget.Realized += HandleGtkRealized; this.Widget.SizeAllocated += HandleGtkSizeAllocated; Widget.Show(); }