[Monodevelop-patches-list] r402 - src/Main/Base/Gui/BrowserDisplayBinding

commit-watcher at sevenl.net commit-watcher at sevenl.net
Tue Jan 6 22:56:56 EST 2004


Author: jluke
Date: 2004-01-06 22:56:56 -0500 (Tue, 06 Jan 2004)
New Revision: 402

Modified:
   src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs
Log:
browser seems to work now


Modified: src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs
===================================================================
--- src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs	2004-01-07 03:08:56 UTC (rev 401)
+++ src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs	2004-01-07 03:56:56 UTC (rev 402)
@@ -20,13 +20,9 @@
 using ICSharpCode.SharpDevelop.Gui.HtmlControl;
 
 namespace ICSharpCode.SharpDevelop.BrowserDisplayBinding
-{
-
-	// FIXME: correctly register the type
+{
 	public class BrowserPane : AbstractViewContent
-	{
-		static GLib.GType type;
-		
+	{	
 		protected HtmlViewPane htmlViewPane;
 		
 		public override Widget Control {
@@ -47,11 +43,6 @@
 			get {
 				return true;
 			}
-		}
-		
-		static BrowserPane ()
-		{
-			//type = RegisterGType (typeof (BrowserPane));
 		}
 		
 		protected BrowserPane(bool showNavigation) //: base (type)
@@ -95,7 +86,7 @@
 		
 		bool   isHandleCreated  = false;
 		string lastUrl     = null;
-		//static GLib.GType type;
+		static GLib.GType type;
 		
 		public HtmlControl HtmlControl {
 			get {
@@ -105,7 +96,7 @@
 		
 		static HtmlViewPane ()
 		{
-		//	type = RegisterGType (typeof (HtmlViewPane));
+			type = RegisterGType (typeof (HtmlViewPane));
 		}
 		
 		public HtmlViewPane(bool showNavigation) : base ()
@@ -129,27 +120,25 @@
 				Button toolBarStop = new Button (Gtk.Stock.Stop);
 				toolBarStop.Clicked += new EventHandler (OnStopClicked);
 				Button toolBarRefresh = new Button (Gtk.Stock.Refresh);
-				toolBarRefresh.Clicked += new EventHandler (OnRefreshClicked);
+				toolBarRefresh.Clicked += new EventHandler (OnRefreshClicked);
+			
+				toolBar.ToolbarStyle = ToolbarStyle.Icons;
+				toolBar.IconSize = IconSize.SmallToolbar;
 				toolBar.AppendWidget (toolBarBack, "", "");
 				toolBar.AppendWidget (toolBarForward, "", "");
 				toolBar.AppendWidget (toolBarStop, "", "");
-				toolBar.AppendWidget (toolBarRefresh, "", "");
+				toolBar.AppendWidget (toolBarRefresh, "", "");
 				
-				//toolBar.ButtonClick += new ToolBarButtonClickEventHandler(ToolBarClick);
-				
-				//toolBar.Location = new Point(0, 0);
-				//toolBar.Size = new Size(4*toolBar.ButtonSize.Width, 25);
-				
 				topPanel.PackStart (toolBar);
 				
 				urlTextBox.Activated += new EventHandler (OnEntryActivated);
 				
 				topPanel.Add (urlTextBox);
-				mainbox.PackStart (topPanel, false, false, 2);
-				
+				mainbox.PackStart (topPanel, false, false, 2);
 			} 
 			
-			htmlControl = new HtmlControl ();
+			htmlControl = new HtmlControl ();
+			htmlControl.Control.Show ();
 
 //			if (showNavigation) {
 //				int height = 48;
@@ -162,12 +151,11 @@
 //			}
 			//axWebBrowser.HandleCreated += new EventHandler(this.CreatedWebBrowserHandle);
 			//axWebBrowser.TitleChange   += new DWebBrowserEvents2_TitleChangeEventHandler(TitleChange);
+			
+			mainbox.PackStart (htmlControl.Control);
 			
-			Console.WriteLine ("about to pack in the htmlControl");
-			mainbox.PackStart (htmlControl.Control);
-			Console.WriteLine ("htmlControl packed");
-			
 			this.Add (mainbox);
+			this.ShowAll ();
 		}
 		
 		//void TitleChange(object sender, DWebBrowserEvents2_TitleChangeEvent e)
@@ -177,7 +165,7 @@
 		
 		void OnEntryActivated (object o, EventArgs args)
 		{
-			Navigate (urlTextBox.Text);
+			htmlControl.Url = urlTextBox.Text;
 		}
 		
 		public void CreatedWebBrowserHandle(object sender, EventArgs evArgs) 
@@ -189,22 +177,9 @@
 		}
 		
 		public void Navigate(string name)
-		{
-			Console.WriteLine (name);
-			if (!isHandleCreated) {
-				lastUrl = name;
-				return;
-			}
+		{
 			urlTextBox.Text = name;
-			object arg1 = 0; 
-			object arg2 = ""; 
-			object arg3 = ""; 
-			object arg4 = "";
-			try {
-				htmlControl.Url = name;
-			} catch (Exception e) {
-				Console.WriteLine(e.ToString());
-			}
+			htmlControl.Url = name;
 		}
 		
 		private void OnBackClicked (object o, EventArgs args)




More information about the Monodevelop-patches-list mailing list