[Monodevelop-patches-list] r2341 - trunk/MonoDevelop/Core/src/MonoDevelop.Dock

John Luke <jluke@cfl.rr.com> jluke at mono-cvs.ximian.com
Sun Mar 13 15:22:01 EST 2005


Author: jluke
Date: 2005-03-13 15:22:01 -0500 (Sun, 13 Mar 2005)
New Revision: 2341

Modified:
   trunk/MonoDevelop/Core/src/MonoDevelop.Dock/ChangeLog
   trunk/MonoDevelop/Core/src/MonoDevelop.Dock/DockPaned.cs
Log:
fix a little paned orientaion bug when
loading from a stored layout


Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Dock/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Dock/ChangeLog	2005-03-13 19:32:07 UTC (rev 2340)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Dock/ChangeLog	2005-03-13 20:22:01 UTC (rev 2341)
@@ -1,3 +1,8 @@
+2005-03-13  John Luke  <john.luke at gmail.com>
+
+	* DockPaned.cs: fix little orientaion bug when
+	loading the layout
+
 2005-03-12  Todd Berman  <tberman at off.net>
 
 	* DockItemGrip.cs: use .SetMarkup, not .SetText

Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Dock/DockPaned.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Dock/DockPaned.cs	2005-03-13 19:32:07 UTC (rev 2340)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Dock/DockPaned.cs	2005-03-13 20:22:01 UTC (rev 2341)
@@ -14,12 +14,15 @@
 
 		public DockPaned () : this (Orientation.Horizontal)
 		{
+			// loading a layout from xml may need to change orientation later
+			this.PropertyChanged += new PropertyChangedHandler (OnPropertyChanged); 
 		}
 
 		public DockPaned (Orientation orientation)
 		{
+			this.Orientation = orientation;
 			DockObjectFlags &= ~(DockObjectFlags.Automatic);
-			CreateChild (orientation);
+			CreateChild ();
 		}
 		
 		public override bool HasGrip {
@@ -46,15 +49,13 @@
 			}
 		}
 		
-		private void CreateChild (Orientation orientation)
+		private void CreateChild ()
 		{
 			if (Child != null)
 				Child.Unparent ();
 			
-			Orientation = orientation;
-
 			/* create the container paned */
-			if (orientation == Orientation.Horizontal)
+			if (this.Orientation == Orientation.Horizontal)
 				Child = new HPaned ();
 			else
 				Child = new VPaned ();
@@ -268,5 +269,13 @@
 		{
 			Master.EmitLayoutChangedEvent ();
 		}
+
+		void OnPropertyChanged (object sender, string name)
+		{
+			if (name == "orientation") {
+				CreateChild ();
+				this.PropertyChanged -= OnPropertyChanged;
+			}
+		}
 	}
 }




More information about the Monodevelop-patches-list mailing list