erase bkgnd on page scroller control
Susan Farley
susan at codeweavers.com
Wed Feb 28 08:46:17 CST 2001
This improves the appearance of the menu bar on IE4, where the
(transparent) toolbar forwards WM_ERASEBKGND to its parent, the
page scroller.
Changelog:
dlls/comctl32/pager.c
* Remove CLIPCHILDREN style so that entire background (including
child's client area) can be erased with the pager control's bkgnd
color.
* Default scroll amount should be the minimum client area.
Susan Farley <susan at codeweavers.com>
-------------- next part --------------
Index: dlls/comctl32/pager.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/pager.c,v
retrieving revision 1.24
diff -u -r1.24 pager.c
--- dlls/comctl32/pager.c 2001/02/23 01:33:01 1.24
+++ dlls/comctl32/pager.c 2001/02/28 15:25:28
@@ -529,7 +529,7 @@
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 */
SetWindowPos(hwnd, 0, 0,0, infoPtr->nWidth, h,
@@ -563,7 +563,7 @@
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 */
SetWindowPos(hwnd, 0, 0,0, w, infoPtr->nHeight,
@@ -674,6 +674,7 @@
{
PAGER_INFO *infoPtr = PAGER_GetInfoPtr (hwnd);
NMPGSCROLL nmpgScroll;
+ RECT rcWnd;
if (infoPtr->hwndChild)
{
@@ -682,22 +683,22 @@
nmpgScroll.hdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmpgScroll.hdr.code = PGN_SCROLL;
+ GetWindowRect(hwnd, &rcWnd);
GetClientRect(hwnd, &nmpgScroll.rcParent);
nmpgScroll.iXpos = nmpgScroll.iYpos = 0;
nmpgScroll.iDir = dir;
if (PAGER_IsHorizontal(hwnd))
{
- nmpgScroll.iScroll = nmpgScroll.rcParent.right -
- nmpgScroll.rcParent.left;
+ nmpgScroll.iScroll = rcWnd.right - rcWnd.left;
nmpgScroll.iXpos = infoPtr->nPos;
}
else
{
- nmpgScroll.iScroll = nmpgScroll.rcParent.bottom -
- nmpgScroll.rcParent.top;
+ nmpgScroll.iScroll = rcWnd.bottom - rcWnd.top;
nmpgScroll.iYpos = infoPtr->nPos;
}
+ nmpgScroll.iScroll -= 2*infoPtr->nButtonSize;
SendMessageA (hwnd, WM_NOTIFY,
(WPARAM)nmpgScroll.hdr.idFrom, (LPARAM)&nmpgScroll);
@@ -720,7 +721,8 @@
PAGER_INFO *infoPtr;
DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
- dwStyle |= WS_CLIPCHILDREN;
+ /* background color of the child should be the same as the pager */
+ dwStyle &= ~WS_CLIPCHILDREN;
/* allocate memory for info structure */
infoPtr = (PAGER_INFO *)COMCTL32_Alloc (sizeof(PAGER_INFO));
@@ -970,14 +972,13 @@
ReleaseCapture();
/* Notify parent of released mouse capture */
- if (infoPtr->hwndChild)
{
NMHDR nmhdr;
ZeroMemory (&nmhdr, sizeof (NMHDR));
nmhdr.hwndFrom = hwnd;
nmhdr.idFrom = GetWindowLongA (hwnd, GWL_ID);
nmhdr.code = NM_RELEASEDCAPTURE;
- SendMessageA (GetParent (infoPtr->hwndChild), WM_NOTIFY,
+ SendMessageA (GetParent(hwnd), WM_NOTIFY,
(WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr);
}
More information about the wine-patches
mailing list