Commit e508eae7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32: Update ticks on TBM_SETRANGE.

parent 11de98be
......@@ -1034,6 +1034,15 @@ static void test_TBS_AUTOTICKS(void)
ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0);
expect(91, ret);
ret = SendMessage(hWnd, TBM_SETRANGEMIN, TRUE, 0);
expect(0, ret);
/* TBM_SETRANGE rebuilds tics */
ret = SendMessage(hWnd, TBM_SETRANGE, TRUE, MAKELONG(10, 200));
expect(0, ret);
ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0);
expect(191, ret);
DestroyWindow(hWnd);
}
......
......@@ -1151,10 +1151,13 @@ TRACKBAR_SetPos (TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition)
static inline LRESULT
TRACKBAR_SetRange (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lRange)
TRACKBAR_SetRange (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG range)
{
infoPtr->lRangeMin = (SHORT)LOWORD(lRange);
infoPtr->lRangeMax = (SHORT)HIWORD(lRange);
BOOL changed = infoPtr->lRangeMin != (SHORT)LOWORD(range) ||
infoPtr->lRangeMax != (SHORT)HIWORD(range);
infoPtr->lRangeMin = (SHORT)LOWORD(range);
infoPtr->lRangeMax = (SHORT)HIWORD(range);
if (infoPtr->lPos < infoPtr->lRangeMin) {
infoPtr->lPos = infoPtr->lRangeMin;
......@@ -1169,7 +1172,10 @@ TRACKBAR_SetRange (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lRange)
infoPtr->lPageSize = (infoPtr->lRangeMax - infoPtr->lRangeMin) / 5;
if (infoPtr->lPageSize == 0) infoPtr->lPageSize = 1;
if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
if (changed && (infoPtr->dwStyle & TBS_AUTOTICKS))
TRACKBAR_RecalculateTics (infoPtr);
if (redraw) TRACKBAR_InvalidateAll(infoPtr);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment