Use correct font for ownerdraw buttons.

This commit is contained in:
Michael Kaufmann 2004-08-20 19:23:46 +00:00 committed by Alexandre Julliard
parent 5ae2835e82
commit e79381f586
1 changed files with 3 additions and 0 deletions

View File

@ -1035,6 +1035,7 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
RECT clipRect; RECT clipRect;
LONG_PTR id = GetWindowLongPtrA( hwnd, GWLP_ID ); LONG_PTR id = GetWindowLongPtrA( hwnd, GWLP_ID );
HWND parent; HWND parent;
HFONT hFont, hPrevFont = 0;
dis.CtlType = ODT_BUTTON; dis.CtlType = ODT_BUTTON;
dis.CtlID = id; dis.CtlID = id;
@ -1058,9 +1059,11 @@ static void OB_Paint( HWND hwnd, HDC hDC, UINT action )
DPtoLP(hDC, (LPPOINT) &clipRect, 2); DPtoLP(hDC, (LPPOINT) &clipRect, 2);
IntersectClipRect(hDC, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom); IntersectClipRect(hDC, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom);
if ((hFont = get_button_font( hwnd ))) hPrevFont = SelectObject( hDC, hFont );
parent = GetParent(hwnd); parent = GetParent(hwnd);
if (!parent) parent = hwnd; if (!parent) parent = hwnd;
SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd ); SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd );
SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis ); SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
if (hPrevFont) SelectObject(hDC, hPrevFont);
SelectClipRgn(hDC, clipRegion); SelectClipRgn(hDC, clipRegion);
} }