[Monodevelop-patches-list] r1137 - in trunk/MonoDevelop/src/Main/Base: . Gui/Pads/HelpBrowser
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Wed Mar 10 11:13:56 EST 2004
Author: tberman
Date: 2004-03-10 11:13:56 -0500 (Wed, 10 Mar 2004)
New Revision: 1137
Added:
trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpViewer.cs
Modified:
trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/MonodocTreePad.cs
trunk/MonoDevelop/src/Main/Base/Makefile.am
Log:
simple browser for the help files, clicking links inside them dont work yet.
Added: trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpViewer.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpViewer.cs 2004-03-10 15:13:54 UTC (rev 1136)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpViewer.cs 2004-03-10 16:13:56 UTC (rev 1137)
@@ -0,0 +1,50 @@
+using System;
+
+using Gtk;
+using Monodoc;
+
+using MonoDevelop.Gui;
+
+namespace MonoDevelop.Gui
+{
+
+ public class HelpViewer : AbstractViewContent
+ {
+
+ HTML html_viewer = new HTML ();
+ string CurrentUrl;
+
+ ScrolledWindow scroller = new ScrolledWindow ();
+
+ public override Gtk.Widget Control {
+ get { return scroller; }
+ }
+
+ public override string ContentName {
+ get { return "Documentation"; }
+ }
+
+ public HelpViewer ()
+ {
+ scroller.Add (html_viewer);
+ }
+
+ public void Render (string text, Node matched_node, string url)
+ {
+ CurrentUrl = url;
+
+ Gtk.HTMLStream stream = html_viewer.Begin ("text/html");
+
+ stream.Write ("<html><body>");
+ stream.Write (text);
+ stream.Write ("</body></html>");
+ html_viewer.End (stream, HTMLStreamStatus.Ok);
+ }
+
+ public override void Load (string s)
+ {
+ }
+
+ }
+
+}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/MonodocTreePad.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/MonodocTreePad.cs 2004-03-10 15:13:54 UTC (rev 1136)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/MonodocTreePad.cs 2004-03-10 16:13:56 UTC (rev 1137)
@@ -90,20 +90,33 @@
if (n.tree.HelpSource != null) {
s = n.tree.HelpSource.GetText (url, out match);
if (s != null) {
- //Console.WriteLine (s);
+ ShowDocs (s, match, url);
return;
}
}
s = root_tree.RenderUrl (url, out match);
if (s != null) {
- //Console.WriteLine (s);
+ ShowDocs (s, match, url);
return;
}
Console.WriteLine ("Couldnt find match");
}
}
+ void ShowDocs (string text, Node matched_node, string url)
+ {
+ foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) {
+ if (content.ContentName == "Documentation") {
+ ((HelpViewer)content).Render (text, matched_node, url);
+ return;
+ }
+ }
+ HelpViewer new_content = new HelpViewer ();
+ new_content.Render (text, matched_node, url);
+ WorkbenchSingleton.Workbench.ShowView (new_content);
+ }
+
void PopulateNode (TreeIter parent)
{
Node node = (Node)store.GetValue (parent, 1);
Modified: trunk/MonoDevelop/src/Main/Base/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Makefile.am 2004-03-10 15:13:54 UTC (rev 1136)
+++ trunk/MonoDevelop/src/Main/Base/Makefile.am 2004-03-10 16:13:56 UTC (rev 1137)
@@ -21,6 +21,7 @@
./Gui/Pads/ClassScout/NodeBuilder/IClassScoutNodeBuilder.cs \
./Gui/Pads/ClassScout/BrowserNode/AbstractClassScoutNode.cs \
./Gui/Pads/HelpBrowser/MonodocTreePad.cs \
+./Gui/Pads/HelpBrowser/HelpViewer.cs \
./Gui/Pads/SideBarView.cs \
./Gui/AbstractPadContent.cs \
./Gui/ISecondaryViewContent.cs \
@@ -370,6 +371,7 @@
/r:../../../build/bin/gtkmozembed-sharp.dll \
/r:glade-sharp \
/r:gnome-sharp \
+ /r:gtkhtml-sharp \
/r:$(debugger_prefix)/lib/Mono.Debugger.dll \
$(monodoc_libflags) \
$(FILES) \
More information about the Monodevelop-patches-list
mailing list