Commit 496f434c authored by Susan Farley's avatar Susan Farley Committed by Alexandre Julliard

- Background of the child wnd should be erased with the same color as

the control. - Default scroll amount should be the minimum client area.
parent 53cad8b7
...@@ -529,7 +529,7 @@ PAGER_SetFixedWidth(HWND hwnd, PAGER_INFO* infoPtr) ...@@ -529,7 +529,7 @@ PAGER_SetFixedWidth(HWND hwnd, PAGER_INFO* infoPtr)
infoPtr->nWidth += infoPtr->nButtonSize / 3; infoPtr->nWidth += infoPtr->nButtonSize / 3;
} }
h = wndRect.bottom - wndRect.top; h = wndRect.bottom - wndRect.top + infoPtr->nButtonSize;
/* adjust non-scrollable dimension to fit the child */ /* adjust non-scrollable dimension to fit the child */
SetWindowPos(hwnd, 0, 0,0, infoPtr->nWidth, h, SetWindowPos(hwnd, 0, 0,0, infoPtr->nWidth, h,
...@@ -563,7 +563,7 @@ PAGER_SetFixedHeight(HWND hwnd, PAGER_INFO* infoPtr) ...@@ -563,7 +563,7 @@ PAGER_SetFixedHeight(HWND hwnd, PAGER_INFO* infoPtr)
infoPtr->nHeight += infoPtr->nButtonSize / 3; infoPtr->nHeight += infoPtr->nButtonSize / 3;
} }
w = wndRect.right - wndRect.left; w = wndRect.right - wndRect.left + infoPtr->nButtonSize;
/* adjust non-scrollable dimension to fit the child */ /* adjust non-scrollable dimension to fit the child */
SetWindowPos(hwnd, 0, 0,0, w, infoPtr->nHeight, SetWindowPos(hwnd, 0, 0,0, w, infoPtr->nHeight,
...@@ -607,6 +607,7 @@ PAGER_SetBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -607,6 +607,7 @@ PAGER_SetBkColor (HWND hwnd, WPARAM wParam, LPARAM lParam)
TRACE("[%04x] %06lx\n", hwnd, infoPtr->clrBk); TRACE("[%04x] %06lx\n", hwnd, infoPtr->clrBk);
PAGER_RecalcSize(hwnd); PAGER_RecalcSize(hwnd);
SendMessageA(hwnd, WM_NCPAINT, (WPARAM)0, (LPARAM)0);
return (LRESULT)clrTemp; return (LRESULT)clrTemp;
} }
...@@ -674,6 +675,7 @@ PAGER_Scroll(HWND hwnd, INT dir) ...@@ -674,6 +675,7 @@ PAGER_Scroll(HWND hwnd, INT dir)
{ {
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
NMPGSCROLL nmpgScroll; NMPGSCROLL nmpgScroll;
RECT rcWnd;
if (infoPtr->hwndChild) if (infoPtr->hwndChild)
{ {
...@@ -682,22 +684,22 @@ PAGER_Scroll(HWND hwnd, INT dir) ...@@ -682,22 +684,22 @@ PAGER_Scroll(HWND hwnd, INT dir)
nmpgScroll.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID); nmpgScroll.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmpgScroll.hdr.code = PGN_SCROLL; nmpgScroll.hdr.code = PGN_SCROLL;
GetWindowRect(hwnd, &rcWnd);
GetClientRect(hwnd, &nmpgScroll.rcParent); GetClientRect(hwnd, &nmpgScroll.rcParent);
nmpgScroll.iXpos = nmpgScroll.iYpos = 0; nmpgScroll.iXpos = nmpgScroll.iYpos = 0;
nmpgScroll.iDir = dir; nmpgScroll.iDir = dir;
if (PAGER_IsHorizontal(hwnd)) if (PAGER_IsHorizontal(hwnd))
{ {
nmpgScroll.iScroll = nmpgScroll.rcParent.right - nmpgScroll.iScroll = rcWnd.right - rcWnd.left;
nmpgScroll.rcParent.left;
nmpgScroll.iXpos = infoPtr->nPos; nmpgScroll.iXpos = infoPtr->nPos;
} }
else else
{ {
nmpgScroll.iScroll = nmpgScroll.rcParent.bottom - nmpgScroll.iScroll = rcWnd.bottom - rcWnd.top;
nmpgScroll.rcParent.top;
nmpgScroll.iYpos = infoPtr->nPos; nmpgScroll.iYpos = infoPtr->nPos;
} }
nmpgScroll.iScroll -= 2*infoPtr->nButtonSize;
SendMessageA (hwnd, WM_NOTIFY, SendMessageA (hwnd, WM_NOTIFY,
(WPARAM)nmpgScroll.hdr.idFrom, (LPARAM)&nmpgScroll); (WPARAM)nmpgScroll.hdr.idFrom, (LPARAM)&nmpgScroll);
...@@ -720,8 +722,6 @@ PAGER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -720,8 +722,6 @@ PAGER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
PAGER_INFO *infoPtr; PAGER_INFO *infoPtr;
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE); DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
dwStyle |= WS_CLIPCHILDREN;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (PAGER_INFO *)COMCTL32_Alloc (sizeof(PAGER_INFO)); infoPtr = (PAGER_INFO *)COMCTL32_Alloc (sizeof(PAGER_INFO));
SetWindowLongA (hwnd, 0, (DWORD)infoPtr); SetWindowLongA (hwnd, 0, (DWORD)infoPtr);
...@@ -749,9 +749,11 @@ PAGER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -749,9 +749,11 @@ PAGER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
* the control is initialized, but just in case it isn't, set it here. * the control is initialized, but just in case it isn't, set it here.
*/ */
if (!(dwStyle & PGS_HORZ) && !(dwStyle & PGS_VERT)) if (!(dwStyle & PGS_HORZ) && !(dwStyle & PGS_VERT))
{
dwStyle |= PGS_VERT; dwStyle |= PGS_VERT;
SetWindowLongA(hwnd, GWL_STYLE, dwStyle); SetWindowLongA(hwnd, GWL_STYLE, dwStyle);
}
return 0; return 0;
} }
...@@ -970,14 +972,13 @@ PAGER_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -970,14 +972,13 @@ PAGER_MouseLeave (HWND hwnd, WPARAM wParam, LPARAM lParam)
ReleaseCapture(); ReleaseCapture();
/* Notify parent of released mouse capture */ /* Notify parent of released mouse capture */
if (infoPtr->hwndChild)
{ {
NMHDR nmhdr; NMHDR nmhdr;
ZeroMemory (&nmhdr, sizeof (NMHDR)); ZeroMemory (&nmhdr, sizeof (NMHDR));
nmhdr.hwndFrom = hwnd; nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID); nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmhdr.code = NM_RELEASEDCAPTURE; nmhdr.code = NM_RELEASEDCAPTURE;
SendMessageA (GetParent (infoPtr->hwndChild), WM_NOTIFY, SendMessageA (GetParent(hwnd), WM_NOTIFY,
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr); (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
} }
...@@ -1057,9 +1058,17 @@ PAGER_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1057,9 +1058,17 @@ PAGER_EraseBackground (HWND hwnd, WPARAM wParam, LPARAM lParam)
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd); PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
HBRUSH hBrush = CreateSolidBrush(infoPtr->clrBk); HBRUSH hBrush = CreateSolidBrush(infoPtr->clrBk);
RECT rect; RECT rect;
GetClientRect (hwnd, &rect); GetClientRect (hwnd, &rect);
FillRect ((HDC)wParam, &rect, hBrush);
/* background color of the child should be the same as the pager */
if (infoPtr->hwndChild)
{
GetClientRect (infoPtr->hwndChild, &rect);
FillRect ((HDC)wParam, &rect, hBrush); FillRect ((HDC)wParam, &rect, hBrush);
}
DeleteObject (hBrush); DeleteObject (hBrush);
return TRUE; return TRUE;
} }
......
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