[Mono-dev] ListBox.cs ownder draw variable size
jkeymer
jkeymer at sikijo.dyndns.org
Tue May 27 19:24:04 EDT 2008
Handles calculation if the listbox scroll area of variable high, owner
draw boxes,
Index: Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
===================================================================
--- Managed.Windows.Forms/System.Windows.Forms/ListBox.cs (Revision
103872)
+++ Managed.Windows.Forms/System.Windows.Forms/ListBox.cs (Arbeitskopie)
@@ -2145,9 +2145,20 @@
last_visible_index = LastVisibleItem ();
int diff = top_item - top_index;
-
+ int delta = ItemHeight * diff;
+ if (DrawMode == DrawMode.OwnerDrawVariable) {
+ delta = 0;
+ if ( top_index < top_item ) {
+ for ( int i = top_index; i < top_item; i++ )
+ delta += GetItemHeight(i);
+ }
+ else {
+ for ( int i = top_item; i < top_index; i++ )
+ delta -= GetItemHeight(i);
+ }
+ }
if (IsHandleCreated)
- XplatUI.ScrollWindow (Handle, items_area, 0, ItemHeight
* diff, false);
+ XplatUI.ScrollWindow (Handle, items_area, 0, delta, false);
}
#endregion Private Methods
More information about the Mono-devel-list
mailing list