Commit fcd35215 authored by Dave Hawkes's avatar Dave Hawkes Committed by Alexandre Julliard

All standard window controls should have CS_PARENTDC, but should still

clip to the control window.
parent 278b3bcd
...@@ -921,6 +921,8 @@ static void OB_Paint( WND *wndPtr, HDC hDC, WORD action ) ...@@ -921,6 +921,8 @@ static void OB_Paint( WND *wndPtr, HDC hDC, WORD action )
{ {
BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra; BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
DRAWITEMSTRUCT dis; DRAWITEMSTRUCT dis;
HRGN clipRegion;
RECT clipRect;
dis.CtlType = ODT_BUTTON; dis.CtlType = ODT_BUTTON;
dis.CtlID = wndPtr->wIDmenu; dis.CtlID = wndPtr->wIDmenu;
...@@ -934,9 +936,21 @@ static void OB_Paint( WND *wndPtr, HDC hDC, WORD action ) ...@@ -934,9 +936,21 @@ static void OB_Paint( WND *wndPtr, HDC hDC, WORD action )
dis.itemData = 0; dis.itemData = 0;
GetClientRect( wndPtr->hwndSelf, &dis.rcItem ); GetClientRect( wndPtr->hwndSelf, &dis.rcItem );
clipRegion = CreateRectRgnIndirect(&dis.rcItem);
if (GetClipRgn(hDC, clipRegion) != 1)
{
DeleteObject(clipRegion);
clipRegion=(HRGN)NULL;
}
clipRect = dis.rcItem;
DPtoLP(hDC, (LPPOINT) &clipRect, 2);
IntersectClipRect(hDC, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom);
SetBkColor( hDC, GetSysColor( COLOR_BTNFACE ) ); SetBkColor( hDC, GetSysColor( COLOR_BTNFACE ) );
SendMessageA( GetParent(wndPtr->hwndSelf), WM_DRAWITEM, SendMessageA( GetParent(wndPtr->hwndSelf), WM_DRAWITEM,
wndPtr->wIDmenu, (LPARAM)&dis ); wndPtr->wIDmenu, (LPARAM)&dis );
SelectClipRgn(hDC, clipRegion);
} }
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