Fixed some quirks (range is 32 bit, page up/dn mismatch on HZ trackbars).

This commit is contained in:
Eric Pouech 2000-05-11 21:42:12 +00:00 committed by Alexandre Julliard
parent fc63491d6c
commit 051cccee06

View File

@ -100,7 +100,7 @@ TRACKBAR_ConvertPlaceToPosition (TRACKBAR_INFO *infoPtr, int place,
width=infoPtr->rcChannel.right - infoPtr->rcChannel.left; width=infoPtr->rcChannel.right - infoPtr->rcChannel.left;
pos=(range*(place - infoPtr->rcChannel.left)) / width; pos=(range*(place - infoPtr->rcChannel.left)) / width;
} }
pos+=infoPtr->nRangeMin;
if (pos > infoPtr->nRangeMax) if (pos > infoPtr->nRangeMax)
pos = infoPtr->nRangeMax; pos = infoPtr->nRangeMax;
else if (pos < infoPtr->nRangeMin) else if (pos < infoPtr->nRangeMin)
@ -794,7 +794,7 @@ TRACKBAR_SetPos (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd); TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
infoPtr->nPos = (INT)LOWORD(lParam); infoPtr->nPos = (INT)lParam;
if (infoPtr->nPos < infoPtr->nRangeMin) if (infoPtr->nPos < infoPtr->nRangeMin)
infoPtr->nPos = infoPtr->nRangeMin; infoPtr->nPos = infoPtr->nRangeMin;
@ -1149,7 +1149,7 @@ TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
SetFocus (hwnd); SetFocus (hwnd);
vertical = dwStyle & TBS_VERT; vertical = (dwStyle & TBS_VERT) ? 1 : 0;
if (vertical) if (vertical)
clickPlace=(INT)HIWORD(lParam); clickPlace=(INT)HIWORD(lParam);
else else
@ -1185,7 +1185,7 @@ TRACKBAR_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
clickPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace, vertical); clickPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace, vertical);
prevPos = infoPtr->nPos; prevPos = infoPtr->nPos;
if (clickPos > prevPos) { /* similar to VK_NEXT */ if (vertical ^ (clickPos < (int)prevPos)) { /* similar to VK_NEXT */
infoPtr->nPos += infoPtr->nPageSize; infoPtr->nPos += infoPtr->nPageSize;
if (infoPtr->nPos > infoPtr->nRangeMax) if (infoPtr->nPos > infoPtr->nRangeMax)
infoPtr->nPos = infoPtr->nRangeMax; infoPtr->nPos = infoPtr->nRangeMax;