[Gtk-sharp-list] monodoc-browser patch

Philip Van Hoof spamfrommailing@freax.org
14 May 2003 14:12:44 +0200


--=-ibSdaQKIvap6CU4cYNOD
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

This patch adds some menus and a About-box to the monodoc/browser module
in CVS

cvs diff -u > /home/freax/monodoc_menus.diff


-- 
Philip Van Hoof a.k.a. freax
me at freax dot org
http://www.freax.be -- http://www.freax.eu.org -- http://www.freax.org



--=-ibSdaQKIvap6CU4cYNOD
Content-Disposition: attachment; filename=monodoc_menus.diff
Content-Type: text/plain; name=monodoc_menus.diff; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

? Makefile.in
? autom4te.cache
? file.zip
? mod
? browser/Makefile.in
? browser/browser.gladep
? browser/tree.zip
? class/Makefile.in
? class/tmp
? extras/Makefile.in
? extras/filesource
? extras/filetree
? extras/filezip
Index: AUTHORS
===================================================================
RCS file: /mono/monodoc/AUTHORS,v
retrieving revision 1.1
diff -u -r1.1 AUTHORS
--- AUTHORS	4 Apr 2003 04:33:59 -0000	1.1
+++ AUTHORS	14 May 2003 12:09:53 -0000
@@ -1,2 +1,3 @@
 Miguel de Icaza (miguel@ximian.com)
 Duncan Mak (duncan@ximian.com)
