[Monodevelop-patches-list] r422 - in trunk/MonoDevelop: samples/HtmlControl src/AddIns/Misc/StartPage src/Main/Base/Gui/BrowserDisplayBinding src/Main/Base/Gui/HtmlControl
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sat Jan 10 15:02:04 EST 2004
Author: jluke
Date: 2004-01-10 15:02:04 -0500 (Sat, 10 Jan 2004)
New Revision: 422
Modified:
trunk/MonoDevelop/samples/HtmlControl/Test.cs
trunk/MonoDevelop/src/AddIns/Misc/StartPage/StartPage.cs
trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs
trunk/MonoDevelop/src/Main/Base/Gui/HtmlControl/HtmlControl.cs
Log:
work in progress, some things work now others not
Modified: trunk/MonoDevelop/samples/HtmlControl/Test.cs
===================================================================
--- trunk/MonoDevelop/samples/HtmlControl/Test.cs 2004-01-10 07:39:42 UTC (rev 421)
+++ trunk/MonoDevelop/samples/HtmlControl/Test.cs 2004-01-10 20:02:04 UTC (rev 422)
@@ -62,7 +62,7 @@
html.CascadingStyleSheet = "";
html.Show ();
- vbox.PackStart (html, true, true, 0);
+ vbox.PackStart (html.Control, true, true, 0);
Statusbar status = new Statusbar ();
vbox.PackStart (status, false, true, 0);
Modified: trunk/MonoDevelop/src/AddIns/Misc/StartPage/StartPage.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/Misc/StartPage/StartPage.cs 2004-01-10 07:39:42 UTC (rev 421)
+++ trunk/MonoDevelop/src/AddIns/Misc/StartPage/StartPage.cs 2004-01-10 20:02:04 UTC (rev 422)
@@ -26,7 +26,7 @@
// return the panel that contains all of our controls
public override Gtk.Widget Control {
get {
- return htmlControl;
+ return htmlControl.Control;
}
}
@@ -79,6 +79,8 @@
"default.css";
htmlControl.Html = page.Render(curSection);
+ htmlControl.Control.Show ();
+ htmlControl.DelayedInitialize ();
htmlControl.BeforeNavigate += new BrowserNavigateEventHandler(HtmlControlBeforeNavigate);
StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
Modified: trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs 2004-01-10 07:39:42 UTC (rev 421)
+++ trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs 2004-01-10 20:02:04 UTC (rev 422)
@@ -1,205 +1,194 @@
-// <file>
-// <copyright see="prj:///doc/copyright.txt"/>
-// <license see="prj:///doc/license.txt"/>
-// <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
-// <version value="$version"/>
-// </file>
-
-using System;
-using System.Drawing;
+// <file>
+// <copyright see="prj:///doc/copyright.txt"/>
+// <license see="prj:///doc/license.txt"/>
+// <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
+// <version value="$version"/>
+// </file>
+
+using System;
+using System.Drawing;
using Gtk;
-using GtkSharp;
-
-using ICSharpCode.SharpDevelop.Internal.Undo;
-using System.Drawing.Printing;
-using ICSharpCode.Core.Properties;
-
-using ICSharpCode.Core.Services;
-using ICSharpCode.Core.AddIns.Codons;
-using ICSharpCode.SharpDevelop.Gui;
+using GtkSharp;
+
+using ICSharpCode.SharpDevelop.Internal.Undo;
+using System.Drawing.Printing;
+using ICSharpCode.Core.Properties;
+
+using ICSharpCode.Core.Services;
+using ICSharpCode.Core.AddIns.Codons;
+using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Gui.HtmlControl;
-
-namespace ICSharpCode.SharpDevelop.BrowserDisplayBinding
-{
- public class BrowserPane : AbstractViewContent
- {
- protected HtmlViewPane htmlViewPane;
-
- public override Widget Control {
- get {
- return htmlViewPane;
- }
- }
-
- public override bool IsDirty {
- get {
- return false;
- }
- set {
- }
- }
-
- public override bool IsViewOnly {
- get {
- return true;
- }
- }
-
- protected BrowserPane(bool showNavigation) //: base (type)
- {
- htmlViewPane = new HtmlViewPane(showNavigation);
- //htmlViewPane.HtmlControl.TitleChange += new DWebBrowserEvents2_TitleChangeEventHandler(TitleChange);
- }
-
- public BrowserPane() : this(true)
- {
- }
-
- public override void Dispose()
- {
- htmlViewPane.Dispose();
- }
-
- public override void Load(string url)
- {
- htmlViewPane.Navigate(url);
- }
-
- public override void Save(string url)
- {
- Load(url);
- }
-
- //void TitleChange(object sender, DWebBrowserEvents2_TitleChangeEvent e)
- //{
- // ContentName = e.text;
- //}
- }
-
- public class HtmlViewPane : Gtk.Frame
- {
- HtmlControl htmlControl = null;
-
- VBox topPanel = new VBox (false, 2);
- Toolbar toolBar = new Toolbar ();
- Entry urlTextBox = new Entry ();
-
- bool isHandleCreated = false;
+
+namespace ICSharpCode.SharpDevelop.BrowserDisplayBinding
+{
+ public class BrowserPane : AbstractViewContent
+ {
+ protected HtmlViewPane htmlViewPane;
+
+ public override Widget Control {
+ get {
+ return htmlViewPane;
+ }
+ }
+
+ public override bool IsDirty {
+ get {
+ return false;
+ }
+ set {
+ }
+ }
+
+ public override bool IsViewOnly {
+ get {
+ return true;
+ }
+ }
+
+ protected BrowserPane(bool showNavigation) //: base (type)
+ {
+ htmlViewPane = new HtmlViewPane(showNavigation);
+ //htmlViewPane.HtmlControl.TitleChange += new DWebBrowserEvents2_TitleChangeEventHandler(TitleChange);
+ }
+
+ public BrowserPane() : this(true)
+ {
+ }
+
+ public override void Dispose()
+ {
+ htmlViewPane.Dispose();
+ }
+
+ public override void Load(string url)
+ {
+ htmlViewPane.Navigate(url);
+ }
+
+ public override void Save(string url)
+ {
+ Load(url);
+ }
+
+ //void TitleChange(object sender, DWebBrowserEvents2_TitleChangeEvent e)
+ //{
+ // ContentName = e.text;
+ //}
+ }
+
+ public class HtmlViewPane : Gtk.Frame
+ {
+ HtmlControl htmlControl = null;
+
+ VBox topPanel = new VBox (false, 2);
+ Toolbar toolBar = new Toolbar ();
+ Entry urlTextBox = new Entry ();
+
+ bool isHandleCreated = false;
string lastUrl = null;
- static GLib.GType type;
-
- public HtmlControl HtmlControl {
- get {
- return htmlControl;
- }
+ static GLib.GType type;
+
+ public HtmlControl HtmlControl {
+ get {
+ return htmlControl;
+ }
}
static HtmlViewPane ()
{
type = RegisterGType (typeof (HtmlViewPane));
- }
-
- public HtmlViewPane(bool showNavigation) : base ()
- {
- //RequestSize = new Size (500, 500);
+ }
+
+ public HtmlViewPane(bool showNavigation) : base ()
+ {
+ //RequestSize = new Size (500, 500);
Shadow = Gtk.ShadowType.None;
VBox mainbox = new VBox (false, 2);
- if (showNavigation) {
-
- //topPanel.RequestSize = new Size (Width, 25);
- //topPanel.Dock = DockStyle.Top;
-
- //toolBar.Dock = DockStyle.None;
-
+ if (showNavigation) {
+
+ //topPanel.RequestSize = new Size (Width, 25);
+ //topPanel.Dock = DockStyle.Top;
+
+ //toolBar.Dock = DockStyle.None;
+
Button toolBarBack = new Button (Gtk.Stock.GoBack);
- toolBarBack.Clicked += new EventHandler (OnBackClicked);
+ toolBarBack.Clicked += new EventHandler (OnBackClicked);
Button toolBarForward = new Button (Gtk.Stock.GoForward);
- toolBarForward.Clicked += new EventHandler (OnForwardClicked);
+ toolBarForward.Clicked += new EventHandler (OnForwardClicked);
Button toolBarStop = new Button (Gtk.Stock.Stop);
- toolBarStop.Clicked += new EventHandler (OnStopClicked);
+ toolBarStop.Clicked += new EventHandler (OnStopClicked);
Button toolBarRefresh = new Button (Gtk.Stock.Refresh);
toolBarRefresh.Clicked += new EventHandler (OnRefreshClicked);
toolBar.ToolbarStyle = ToolbarStyle.Icons;
- toolBar.IconSize = IconSize.SmallToolbar;
+ toolBar.IconSize = IconSize.SmallToolbar;
toolBar.AppendWidget (toolBarBack, "", "");
toolBar.AppendWidget (toolBarForward, "", "");
toolBar.AppendWidget (toolBarStop, "", "");
- toolBar.AppendWidget (toolBarRefresh, "", "");
-
- topPanel.PackStart (toolBar);
+ toolBar.AppendWidget (toolBarRefresh, "", "");
- urlTextBox.Activated += new EventHandler (OnEntryActivated);
-
- topPanel.Add (urlTextBox);
- mainbox.PackStart (topPanel, false, false, 2);
- }
-
- htmlControl = new HtmlControl ();
- htmlControl.Control.Show ();
-
-// if (showNavigation) {
-// int height = 48;
-// axWebBrowser.Location = new Point(0, height);
-// axWebBrowser.Size = new Size(Width, Height - height);
-// axWebBrowser.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Top;
-// axWebBrowser.Dock = DockStyle.Fill;
-// } else {
- //axWebBrowser.Dock = DockStyle.Fill;
-// }
- //axWebBrowser.HandleCreated += new EventHandler(this.CreatedWebBrowserHandle);
- //axWebBrowser.TitleChange += new DWebBrowserEvents2_TitleChangeEventHandler(TitleChange);
+ topPanel.PackStart (toolBar);
+
+ urlTextBox.Activated += new EventHandler (OnEntryActivated);
+
+ topPanel.Add (urlTextBox);
+ mainbox.PackStart (topPanel, false, false, 2);
+ }
+ htmlControl = new HtmlControl ();
+ htmlControl.Control.Show ();
+
mainbox.PackStart (htmlControl.Control);
-
+
this.Add (mainbox);
this.ShowAll ();
- }
-
- //void TitleChange(object sender, DWebBrowserEvents2_TitleChangeEvent e)
- //{
- // urlTextBox.Text = axWebBrowser.LocationURL;
+ }
+
+ //void TitleChange(object sender, DWebBrowserEvents2_TitleChangeEvent e)
+ //{
+ // urlTextBox.Text = axWebBrowser.LocationURL;
//}
void OnEntryActivated (object o, EventArgs args)
{
htmlControl.Url = urlTextBox.Text;
- }
-
- public void CreatedWebBrowserHandle(object sender, EventArgs evArgs)
- {
- isHandleCreated = true;
- if (lastUrl != null) {
- Navigate(lastUrl);
- }
- }
-
- public void Navigate(string name)
- {
- urlTextBox.Text = name;
- htmlControl.Url = name;
}
+ public void CreatedWebBrowserHandle(object sender, EventArgs evArgs)
+ {
+ isHandleCreated = true;
+ if (lastUrl != null) {
+ Navigate(lastUrl);
+ }
+ }
+
+ public void Navigate(string name)
+ {
+ urlTextBox.Text = name;
+ htmlControl.Url = name;
+ htmlControl.Show ();
+ }
+
private void OnBackClicked (object o, EventArgs args)
{
- //htmlControl.GoBack ();
+ htmlControl.GoBack ();
}
private void OnForwardClicked (object o, EventArgs args)
{
- //htmlControl.GoForward ();
+ htmlControl.GoForward ();
}
private void OnStopClicked (object o, EventArgs args)
{
- //htmlControl.Stop ();
+ htmlControl.Stop ();
}
private void OnRefreshClicked (object o, EventArgs args)
{
- //htmlControl.Refresh ();
- }
- }
-}
+ htmlControl.Refresh ();
+ }
+ }
+}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/HtmlControl/HtmlControl.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/HtmlControl/HtmlControl.cs 2004-01-10 07:39:42 UTC (rev 421)
+++ trunk/MonoDevelop/src/Main/Base/Gui/HtmlControl/HtmlControl.cs 2004-01-10 20:02:04 UTC (rev 422)
@@ -64,18 +64,27 @@
}
public string Url {
+ get {
+ return this.url;
+ }
set {
this.url = value;
+ Console.WriteLine ("setting html url");
if (control_type == ControlType.GtkMozilla)
((MozillaControl) control).LoadUrl (value);
+ else
+ Console.WriteLine ("unable to load url");
}
}
public string Html {
+ get {
+ return this.html;
+ }
set {
this.html = value;
- if (control_type == ControlType.IE)
- ApplyBody(html);
+ Console.WriteLine ("setting html content");
+ ApplyBody(html);
}
}
@@ -106,7 +115,7 @@
this.control = new MozillaControl ();
//Console.WriteLine ("new MozillaControl");
((MozillaControl) this.control).Show ();
- this.Add ((MozillaControl) this.control);
+ //this.Add ((MozillaControl) this.control);
break;
default:
throw new NotImplementedException (control_type.ToString ());
@@ -164,6 +173,10 @@
((MozillaControl) control).RenderData (val, "file://", "text/html");
return;
}
+ else
+ {
+ Console.WriteLine ("not rendering with mozilla");
+ }
IHTMLElement el = null;
IHTMLDocument2 doc = this.control.GetDocument();
More information about the Monodevelop-patches-list
mailing list