comctl32/syslink: Implement LWS_TRANSPARENT style.

This commit is contained in:
Nikolay Sivov 2009-10-20 21:54:40 +04:00 committed by Alexandre Julliard
parent 92c2d8afcd
commit b853de8038
2 changed files with 10 additions and 2 deletions

View File

@ -94,6 +94,7 @@ typedef struct
COLORREF TextColor; /* Color of the text */ COLORREF TextColor; /* Color of the text */
COLORREF LinkColor; /* Color of links */ COLORREF LinkColor; /* Color of links */
COLORREF VisitedColor; /* Color of visited links */ COLORREF VisitedColor; /* Color of visited links */
COLORREF BackColor; /* Background color, set on creation */
WCHAR BreakChar; /* Break Character for the current font */ WCHAR BreakChar; /* Break Character for the current font */
} SYSLINK_INFO; } SYSLINK_INFO;
@ -831,7 +832,7 @@ static LRESULT SYSLINK_Draw (const SYSLINK_INFO *infoPtr, HDC hdc)
hOldFont = SelectObject(hdc, infoPtr->Font); hOldFont = SelectObject(hdc, infoPtr->Font);
OldTextColor = SetTextColor(hdc, infoPtr->TextColor); OldTextColor = SetTextColor(hdc, infoPtr->TextColor);
OldBkColor = SetBkColor(hdc, comctl32_color.clrBtnFace); OldBkColor = SetBkColor(hdc, infoPtr->BackColor);
GetClientRect(infoPtr->Self, &rc); GetClientRect(infoPtr->Self, &rc);
rc.right -= SL_RIGHTMARGIN + SL_LEFTMARGIN; rc.right -= SL_RIGHTMARGIN + SL_LEFTMARGIN;
@ -916,7 +917,7 @@ static LRESULT SYSLINK_EraseBkgnd (const SYSLINK_INFO *infoPtr, HDC hdc)
RECT r; RECT r;
GetClientRect(infoPtr->Self, &r); GetClientRect(infoPtr->Self, &r);
hbr = CreateSolidBrush(comctl32_color.clrBtnFace); hbr = CreateSolidBrush(infoPtr->BackColor);
FillRect(hdc, &r, hbr); FillRect(hdc, &r, hbr);
DeleteObject(hbr); DeleteObject(hbr);
@ -1749,6 +1750,8 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
infoPtr->TextColor = comctl32_color.clrWindowText; infoPtr->TextColor = comctl32_color.clrWindowText;
infoPtr->LinkColor = comctl32_color.clrHighlight; infoPtr->LinkColor = comctl32_color.clrHighlight;
infoPtr->VisitedColor = comctl32_color.clrHighlight; infoPtr->VisitedColor = comctl32_color.clrHighlight;
infoPtr->BackColor = infoPtr->Style & LWS_TRANSPARENT ?
comctl32_color.clrWindow : comctl32_color.clrBtnFace;
infoPtr->BreakChar = ' '; infoPtr->BreakChar = ' ';
TRACE("SysLink Ctrl creation, hwnd=%p\n", hwnd); TRACE("SysLink Ctrl creation, hwnd=%p\n", hwnd);
SYSLINK_SetText(infoPtr, ((LPCREATESTRUCTW)lParam)->lpszName); SYSLINK_SetText(infoPtr, ((LPCREATESTRUCTW)lParam)->lpszName);
@ -1765,6 +1768,8 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
case WM_SYSCOLORCHANGE: case WM_SYSCOLORCHANGE:
COMCTL32_RefreshSysColors(); COMCTL32_RefreshSysColors();
if (infoPtr->Style & LWS_TRANSPARENT)
infoPtr->BackColor = comctl32_color.clrWindow;
return 0; return 0;
default: default:

View File

@ -5052,6 +5052,9 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *, LPCWSTR);
static const WCHAR WC_LINK[] = { 'S','y','s','L','i','n','k',0 }; static const WCHAR WC_LINK[] = { 'S','y','s','L','i','n','k',0 };
#endif #endif
/* SysLink styles */
#define LWS_TRANSPARENT 0x0001
/* SysLink messages */ /* SysLink messages */
#define LM_HITTEST (WM_USER + 768) #define LM_HITTEST (WM_USER + 768)
#define LM_GETIDEALHEIGHT (WM_USER + 769) #define LM_GETIDEALHEIGHT (WM_USER + 769)