From 64e5779c16aa364f1bc293874c00b81b11daf1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Zalewski?= Date: Mon, 22 May 2006 22:47:37 +0200 Subject: [PATCH] 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 file changed, 18 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index 38d752ef26..6696e25724 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -1657,14 +1657,25 @@ HEADER_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam) 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);