Author: jordi
Date: 2005-04-29 12:47:31 -0400 (Fri, 29 Apr 2005)
New Revision: 43795

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
Log:
2005-04-29  Jordi Mas i Hernandez <[EMAIL PROTECTED]>

        * ListBox.cs: added horizontal item scroll




Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-04-29 16:26:05 UTC (rev 43794)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-04-29 16:47:31 UTC (rev 43795)
@@ -1,3 +1,8 @@
+2005-04-29  Jordi Mas i Hernandez <[EMAIL PROTECTED]>
+
+       * ListBox.cs: added horizontal item scroll
+
+
 2005-04-29  Jackson Harper  <[EMAIL PROTECTED]>
 
        * ThemeWin32Classic.cs: Remove some old debug code that was

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs       
2005-04-29 16:26:05 UTC (rev 43794)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs       
2005-04-29 16:47:31 UTC (rev 43795)
@@ -22,13 +22,8 @@
 // Authors:
 //     Jordi Mas i Hernandez, [EMAIL PROTECTED]
 //
-// TODO:
-//     - Horizontal item scroll
-//     - Performance testing
-//
-//
 
-// NOT COMPLETE
+// COMPLETE
 
 using System;
 using System.Drawing;
@@ -1058,6 +1053,11 @@
                                        
                                        if (has_focus == true && focused_item 
== i)
                                                state |= DrawItemState.Focus;
+                                               
+                                       if (hscrollbar_ctrl != null && 
hscrollbar_ctrl.Visible) {
+                                               item_rect.X -= 
hscrollbar_ctrl.Value;
+                                               item_rect.Width += 
hscrollbar_ctrl.Value;
+                                       }
 
                                        OnDrawItem (new DrawItemEventArgs (dc, 
Font, item_rect,
                                                i, state, ForeColor, 
BackColor));
@@ -1086,8 +1086,11 @@
                // Value Changed
                private void HorizontalScrollEvent (object sender, EventArgs e)
                {
-                       LBoxInfo.top_item = listbox_info.page_size * 
hscrollbar_ctrl.Value;
-                       LBoxInfo.last_item = LastVisibleItem ();
+                       if (multicolumn) {
+                               LBoxInfo.top_item = listbox_info.page_size * 
hscrollbar_ctrl.Value;
+                               LBoxInfo.last_item = LastVisibleItem ();
+                       }
+                       
                        base.Refresh ();
                }
 
@@ -1711,8 +1714,9 @@
                        } else { /* If large item*/
 
                                if (listbox_info.max_itemwidth > 
listbox_info.client_rect.Width && HorizontalScrollbar) {
-                                       show = true;
+                                       show = true;                            
        
                                        hscrollbar_ctrl.Maximum = 
listbox_info.max_itemwidth;
+                                       hscrollbar_ctrl.LargeChange = 
listbox_info.textdrawing_rect.Width;
                                }
                        }
 

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

Reply via email to