Author: jackson
Date: 2007-03-06 16:32:20 -0500 (Tue, 06 Mar 2007)
New Revision: 73847
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
Log:
- Implement 2.0 image key feature.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-03-06 21:10:40 UTC (rev 73846)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-03-06 21:32:20 UTC (rev 73847)
@@ -10,6 +10,7 @@
- Implement 2.0 LineColors property. Lets you change the color of
the lines in the tree. Terribly useful for creating non cohesive
desktops.
+ - Implement 2.0 image key feature.
2007-03-06 Jackson Harper <[EMAIL PROTECTED]>
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
2007-03-06 21:10:40 UTC (rev 73846)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
2007-03-06 21:32:20 UTC (rev 73847)
@@ -55,6 +55,9 @@
private int image_index = -1;
private int selected_image_index = -1;
+#if NET_2_0
+ private string image_key;
+#endif
private bool full_row_select;
private bool hot_tracking;
private int indent = 19;
@@ -502,6 +505,20 @@
}
}
}
+#if NET_2_0
+ [Localizable (true)]
+ public string ImageKey {
+ get { return image_key; }
+ set {
+ if (image_key == value)
+ return;
+ image_index = -1;
+ image_key = value;
+ Invalidate ();
+ }
+ }
+#endif
+
#endregion // Public Instance Properties
#region Protected Instance Properties
@@ -1231,6 +1248,16 @@
use_index = ImageIndex;
}
+#if NET_2_0
+ if (use_index == -1 && !String.IsNullOrEmpty
(node.ImageKey)) {
+ use_index = image_list.Images.IndexOfKey
(node.ImageKey);
+ }
+
+ if (use_index == -1 && !String.IsNullOrEmpty
(ImageKey)) {
+ use_index = image_list.Images.IndexOfKey
(ImageKey);
+ }
+#endif
+
if (use_index == -1 && ImageList.Images.Count > 0) {
use_index = 0;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches