Author: mkestner
Date: 2006-08-28 16:10:48 -0400 (Mon, 28 Aug 2006)
New Revision: 64493

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
Log:

2006-08-28  Mike Kestner  <[EMAIL PROTECTED]>

        * ListView.cs: move wheel handler to parent since it is focused
        instead of the item_control now.  [Fixes #79177]


Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-08-28 19:56:48 UTC (rev 64492)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-08-28 20:10:48 UTC (rev 64493)
@@ -1,5 +1,10 @@
 2006-08-28  Mike Kestner  <[EMAIL PROTECTED]>
 
+       * ListView.cs: move wheel handler to parent since it is focused
+       instead of the item_control now.  [Fixes #79177]
+
+2006-08-28  Mike Kestner  <[EMAIL PROTECTED]>
+
        * ThemeWin32Classic.cs: only highlight subitems in fullrowselect
        when the control is focused. [Fixes #79171]
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2006-08-28 19:56:48 UTC (rev 64492)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs      
2006-08-28 20:10:48 UTC (rev 64493)
@@ -168,6 +168,7 @@
                        SizeChanged += new EventHandler (ListView_SizeChanged);
                        GotFocus += new EventHandler (FocusChanged);
                        LostFocus += new EventHandler (FocusChanged);
+                       MouseWheel += new 
MouseEventHandler(ListView_MouseWheel);
 
                        this.SetStyle (ControlStyles.UserPaint | 
ControlStyles.StandardClick, false);
                }
@@ -1267,7 +1268,6 @@
                                MouseMove += new 
MouseEventHandler(ItemsMouseMove);
                                MouseHover += new EventHandler(ItemsMouseHover);
                                MouseUp += new MouseEventHandler(ItemsMouseUp);
-                               MouseWheel += new 
MouseEventHandler(ItemsMouseWheel);
                        }
 
                        void ItemsDoubleClick (object sender, EventArgs e)
@@ -1551,30 +1551,6 @@
                                checking = false;
                        }
 
-                       private void ItemsMouseWheel (object sender, 
MouseEventArgs me)
-                       {
-                               if (owner.Items.Count == 0)
-                                       return;
-
-                               int lines = me.Delta / 120;
-
-                               if (lines == 0)
-                                       return;
-
-                               switch (owner.View) {
-                               case View.Details:
-                               case View.SmallIcon:
-                                       owner.Scroll (owner.v_scroll, 
-owner.Items [0].Bounds.Height * SystemInformation.MouseWheelScrollLines * 
lines);
-                                       break;
-                               case View.LargeIcon:
-                                       owner.Scroll (owner.v_scroll, 
-(owner.Items [0].Bounds.Height + ThemeEngine.Current.ListViewVerticalSpacing)  
* lines);
-                                       break;
-                               case View.List:
-                                       owner.Scroll (owner.h_scroll, 
-owner.Items [0].Bounds.Width * lines);
-                                       break;
-                               }
-                       }
-
                        internal override void OnPaintInternal (PaintEventArgs 
pe)
                        {
                                ThemeEngine.Current.DrawListViewItems 
(pe.Graphics, pe.ClipRectangle, owner);
@@ -1605,6 +1581,30 @@
                        item_control.Invalidate (FocusedItem.Bounds);
                }
 
+               private void ListView_MouseWheel (object sender, MouseEventArgs 
me)
+               {
+                       if (Items.Count == 0)
+                               return;
+
+                       int lines = me.Delta / 120;
+
+                       if (lines == 0)
+                               return;
+
+                       switch (View) {
+                       case View.Details:
+                       case View.SmallIcon:
+                               Scroll (v_scroll, -Items [0].Bounds.Height * 
SystemInformation.MouseWheelScrollLines * lines);
+                               break;
+                       case View.LargeIcon:
+                               Scroll (v_scroll, -(Items [0].Bounds.Height + 
ThemeEngine.Current.ListViewVerticalSpacing)  * lines);
+                               break;
+                       case View.List:
+                               Scroll (h_scroll, -Items [0].Bounds.Width * 
lines);
+                               break;
+                       }
+               }
+
                private void ListView_SizeChanged (object sender, EventArgs e)
                {
                        CalculateListView (alignment);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to