TRACE("[%p] SWP %dx%d at (%d,%d)\n", infoPtr->hwndSelf,
infoPtr->nWidth, infoPtr->nHeight,
-nPos, 0);
- SetWindowPos(infoPtr->hwndChild, 0,
+ SetWindowPos(infoPtr->hwndChild, HWND_TOP,
-nPos, 0,
- infoPtr->nWidth, infoPtr->nHeight,
- SWP_NOZORDER);
+ infoPtr->nWidth, infoPtr->nHeight, 0);
}
else
{
TRACE("[%p] SWP %dx%d at (%d,%d)\n", infoPtr->hwndSelf,
infoPtr->nWidth, infoPtr->nHeight,
0, -nPos);
- SetWindowPos(infoPtr->hwndChild, 0,
+ SetWindowPos(infoPtr->hwndChild, HWND_TOP,
0, -nPos,
- infoPtr->nWidth, infoPtr->nHeight,
- SWP_NOZORDER);
+ infoPtr->nWidth, infoPtr->nHeight, 0);
}
InvalidateRect(infoPtr->hwndChild, NULL, TRUE);
}
static INT
-PAGER_GetScrollRange(PAGER_INFO* infoPtr)
+PAGER_GetScrollRange(PAGER_INFO* infoPtr, BOOL calc_size)
{
INT scrollRange = 0;
RECT wndRect;
GetWindowRect(infoPtr->hwndSelf, &wndRect);
- PAGER_CalcSize(infoPtr);
+ if (calc_size)
+ PAGER_CalcSize(infoPtr);
if (infoPtr->dwStyle & PGS_HORZ)
{
wndSize = wndRect.right - wndRect.left;
}
static LRESULT
-PAGER_SetPos(PAGER_INFO* infoPtr, INT newPos, BOOL fromBtnPress)
+PAGER_SetPos(PAGER_INFO* infoPtr, INT newPos, BOOL fromBtnPress, BOOL calc_size)
{
- INT scrollRange = PAGER_GetScrollRange(infoPtr);
+ INT scrollRange = PAGER_GetScrollRange(infoPtr, calc_size);
INT oldPos = infoPtr->nPos;
if ((scrollRange <= 0) || (newPos < 0))
if (infoPtr->hwndChild)
{
- INT scrollRange = PAGER_GetScrollRange(infoPtr);
+ INT scrollRange = PAGER_GetScrollRange(infoPtr, TRUE);
if (scrollRange <= 0)
{
infoPtr->nPos = -1;
- PAGER_SetPos(infoPtr, 0, FALSE);
+ PAGER_SetPos(infoPtr, 0, FALSE, TRUE);
}
else
PAGER_PositionChildWnd(infoPtr);
SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, 0, 0,
SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
- /* position child within the page scroller */
- SetWindowPos(infoPtr->hwndChild, HWND_TOP,
- 0,0,0,0,
- SWP_SHOWWINDOW | SWP_NOSIZE); /* native is 0 */
-
infoPtr->nPos = -1;
- PAGER_SetPos(infoPtr, 0, FALSE);
+ PAGER_SetPos(infoPtr, 0, FALSE, FALSE);
}
return 0;
infoPtr->direction = dir;
if (dir == PGF_SCROLLLEFT || dir == PGF_SCROLLUP)
- PAGER_SetPos(infoPtr, infoPtr->nPos - nmpgScroll.iScroll, TRUE);
+ PAGER_SetPos(infoPtr, infoPtr->nPos - nmpgScroll.iScroll, TRUE, TRUE);
else
- PAGER_SetPos(infoPtr, infoPtr->nPos + nmpgScroll.iScroll, TRUE);
+ PAGER_SetPos(infoPtr, infoPtr->nPos + nmpgScroll.iScroll, TRUE, TRUE);
}
else
infoPtr->direction = -1;
return PAGER_SetChild (infoPtr, (HWND)lParam);
case PGM_SETPOS:
- return PAGER_SetPos(infoPtr, (INT)lParam, FALSE);
+ return PAGER_SetPos(infoPtr, (INT)lParam, FALSE, TRUE);
case WM_CREATE:
return PAGER_Create (hwnd, (LPCREATESTRUCTW)lParam);