[Monodevelop-patches-list] r541 - in trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui: . GladeWidgetExtract

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Sun Jan 18 13:16:55 EST 2004


Author: benm
Date: 2004-01-18 13:16:55 -0500 (Sun, 18 Jan 2004)
New Revision: 541

Added:
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/GladeWidgetExtract/
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/GladeWidgetExtract/GladeWidgetExtract.cs
Modified:
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Makefile
Log:
intelliwidget ;-)

Added: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/GladeWidgetExtract/GladeWidgetExtract.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/GladeWidgetExtract/GladeWidgetExtract.cs	2004-01-18 13:20:30 UTC (rev 540)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/GladeWidgetExtract/GladeWidgetExtract.cs	2004-01-18 18:16:55 UTC (rev 541)
@@ -0,0 +1,60 @@
+//
+// Makes a widget from a glade file. Does reparenting.
+// This is nice because you can use it for things like
+// option dialogs.
+//
+
+
+using System;
+using Gtk;
+using GtkSharp;
+using Glade;
+using GladeSharp;
+
+using Assembly = System.Reflection.Assembly;
+
+namespace MonoDevelop.Gui {
+	public abstract class GladeWidgetExtract : HBox {
+		
+		Glade.XML glade;
+		string dialog_name;
+		
+		private GladeWidgetExtract (string dialog_name) : base (false, 0)
+		{
+			this.dialog_name = dialog_name;
+		}
+		
+		protected GladeWidgetExtract (string resource_name, string dialog_name) : this (dialog_name)
+		{
+			// we must do it from *here* otherwise, we get this assembly, not the caller
+			glade = new XML (Assembly.GetCallingAssembly (), resource_name, dialog_name, null);
+			Init ();
+		}
+		
+		
+		protected GladeWidgetExtract (Assembly assembly, string resource_name, string dialog_name) : this (dialog_name)
+		{
+			// we must do it from *here* otherwise, we get this assembly, not the caller
+			glade = new XML (assembly, resource_name, dialog_name, null);
+			Init ();
+		}
+		
+		protected GladeWidgetExtract (string resource_name, string dialog_name, string domain) : this (dialog_name)
+		{
+			// we must do it from *here* otherwise, we get this assembly, not the caller
+			glade = new XML (resource_name, dialog_name, domain);
+			Init ();
+		}
+		
+		void Init ()
+		{
+			glade.Autoconnect (this);
+			
+			Window win = (Window) glade [dialog_name];
+			Widget child = win.Child;
+			
+			child.Reparent (this);
+			win.Destroy ();
+		}
+	}
+}
\ No newline at end of file

Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Makefile
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Makefile	2004-01-18 13:20:30 UTC (rev 540)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui/Makefile	2004-01-18 18:16:55 UTC (rev 541)
@@ -1,10 +1,11 @@
 DLL=../../../build/bin/MonoDevelop.Gui.dll
+REFERENCES=/r:System.Drawing.dll /r:gtk-sharp.dll /r:gdk-sharp.dll /r:pango-sharp.dll /r:gnome-sharp.dll /r:glib-sharp.dll /r:glade-sharp.dll
 
 all: $(DLL)
 
 super-docker: */*.cs
-	mcs /debug /out:$(DLL) /target:library /r:System.Drawing.dll /r:gtk-sharp.dll /r:gdk-sharp.dll /r:pango-sharp.dll /r:gnome-sharp.dll /r:glib-sharp.dll /define:EXPERIMENTAL_DOCKER /recurse:*.cs
+	mcs /debug /out:$(DLL) /target:library $(REFERENCES) /define:EXPERIMENTAL_DOCKER /recurse:*.cs
 
 $(DLL): */*.cs
-	mcs /debug /out:$(DLL) /target:library /r:System.Drawing.dll /r:gtk-sharp.dll /r:gdk-sharp.dll /r:pango-sharp.dll /r:gnome-sharp.dll /r:glib-sharp.dll /recurse:*.cs
+	mcs /debug /out:$(DLL) /target:library $(REFERENCES) /recurse:*.cs
 




More information about the Monodevelop-patches-list mailing list