Nikolay Sivov : comctl32/syslink: Implement LWS_TRANSPARENT style.
Alexandre Julliard
julliard at winehq.org
Wed Oct 21 13:14:04 CDT 2009
Module: wine
Branch: master
Commit: b853de803877bd471b9a0397289be711c0fad1c8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b853de803877bd471b9a0397289be711c0fad1c8
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Tue Oct 20 21:54:40 2009 +0400
comctl32/syslink: Implement LWS_TRANSPARENT style.
---
dlls/comctl32/syslink.c | 9 +++++++--
include/commctrl.h | 3 +++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c
index 1b940c0..a1a6039 100644
--- a/dlls/comctl32/syslink.c
+++ b/dlls/comctl32/syslink.c
@@ -94,6 +94,7 @@ typedef struct
COLORREF TextColor; /* Color of the text */
COLORREF LinkColor; /* Color of links */
COLORREF VisitedColor; /* Color of visited links */
+ COLORREF BackColor; /* Background color, set on creation */
WCHAR BreakChar; /* Break Character for the current font */
} SYSLINK_INFO;
@@ -831,7 +832,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
hOldFont = SelectObject(hdc, infoPtr->Font);
OldTextColor = SetTextColor(hdc, infoPtr->TextColor);
- OldBkColor = SetBkColor(hdc, comctl32_color.clrBtnFace);
+ OldBkColor = SetBkColor(hdc, infoPtr->BackColor);
GetClientRect(infoPtr->Self, &rc);
rc.right -= SL_RIGHTMARGIN + SL_LEFTMARGIN;
@@ -916,7 +917,7 @@ static LRESULT SYSLINK_EraseBkgnd (const SYSLINK_INFO *infoPtr, HDC hdc)
RECT r;
GetClientRect(infoPtr->Self, &r);
- hbr = CreateSolidBrush(comctl32_color.clrBtnFace);
+ hbr = CreateSolidBrush(infoPtr->BackColor);
FillRect(hdc, &r, hbr);
DeleteObject(hbr);
@@ -1749,6 +1750,8 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
infoPtr->TextColor = comctl32_color.clrWindowText;
infoPtr->LinkColor = comctl32_color.clrHighlight;
infoPtr->VisitedColor = comctl32_color.clrHighlight;
+ infoPtr->BackColor = infoPtr->Style & LWS_TRANSPARENT ?
+ comctl32_color.clrWindow : comctl32_color.clrBtnFace;
infoPtr->BreakChar = ' ';
TRACE("SysLink Ctrl creation, hwnd=%p\n", hwnd);
SYSLINK_SetText(infoPtr, ((LPCREATESTRUCTW)lParam)->lpszName);
@@ -1765,6 +1768,8 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors();
+ if (infoPtr->Style & LWS_TRANSPARENT)
+ infoPtr->BackColor = comctl32_color.clrWindow;
return 0;
default:
diff --git a/include/commctrl.h b/include/commctrl.h
index b8ebe94..ffda1f1 100644
--- a/include/commctrl.h
+++ b/include/commctrl.h
@@ -5052,6 +5052,9 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *, LPCWSTR);
static const WCHAR WC_LINK[] = { 'S','y','s','L','i','n','k',0 };
#endif
+/* SysLink styles */
+#define LWS_TRANSPARENT 0x0001
+
/* SysLink messages */
#define LM_HITTEST (WM_USER + 768)
#define LM_GETIDEALHEIGHT (WM_USER + 769)
More information about the wine-cvs
mailing list