+Philip Van Hoof (me@freax.org)
Index: ChangeLog
===================================================================
RCS file: /mono/monodoc/ChangeLog,v
retrieving revision 1.3
diff -u -r1.3 ChangeLog
--- ChangeLog	14 Apr 2003 22:34:48 -0000	1.3
+++ ChangeLog	14 May 2003 12:09:53 -0000
@@ -1,3 +1,6 @@
+2003-04-14  Philip Van Hoof  <me@freax.org>
+	* Added some menus
+
 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
 
 	* Makefile.am (bin_SCRIPTS): Install a script `mod' that can be
Index: browser/Makefile.am
===================================================================
RCS file: /mono/monodoc/browser/Makefile.am,v
retrieving revision 1.8
diff -u -r1.8 Makefile.am
--- browser/Makefile.am	19 Apr 2003 22:52:22 -0000	1.8
+++ browser/Makefile.am	14 May 2003 12:09:54 -0000
@@ -6,7 +6,7 @@
 assembler_sources = $(srcdir)/assembler.cs $(shared_sources)
 dump_sources      = $(srcdir)/dump.cs $(shared_sources)
 browser_sources   = $(srcdir)/browser.cs $(srcdir)/history.cs $(shared_sources)
-browser_assemblies = -r:gtk-sharp.dll -r:glade-sharp.dll -r:glib-sharp.dll -r:ICSharpCode.SharpZipLib.dll
+browser_assemblies = -r:gtk-sharp.dll -r:gdk-sharp.dll -r:glade-sharp.dll -r:glib-sharp.dll -r:gnome-sharp.dll -r:ICSharpCode.SharpZipLib.dll
 
 EXTRA_DIST = $(assembler_sources) $(dump_sources) $(browser_sources) browser.glade monodoc.xml mono-ecma.xsl
 
Index: browser/browser.cs
===================================================================
RCS file: /mono/monodoc/browser/browser.cs,v
retrieving revision 1.21
diff -u -r1.21 browser.cs
--- browser/browser.cs	15 Apr 2003 05:23:52 -0000	1.21
+++ browser/browser.cs	14 May 2003 12:09:54 -0000
@@ -14,9 +14,12 @@
 //
 using GLib;
 using Gtk;
+using Gnome;
+using Gdk;
 using GtkSharp;
 using Glade;
 using System;
+using System.IO;
 using System.Collections;
 
 class Browser {
@@ -136,7 +139,7 @@
 		}
 	}
 	
-        void LinkClicked (object o, LinkClickedArgs args)
+	void LinkClicked (object o, LinkClickedArgs args)
 	{
 		LoadUrl (args.Url);
 	}
@@ -207,6 +210,44 @@
 	{
 		Application.Quit ();
 	}
+	
+	public void on_quit_activate (System.Object b, EventArgs e) {
+		Application.Quit ();
+	}
+
+	public void on_copy_activate (System.Object b, EventArgs e) {
+		this.html.Copy ();
+	}
+
+	public void on_about_activate (System.Object b, EventArgs e) {
+		string[] authors = {
+			"Miguel De Icaza <miguel@ximian.com>",
+			"Duncan Mak <duncan@ximian.com>",
+			"Philip Van Hoof <me@freax.org>"
+		};
+		string[] documenters = {};
+		Pixbuf logo = new Pixbuf ("/usr/share/pixmaps/gnome-about-logo.png");
+		// TODO: I have no idea how to do this correctly (how do I know what the --prefix was
+		// and stuff like that?)
+		// Pixbuf logo = new Pixbuf ("pixmaps" + Path.DirectorySeparatorChar + "monodoc-logo.png");
+		About about = new About("MonoDoc-browser", "CVS", "Copyright (C) 2003", 
+		"This tool displays documentation in the format used by the ECMA specification",
+		authors, documenters, "", logo);
+		about.Show ();
+	}
+
+	public void on_select_all_activate (System.Object b, EventArgs e) {
+		this.html.SelectAll ();
+	}
+
+	public void on_expand_all_activate (System.Object b, EventArgs e) {
+		this.reference_tree.ExpandAll ();
+	}
+
+	public void on_collapse_all_activate (System.Object b, EventArgs e) {
+		this.reference_tree.CollapseAll ();
+	}
+
 }
 
 //
Index: browser/browser.glade
===================================================================
RCS file: /mono/monodoc/browser/browser.glade,v
retrieving revision 1.9
diff -u -r1.9 browser.glade
--- browser/browser.glade	4 Apr 2003 23:49:39 -0000	1.9
+++ browser/browser.glade	14 May 2003 12:09:55 -0000
@@ -2,6 +2,7 @@
 <!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
 
 <glade-interface>
+<requires lib="gnome"/>
 
 <widget class="GtkWindow" id="window1">
   <property name="visible">True</property>
@@ -29,6 +30,19 @@
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">_File</property>
 	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="menuitem4_menu">
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="quit">
+		      <property name="visible">True</property>
+		      <property name="stock_item">GNOMEUIINFO_MENU_EXIT_ITEM</property>
+		      <signal name="activate" handler="on_quit_activate" last_modification_time="Wed, 14 May 2003 11:12:29 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
 	    </widget>
 	  </child>
 
@@ -37,6 +51,27 @@
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">_Edit</property>
 	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="menuitem5_menu">
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="copy">
+		      <property name="visible">True</property>
+		      <property name="stock_item">GNOMEUIINFO_MENU_COPY_ITEM</property>
+		      <signal name="activate" handler="on_copy_activate" last_modification_time="Wed, 14 May 2003 11:12:29 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="select_all">
+		      <property name="visible">True</property>
+		      <property name="stock_item">GNOMEUIINFO_MENU_SELECT_ALL_ITEM</property>
+		      <signal name="activate" handler="on_select_all_activate" last_modification_time="Wed, 14 May 2003 11:12:29 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
 	    </widget>
 	  </child>
 
@@ -45,6 +80,29 @@
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">_View</property>
 	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="menuitem6_menu">
+
+		  <child>
+		    <widget class="GtkMenuItem" id="collapse_all">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Collapse All</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="on_collapse_all_activate" last_modification_time="Wed, 14 May 2003 12:06:22 GMT"/>
+		    </widget>
+		  </child>
+
+		  <child>
+		    <widget class="GtkMenuItem" id="expand_all">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Expand All</property>
+		      <property name="use_underline">True</property>
+		      <signal name="activate" handler="on_expand_all_activate" last_modification_time="Wed, 14 May 2003 12:07:02 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
 	    </widget>
 	  </child>
 
@@ -53,6 +111,19 @@
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">_Help</property>
 	      <property name="use_underline">True</property>
+
+	      <child>
+		<widget class="GtkMenu" id="menuitem7_menu">
+
+		  <child>
+		    <widget class="GtkImageMenuItem" id="about">
+		      <property name="visible">True</property>
+		      <property name="stock_item">GNOMEUIINFO_MENU_ABOUT_ITEM</property>
+		      <signal name="activate" handler="on_about_activate" last_modification_time="Wed, 14 May 2003 11:12:29 GMT"/>
+		    </widget>
+		  </child>
+		</widget>
+	      </child>
 	    </widget>
 	  </child>
 	</widget>

--=-ibSdaQKIvap6CU4cYNOD--