From 051cccee06ed5d02d510219c4ebafe609f9c2a9b Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Thu, 11 May 2000 21:42:12 +0000 Subject: [PATCH] Fixed some quirks (range is 32 bit, page up/dn mismatch on HZ trackbars). --- dlls/comctl32/trackbar.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 2b786d22c72..dbcf2f3e90d 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -100,7 +100,7 @@ TRACKBAR_ConvertPlaceToPosition (TRACKBAR_INFO *infoPtr, int place, width=infoPtr->rcChannel.right - infoPtr->rcChannel.left; pos=(range*(place - infoPtr->rcChannel.left)) / width; } - + pos+=infoPtr->nRangeMin; if (pos > infoPtr->nRangeMax) pos = infoPtr->nRangeMax; else if (pos < infoPtr->nRangeMin) @@ -794,7 +794,7 @@ TRACKBAR_SetPos (HWND hwnd, WPARAM wParam, LPARAM lParam) { TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd); - infoPtr->nPos = (INT)LOWORD(lParam); + infoPtr->nPos = (INT)lParam; if (infoPtr->nPos < infoPtr->nRangeMin) infoPtr->nPos = infoPtr->nRangeMin; @@ -1149,7 +1149,7 @@ TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) SetFocus (hwnd); - vertical = dwStyle & TBS_VERT; + vertical = (dwStyle & TBS_VERT) ? 1 : 0; if (vertical) clickPlace=(INT)HIWORD(lParam); else @@ -1185,7 +1185,7 @@ TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam) clickPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace, vertical); prevPos = infoPtr->nPos; - if (clickPos > prevPos) { /* similar to VK_NEXT */ + if (vertical ^ (clickPos < (int)prevPos)) { /* similar to VK_NEXT */ infoPtr->nPos += infoPtr->nPageSize; if (infoPtr->nPos > infoPtr->nRangeMax) infoPtr->nPos = infoPtr->nRangeMax;