Quellcode durchsuchen

* TreeView.cs: New method to invalidate the plus minus area of a
node without invalidating the whole node (maybe this can be used
in some more places).
* TreeNodeCollection.cs: When adding to an empty node we need to
invalidate its plus minus area so the little block shows up.


svn path=/trunk/mcs/; revision=52057

Jackson Harper vor 20 Jahren
Ursprung
Commit
5ea870c2be

+ 8 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,11 @@
+2005-10-21  Jackson Harper  <[email protected]>
+
+	* TreeView.cs: New method to invalidate the plus minus area of a
+	node without invalidating the whole node (maybe this can be used
+	in some more places).
+	* TreeNodeCollection.cs: When adding to an empty node we need to
+	invalidate its plus minus area so the little block shows up.
+	
 2005-10-21  Jackson Harper  <[email protected]>
 
 	* TreeView.cs: Make sure that when we invalidate a node the bounds

+ 19 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs

@@ -884,6 +884,25 @@ namespace System.Windows.Forms {
 			Invalidate (invalid);
 		}
 
+		internal void UpdateNodePlusMinus (TreeNode node)
+		{
+			if (update_stack > 0) {
+				update_needed = true;
+				return;
+			}
+
+			int l = node.Bounds.Left + 5;
+
+			if (show_root_lines || node.Parent != null)
+				l -= indent;
+			if (ImageList != null)
+				l -= ImageList.ImageSize.Width + 3;
+			if (checkboxes)
+				l -= 19;
+
+			Invalidate (new Rectangle (l, node.Bounds.Top, 8, node.Bounds.Height));
+		}
+
 		private void DoPaint (PaintEventArgs pe)
 		{
 			if (Width <= 0 || Height <=  0 || Visible == false)