[prev in list] [next in list] [prev in thread] [next in thread]
List: mono-devel-list
Subject: Re: [Mono-dev] ListBox.cs ownder draw variable size
From: Carlos Alberto Cortez <calberto.cortez () gmail ! com>
Date: 2008-05-30 22:54:01
Message-ID: 1212188042.2771.5.camel () heaven ! site
[Download RAW message or body]
Hey,
Two things for your next patch:
* Use the coding guidelines:
http://www.mono-project.com/Coding_Guidelines
* Send your patch as an attached file, not in the body of the message.
Committed your patch,
thanks for the correction!
Carlos.
El mié, 28-05-2008 a las 06:42 +0200, jkeymer escribió:
> 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
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic