comctl32: trackbar: Return the correct number of tics for TBM_GETNUMTICS.

This commit is contained in:
Keith Stevens 2007-03-15 22:11:14 -07:00 committed by Alexandre Julliard
parent de608991ea
commit 3a58b51aa3
2 changed files with 8 additions and 7 deletions

View File

@ -775,12 +775,10 @@ static void test_tic_settings(HWND hWndTrackbar){
SendMessage(hWndTrackbar, TBM_SETRANGE, TRUE, MAKELONG(0, 10));
SendMessage(hWndTrackbar, TBM_SETTICFREQ, 2, 0);
r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0,0);
todo_wine{
expect(6, r);
SendMessage(hWndTrackbar, TBM_SETTICFREQ, 5, 0);
r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0,0);
expect(3, r);
}
expect(6, r);
SendMessage(hWndTrackbar, TBM_SETTICFREQ, 5, 0);
r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0,0);
expect(3, r);
SendMessage(hWndTrackbar, TBM_SETTICFREQ, 15, 0);
r = SendMessage(hWndTrackbar, TBM_GETNUMTICS, 0,0);
expect(2, r);

View File

@ -1042,7 +1042,10 @@ TRACKBAR_GetNumTics (TRACKBAR_INFO *infoPtr)
if (GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TBS_NOTICKS)
return 0;
return infoPtr->uNumTics + 2;
if(infoPtr->uNumTics == 0)
return 2;
else
return infoPtr->uNumTics + 1;
}