mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
user32/listbox: Fix scrolling for multi-column listboxes.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=38565 Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3f266610d5
commit
f025570c80
1 changed files with 6 additions and 7 deletions
|
@ -300,28 +300,27 @@ static LRESULT LISTBOX_SetTopItem( LB_DESCR *descr, INT index, BOOL scroll )
|
|||
if (descr->top_item == index) return LB_OKAY;
|
||||
if (scroll)
|
||||
{
|
||||
INT diff;
|
||||
INT dx = 0, dy = 0;
|
||||
if (descr->style & LBS_MULTICOLUMN)
|
||||
diff = (descr->top_item - index) / descr->page_size * descr->column_width;
|
||||
dx = (descr->top_item - index) / descr->page_size * descr->column_width;
|
||||
else if (descr->style & LBS_OWNERDRAWVARIABLE)
|
||||
{
|
||||
INT i;
|
||||
diff = 0;
|
||||
if (index > descr->top_item)
|
||||
{
|
||||
for (i = index - 1; i >= descr->top_item; i--)
|
||||
diff -= descr->items[i].height;
|
||||
dy -= descr->items[i].height;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = index; i < descr->top_item; i++)
|
||||
diff += descr->items[i].height;
|
||||
dy += descr->items[i].height;
|
||||
}
|
||||
}
|
||||
else
|
||||
diff = (descr->top_item - index) * descr->item_height;
|
||||
dy = (descr->top_item - index) * descr->item_height;
|
||||
|
||||
ScrollWindowEx( descr->self, 0, diff, NULL, NULL, 0, NULL,
|
||||
ScrollWindowEx( descr->self, dx, dy, NULL, NULL, 0, NULL,
|
||||
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue