comctl32: Update ticks on TBM_SETRANGEMIN.
This commit is contained in:
parent
abde0c21e3
commit
11de98be34
|
@ -993,6 +993,12 @@ static void test_initial_state(void)
|
|||
ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0);
|
||||
expect(2, ret);
|
||||
|
||||
ret = SendMessage(hWnd, TBM_SETRANGEMIN, TRUE, 10);
|
||||
expect(0, ret);
|
||||
|
||||
ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0);
|
||||
expect(2, ret);
|
||||
|
||||
DestroyWindow(hWnd);
|
||||
}
|
||||
|
||||
|
@ -1014,12 +1020,20 @@ static void test_TBS_AUTOTICKS(void)
|
|||
ret = SendMessage(hWnd, TBM_GETRANGEMAX, 0, 0);
|
||||
expect(100, ret);
|
||||
|
||||
/* TBM_SETRANGEMAX rebuilds tics */
|
||||
ret = SendMessage(hWnd, TBM_SETRANGEMAX, TRUE, 200);
|
||||
expect(0, ret);
|
||||
|
||||
ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0);
|
||||
expect(201, ret);
|
||||
|
||||
/* TBM_SETRANGEMIN rebuilds tics */
|
||||
ret = SendMessage(hWnd, TBM_SETRANGEMAX, TRUE, 100);
|
||||
expect(0, ret);
|
||||
ret = SendMessage(hWnd, TBM_SETRANGEMIN, TRUE, 10);
|
||||
expect(0, ret);
|
||||
ret = SendMessage(hWnd, TBM_GETNUMTICS, 0, 0);
|
||||
expect(91, ret);
|
||||
|
||||
DestroyWindow(hWnd);
|
||||
}
|
||||
|
||||
|
|
|
@ -1199,8 +1199,10 @@ TRACKBAR_SetRangeMax (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMax)
|
|||
|
||||
|
||||
static inline LRESULT
|
||||
TRACKBAR_SetRangeMin (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lMin)
|
||||
TRACKBAR_SetRangeMin (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMin)
|
||||
{
|
||||
BOOL changed = infoPtr->lRangeMin != lMin;
|
||||
|
||||
infoPtr->lRangeMin = lMin;
|
||||
if (infoPtr->lPos < infoPtr->lRangeMin) {
|
||||
infoPtr->lPos = infoPtr->lRangeMin;
|
||||
|
@ -1210,7 +1212,10 @@ TRACKBAR_SetRangeMin (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lMin)
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue