From e84b67840857600820dfc3b92d80b03a83cff735 Mon Sep 17 00:00:00 2001 From: Luc Tourangeau Date: Mon, 7 Feb 2000 16:01:04 +0000 Subject: [PATCH] Implementation of Static OwnerDraw. --- controls/static.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/controls/static.c b/controls/static.c index 87a63452151..f67467ce5ea 100644 --- a/controls/static.c +++ b/controls/static.c @@ -15,6 +15,7 @@ DEFAULT_DEBUG_CHANNEL(static) +static void STATIC_PaintOwnerDrawfn( WND *wndPtr, HDC hdc ); static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc ); static void STATIC_PaintRectfn( WND *wndPtr, HDC hdc ); static void STATIC_PaintIconfn( WND *wndPtr, HDC hdc ); @@ -41,7 +42,7 @@ static pfPaint staticPaintFunc[SS_TYPEMASK+1] = NULL, /* Not defined */ STATIC_PaintTextfn, /* SS_SIMPLE */ STATIC_PaintTextfn, /* SS_LEFTNOWORDWRAP */ - NULL, /* SS_OWNERDRAW */ + STATIC_PaintOwnerDrawfn, /* SS_OWNERDRAW */ STATIC_PaintBitmapfn, /* SS_BITMAP */ NULL, /* SS_ENHMETAFILE */ STATIC_PaintEtchedfn, /* SS_ETCHEDHORIZ */ @@ -334,6 +335,25 @@ END: return lResult; } +static void STATIC_PaintOwnerDrawfn( WND *wndPtr, HDC hdc ) +{ + DRAWITEMSTRUCT dis; + + dis.CtlType = ODT_STATIC; + dis.CtlID = wndPtr->wIDmenu; + dis.itemID = 0; + dis.itemAction = ODA_DRAWENTIRE; + dis.itemState = 0; + dis.hwndItem = wndPtr->hwndSelf; + dis.hDC = hdc; + dis.itemData = 0; + GetClientRect( wndPtr->hwndSelf, &dis.rcItem ); + + SendMessageA( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC, + hdc, wndPtr->hwndSelf ); + SendMessageA( GetParent(wndPtr->hwndSelf), WM_DRAWITEM, + wndPtr->wIDmenu, (LPARAM)&dis ); +} static void STATIC_PaintTextfn( WND *wndPtr, HDC hdc ) {