[Monodevelop-patches-list] r1453 - in trunk/MonoDevelop/src: Libraries/MonoDevelop.Gui.Widgets Libraries/MonoDevelop.Gui.Widgets/Navbar Main/Base Main/Base/Gui/BrowserDisplayBinding
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Apr 13 16:17:22 EDT 2004
Author: jluke
Date: 2004-04-13 16:17:22 -0400 (Tue, 13 Apr 2004)
New Revision: 1453
Added:
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Navbar/
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Navbar/Navbar.cs
Modified:
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Makefile.am
trunk/MonoDevelop/src/Main/Base/ChangeLog
trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs
Log:
make a little navbar control for use in the browser
simplifies the HtmlViewPane
Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog 2004-04-13 18:28:32 UTC (rev 1452)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog 2004-04-13 20:17:22 UTC (rev 1453)
@@ -1,3 +1,8 @@
+2004-04-13 John Luke <jluke at cfl.rr.com>
+
+ * Navbar/Navbar.cs: add a navbar control for the web browser
+ removes the clutter in that area
+
2004-04-03 Todd Berman <tberman at sevenl.net>
* Tree/TreeNodeCollection.cs:
Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Makefile.am 2004-04-13 18:28:32 UTC (rev 1452)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Makefile.am 2004-04-13 20:17:22 UTC (rev 1453)
@@ -17,6 +17,7 @@
./FolderDialog/BaseFileEntry.cs \
./FolderDialog/FolderEntry.cs \
./FolderDialog/FileEntry.cs \
+./Navbar/Navbar.cs \
./TabLabel/TabLabel.cs \
./GladeWidgetExtract/GladeWidgetExtract.cs
Added: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Navbar/Navbar.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Navbar/Navbar.cs 2004-04-13 18:28:32 UTC (rev 1452)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Navbar/Navbar.cs 2004-04-13 20:17:22 UTC (rev 1453)
@@ -0,0 +1,105 @@
+using System;
+using Gtk;
+using MonoDevelop.Services;
+
+namespace MonoDevelop.Gui.Widgets
+{
+ public class Navbar : Toolbar
+ {
+ static GLib.GType gtype;
+ Button back = new Button ();
+ Button forward = new Button ();
+ Button stop = new Button ();
+ Button reload = new Button ();
+ Button go = new Button ();
+ Entry address = new Entry ();
+
+ public static new GLib.GType GType
+ {
+ get {
+ if (gtype == GLib.GType.Invalid)
+ gtype = RegisterGType (typeof (Navbar));
+ return gtype;
+ }
+ }
+
+ public Navbar () : base (GType)
+ {
+ back.Relief = ReliefStyle.None;
+ back.Add (new Image (Stock.GoBack, IconSize.SmallToolbar));
+ back.Clicked += OnBackClicked;
+
+ forward.Relief = ReliefStyle.None;
+ forward.Add (new Image (Stock.GoForward, IconSize.SmallToolbar));
+ forward.Clicked += OnForwardClicked;
+
+ stop.Relief = ReliefStyle.None;
+ stop.Add (new Image (Stock.Stop, IconSize.SmallToolbar));
+ stop.Clicked += OnStopClicked;
+
+ reload.Relief = ReliefStyle.None;
+ reload.Add (new Image (Stock.Refresh, IconSize.SmallToolbar));
+ reload.Clicked += OnReloadClicked;
+
+ go.Relief = ReliefStyle.None;
+ go.Add (new Image (Stock.Ok, IconSize.SmallToolbar));
+ go.Clicked += OnGoUrl;
+
+ address.WidthChars = 50;
+ address.Activated += OnGoUrl;
+
+ this.AppendWidget (back, GettextCatalog.GetString ("Go back"), "");
+ this.AppendWidget (forward, GettextCatalog.GetString ("Go forward"), "");
+ this.AppendWidget (stop, GettextCatalog.GetString ("Stop loading"), "");
+ this.AppendWidget (reload, GettextCatalog.GetString ("Reload page"), "");
+ this.AppendWidget (address, GettextCatalog.GetString ("Address"), "");
+ this.AppendWidget (go, GettextCatalog.GetString ("Load address"), "");
+ }
+
+ public string Url {
+ get {
+ return address.Text;
+ }
+ set {
+ address.Text = value;
+ }
+ }
+
+ void OnGoUrl (object o, EventArgs args)
+ {
+ if (Go != null)
+ Go (this, EventArgs.Empty);
+ }
+
+ void OnBackClicked (object o, EventArgs args)
+ {
+ if (Back != null)
+ Back (this, EventArgs.Empty);
+ }
+
+ void OnForwardClicked (object o, EventArgs args)
+ {
+ if (Forward != null)
+ Forward (this, EventArgs.Empty);
+ }
+
+ void OnStopClicked (object o, EventArgs args)
+ {
+ if (Stop != null)
+ Stop (this, EventArgs.Empty);
+ }
+
+ void OnReloadClicked (object o, EventArgs args)
+ {
+ if (Reload != null)
+ Reload (this, EventArgs.Empty);
+ }
+
+ public event EventHandler Back;
+ public event EventHandler Forward;
+ public event EventHandler Stop;
+ public event EventHandler Reload;
+ public event EventHandler Go;
+ }
+}
+
Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-13 18:28:32 UTC (rev 1452)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-13 20:17:22 UTC (rev 1453)
@@ -1,3 +1,7 @@
+2004-04-13 John Luke <jluke at cfl.rr.com>
+
+ * Gui/BrowserDisplayBinding/HtmlViewPane.cs: use Navbar control
+
2004-04-11 Todd Berman <tberman at sevenl.net>
* Gui/Workbench/WorkbenchMemento.cs: ugh, check for valid data too.
Modified: trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs 2004-04-13 18:28:32 UTC (rev 1452)
+++ trunk/MonoDevelop/src/Main/Base/Gui/BrowserDisplayBinding/HtmlViewPane.cs 2004-04-13 20:17:22 UTC (rev 1453)
@@ -14,6 +14,7 @@
using MonoDevelop.Core.Services;
using MonoDevelop.Core.AddIns.Codons;
using MonoDevelop.Gui;
+using MonoDevelop.Gui.Widgets;
using MonoDevelop.Gui.HtmlControl;
using MonoDevelop.Services;
@@ -135,8 +136,7 @@
MozillaControl htmlControl = null;
VBox topPanel = new VBox (false, 2);
- Toolbar toolBar = new Toolbar ();
- Entry urlTextBox = new Entry ();
+ Navbar nav = new Navbar ();
Statusbar status;
bool isHandleCreated = false;
@@ -165,44 +165,20 @@
if (showNavigation) {
- Button toolBarBack = new Button ();
- toolBarBack.Child = new Image (Gtk.Stock.GoBack, IconSize.SmallToolbar);
- toolBarBack.Relief = ReliefStyle.None;
- toolBarBack.Clicked += new EventHandler (OnBackClicked);
+ nav.Back += OnBackClicked;
+ nav.Forward += OnForwardClicked;
+ nav.Stop += OnStopClicked;
+ nav.Reload += OnRefreshClicked;
+ nav.Go += OnEntryActivated;
- Button toolBarForward = new Button ();
- toolBarForward.Child = new Image (Gtk.Stock.GoForward, IconSize.SmallToolbar);
- toolBarForward.Relief = ReliefStyle.None;
- toolBarForward.Clicked += new EventHandler (OnForwardClicked);
-
- Button toolBarStop = new Button ();
- toolBarStop.Child = new Image (Gtk.Stock.Stop, IconSize.SmallToolbar);
- toolBarStop.Relief = ReliefStyle.None;
- toolBarStop.Clicked += new EventHandler (OnStopClicked);
-
- Button toolBarRefresh = new Button ();
- toolBarRefresh.Child = new Image (Gtk.Stock.Refresh, IconSize.SmallToolbar);
- toolBarRefresh.Relief = ReliefStyle.None;
- toolBarRefresh.Clicked += new EventHandler (OnRefreshClicked);
-
- urlTextBox.WidthChars = 50;
- urlTextBox.Activated += new EventHandler (OnEntryActivated);
-
- toolBar.ToolbarStyle = ToolbarStyle.Icons;
- toolBar.IconSize = IconSize.SmallToolbar;
- toolBar.AppendWidget (toolBarBack, GettextCatalog.GetString ("Go Back"), "");
- toolBar.AppendWidget (toolBarForward, GettextCatalog.GetString ("Go Forward"), "");
- toolBar.AppendWidget (toolBarStop, GettextCatalog.GetString ("Stop Loading"), "");
- toolBar.AppendWidget (toolBarRefresh, GettextCatalog.GetString ("Reload page"), "");
- toolBar.AppendWidget (urlTextBox, GettextCatalog.GetString ("Location"), "");
-
- topPanel.PackStart (toolBar);
+ topPanel.PackStart (nav);
mainbox.PackStart (topPanel, false, false, 2);
}
htmlControl = new MozillaControl ();
- htmlControl.NetStart += new EventHandler (OnNetStart);
- htmlControl.NetStop += new EventHandler (OnNetStop);
+ htmlControl.NetStart += OnNetStart;
+ htmlControl.NetStop += OnNetStop;
+ htmlControl.LocChange += OnLocationChanged;
htmlControl.ShowAll ();
mainbox.PackStart (htmlControl);
@@ -217,7 +193,7 @@
void OnEntryActivated (object o, EventArgs args)
{
- htmlControl.LoadUrl (urlTextBox.Text);
+ htmlControl.LoadUrl (nav.Url);
}
public void CreatedWebBrowserHandle(object sender, EventArgs evArgs)
@@ -227,7 +203,7 @@
public void Navigate(string name)
{
- urlTextBox.Text = name;
+ nav.Url = name;
htmlControl.LoadUrl (name);
}
@@ -241,6 +217,11 @@
status.Push (1, GettextCatalog.GetString ("Done."));
}
+ void OnLocationChanged (object o, EventArgs args)
+ {
+ nav.Url = htmlControl.Location;
+ }
+
private void OnBackClicked (object o, EventArgs args)
{
htmlControl.GoBack ();
More information about the Monodevelop-patches-list
mailing list