Mikołaj Zalewski : comctl32: header: Make the column resizing smooth in full drag mode.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue May 23 11:04:49 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 64e5779c16aa364f1bc293874c00b81b11daf1dd
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=64e5779c16aa364f1bc293874c00b81b11daf1dd
Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date: Mon May 22 22:47:37 2006 +0200
comctl32: header: Make the column resizing smooth in full drag mode.
Make the column resizing smooth in full drag mode even for listview
with lots of elements by redrawing only the resized column and calling
UpdateWindow.
---
dlls/comctl32/header.c | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c
index 38d752e..6696e25 100644
--- a/dlls/comctl32/header.c
+++ b/dlls/comctl32/header.c
@@ -1657,14 +1657,25 @@ HEADER_MouseMove (HWND hwnd, WPARAM wPar
if (dwStyle & HDS_FULLDRAG) {
if (!HEADER_SendHeaderNotifyT (hwnd, HDN_ITEMCHANGINGW, infoPtr->iMoveItem, HDI_WIDTH, NULL))
{
- nWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset;
- if (nWidth < 0)
- nWidth = 0;
- infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
- HEADER_SendHeaderNotifyT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, NULL);
+ HEADER_ITEM *lpItem = &infoPtr->items[infoPtr->iMoveItem];
+ INT nOldWidth = lpItem->rect.right - lpItem->rect.left;
+ RECT rcClient;
+ RECT rcScroll;
+
+ nWidth = pt.x - lpItem->rect.left + infoPtr->xTrackOffset;
+ if (nWidth < 0) nWidth = 0;
+ infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
+ HEADER_SetItemBounds(hwnd);
+
+ GetClientRect(hwnd, &rcClient);
+ rcScroll = rcClient;
+ rcScroll.left = lpItem->rect.left + nOldWidth;
+ ScrollWindowEx(hwnd, nWidth - nOldWidth, 0, &rcScroll, &rcClient, NULL, NULL, 0);
+ InvalidateRect(hwnd, &lpItem->rect, FALSE);
+ UpdateWindow(hwnd);
+
+ HEADER_SendHeaderNotifyT(hwnd, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, NULL);
}
- HEADER_SetItemBounds (hwnd);
- InvalidateRect(hwnd, NULL, FALSE);
}
else {
hdc = GetDC (hwnd);
More information about the wine-cvs
mailing list