2008-11-02 Carlos Alberto Cortez <calberto.cortez@gmail.com>
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>
Sun, 2 Nov 2008 21:21:40 +0000 (21:21 -0000)
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>
Sun, 2 Nov 2008 21:21:40 +0000 (21:21 -0000)
* ListView.cs:
* ThemeWin32Classic.cs: Don't use groups nor insertion mark in
Application.EnableVisualStyles hasn't been called.
Fixes part of #437933.

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

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs

index adb1695202da76b24ac9aeac125794f802067049..d366777870cdaf4585569a4a5535531ecadadeaf 100644 (file)
@@ -1,3 +1,10 @@
+2008-11-02  Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+       * ListView.cs:
+       * ThemeWin32Classic.cs: Don't use groups nor insertion mark in
+       Application.EnableVisualStyles hasn't been called.
+       Fixes part of #437933.
+
 2008-10-31  Andreia Gaita  <shana@jitted.com>
 
        * Form.cs (SetVisibleCore): since set_ActiveControl no longer calls focus
index 95e5a735b04ef9c96d3a48ec865123ade8a13e72..662433a16a945e05d564aa016560ef69a8c566c4 100644 (file)
@@ -388,6 +388,13 @@ namespace System.Windows.Forms
                        }
                }
 
+               internal bool UsingGroups {
+                       get {
+                               return show_groups && groups.Count > 0 && view != View.List && 
+                                       Application.VisualStylesEnabled;
+                       }
+               }
+
                internal override bool ScaleChildrenInternal {
                        get { return false; }
                }
@@ -1801,7 +1808,7 @@ namespace System.Windows.Forms
 
                        Size sz = item_size;
 #if NET_2_0
-                       bool using_groups = show_groups && groups.Count > 0 && view != View.List;
+                       bool using_groups = UsingGroups;
 #endif
 
                        CalculateRowsAndCols (sz, left_aligned, x_spacing, y_spacing);
index 0b8cedc306ca6baeabe30dfcfa7dc8901f277716..724762d3711892a51139d71c1bd9875ad5afb964 100644 (file)
@@ -2661,7 +2661,7 @@ namespace System.Windows.Forms
                        }       
 
 #if NET_2_0
-                       if (control.ShowGroups && control.View != View.List && control.Groups.Count > 0) {
+                       if (control.UsingGroups) {
                                // Use InternalCount instead of Count to take into account Default Group as needed
                                for (int i = 0; i < control.Groups.InternalCount; i++) {
                                        ListViewGroup group = control.Groups.GetInternalGroup (i);
@@ -2672,7 +2672,7 @@ namespace System.Windows.Forms
 
                        ListViewInsertionMark insertion_mark = control.InsertionMark;
                        int insertion_mark_index = insertion_mark.Index;
-                       if (insertion_mark.Bounds != Rectangle.Empty &&
+                       if (Application.VisualStylesEnabled && insertion_mark.Bounds != Rectangle.Empty &&
                                        (control.View != View.Details && control.View != View.List) &&
                                        insertion_mark_index > -1 && insertion_mark_index < control.Items.Count) {