mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:02:56 +00:00
[USER32] Fixed scrolling by mouse wheel issue
This commit is contained in:
parent
a4483d79da
commit
d0a6727637
1 changed files with 13 additions and 8 deletions
|
@ -321,14 +321,15 @@ static LRESULT LISTBOX_SetTopItem( LB_DESCR *descr, INT index, BOOL scroll )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
diff = (descr->top_item - index) * descr->item_height;
|
diff = (descr->top_item - index) * descr->item_height;
|
||||||
|
|
||||||
#ifdef __REACTOS__
|
#ifdef __REACTOS__
|
||||||
if (descr->style & LBS_MULTICOLUMN)
|
if (descr->style & LBS_MULTICOLUMN)
|
||||||
ScrollWindowEx(descr->self, diff, 0, NULL, NULL, 0, NULL,
|
ScrollWindowEx(descr->self, diff, 0, NULL, NULL, 0, NULL,
|
||||||
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN);
|
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
ScrollWindowEx(descr->self, 0, diff, NULL, NULL, 0, NULL,
|
ScrollWindowEx( descr->self, 0, diff, NULL, NULL, 0, NULL,
|
||||||
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN);
|
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
InvalidateRect( descr->self, NULL, TRUE );
|
InvalidateRect( descr->self, NULL, TRUE );
|
||||||
|
@ -2034,6 +2035,10 @@ static LRESULT LISTBOX_HandleMouseWheel(LB_DESCR *descr, SHORT delta )
|
||||||
pulScrollLines = min((UINT) descr->page_size, pulScrollLines);
|
pulScrollLines = min((UINT) descr->page_size, pulScrollLines);
|
||||||
cLineScroll = pulScrollLines * (float)descr->wheel_remain / WHEEL_DELTA;
|
cLineScroll = pulScrollLines * (float)descr->wheel_remain / WHEEL_DELTA;
|
||||||
descr->wheel_remain -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
|
descr->wheel_remain -= WHEEL_DELTA * cLineScroll / (int)pulScrollLines;
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
if (cLineScroll < 0)
|
||||||
|
cLineScroll -= descr->page_size;
|
||||||
|
#endif
|
||||||
LISTBOX_SetTopItem( descr, descr->top_item - cLineScroll, TRUE );
|
LISTBOX_SetTopItem( descr, descr->top_item - cLineScroll, TRUE );
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue