Michael Kaufmann : user: Improve the ownerdraw support of the static control.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 10 14:13:48 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 7ff2a68459ca30de1e75bacf64833ac589d08896
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=7ff2a68459ca30de1e75bacf64833ac589d08896

Author: Michael Kaufmann <hallo at michael-kaufmann.ch>
Date:   Tue Jan 10 12:07:57 2006 +0100

user: Improve the ownerdraw support of the static control.

---

 dlls/user/static.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/user/static.c b/dlls/user/static.c
index 3e6b520..082be9f 100644
--- a/dlls/user/static.c
+++ b/dlls/user/static.c
@@ -480,20 +480,24 @@ static LRESULT WINAPI StaticWndProcW( HW
 static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style )
 {
   DRAWITEMSTRUCT dis;
+  HFONT font, oldFont = NULL;
   UINT id = (UINT)GetWindowLongPtrW( hwnd, GWLP_ID );
 
   dis.CtlType    = ODT_STATIC;
   dis.CtlID      = id;
   dis.itemID     = 0;
   dis.itemAction = ODA_DRAWENTIRE;
-  dis.itemState  = 0;
+  dis.itemState  = IsWindowEnabled(hwnd) ? 0 : ODS_DISABLED;
   dis.hwndItem   = hwnd;
   dis.hDC        = hdc;
   dis.itemData   = 0;
   GetClientRect( hwnd, &dis.rcItem );
 
+  font = (HFONT)GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET );
+  if (font) oldFont = SelectObject( hdc, font );
   SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd );
   SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
+  if (font) SelectObject( hdc, oldFont );
 }
 
 static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style )




More information about the wine-cvs mailing list