mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[COMCTL32]
- Button, Trakbar: Send WM_CTLCOLORBTN or WM_CTLCOLORSTATIC and use their return value to paint the control despite the fact that DrawThemeParentBackground was called as well. Part of the fix for CORE-12978 svn path=/trunk/; revision=74406
This commit is contained in:
parent
83e0dd0595
commit
e9846d6f9c
2 changed files with 41 additions and 5 deletions
|
@ -113,6 +113,8 @@ static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
WCHAR *text = get_button_text(hwnd);
|
WCHAR *text = get_button_text(hwnd);
|
||||||
PBUTTON_DATA pdata = _GetButtonData(hwnd);
|
PBUTTON_DATA pdata = _GetButtonData(hwnd);
|
||||||
SIZE ImageSize;
|
SIZE ImageSize;
|
||||||
|
HWND parent;
|
||||||
|
HBRUSH hBrush;
|
||||||
|
|
||||||
GetClientRect(hwnd, &bgRect);
|
GetClientRect(hwnd, &bgRect);
|
||||||
GetThemeBackgroundContentRect(theme, hDC, BP_PUSHBUTTON, state, &bgRect, &textRect);
|
GetThemeBackgroundContentRect(theme, hDC, BP_PUSHBUTTON, state, &bgRect, &textRect);
|
||||||
|
@ -123,6 +125,11 @@ static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
DrawThemeParentBackground(hwnd, hDC, NULL);
|
DrawThemeParentBackground(hwnd, hDC, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parent = GetParent(hwnd);
|
||||||
|
if (!parent) parent = hwnd;
|
||||||
|
hBrush = (HBRUSH)SendMessageW( parent, WM_CTLCOLORBTN, (WPARAM)hDC, (LPARAM)hwnd );
|
||||||
|
FillRect( hDC, &bgRect, hBrush );
|
||||||
|
|
||||||
DrawThemeBackground(theme, hDC, BP_PUSHBUTTON, state, &bgRect, NULL);
|
DrawThemeBackground(theme, hDC, BP_PUSHBUTTON, state, &bgRect, NULL);
|
||||||
|
|
||||||
if (pdata->imlData.himl && ImageList_GetIconSize(pdata->imlData.himl, &ImageSize.cx, &ImageSize.cy))
|
if (pdata->imlData.himl && ImageList_GetIconSize(pdata->imlData.himl, &ImageSize.cx, &ImageSize.cy))
|
||||||
|
@ -186,6 +193,8 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
WCHAR *text = get_button_text(hwnd);
|
WCHAR *text = get_button_text(hwnd);
|
||||||
LOGFONTW lf;
|
LOGFONTW lf;
|
||||||
BOOL created_font = FALSE;
|
BOOL created_font = FALSE;
|
||||||
|
HWND parent;
|
||||||
|
HBRUSH hBrush;
|
||||||
|
|
||||||
HRESULT hr = GetThemeFont(theme, hDC, part, state, TMT_FONT, &lf);
|
HRESULT hr = GetThemeFont(theme, hDC, part, state, TMT_FONT, &lf);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
|
@ -206,6 +215,21 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
sz.cx = sz.cy = 13;
|
sz.cx = sz.cy = 13;
|
||||||
|
|
||||||
GetClientRect(hwnd, &bgRect);
|
GetClientRect(hwnd, &bgRect);
|
||||||
|
|
||||||
|
if (prfFlag == 0)
|
||||||
|
{
|
||||||
|
DrawThemeParentBackground(hwnd, hDC, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
parent = GetParent(hwnd);
|
||||||
|
if (!parent) parent = hwnd;
|
||||||
|
hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC,
|
||||||
|
(WPARAM)hDC, (LPARAM)hwnd);
|
||||||
|
if (!hBrush) /* did the app forget to call defwindowproc ? */
|
||||||
|
hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
|
||||||
|
(WPARAM)hDC, (LPARAM)hwnd );
|
||||||
|
FillRect( hDC, &bgRect, hBrush );
|
||||||
|
|
||||||
GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect);
|
GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect);
|
||||||
|
|
||||||
if (dtFlags & DT_SINGLELINE) /* Center the checkbox / radio button to the text. */
|
if (dtFlags & DT_SINGLELINE) /* Center the checkbox / radio button to the text. */
|
||||||
|
@ -216,11 +240,6 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
bgRect.right = bgRect.left + sz.cx;
|
bgRect.right = bgRect.left + sz.cx;
|
||||||
textRect.left = bgRect.right + 6;
|
textRect.left = bgRect.right + 6;
|
||||||
|
|
||||||
if (prfFlag == 0)
|
|
||||||
{
|
|
||||||
DrawThemeParentBackground(hwnd, hDC, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
DrawThemeBackground(theme, hDC, part, state, &bgRect, NULL);
|
DrawThemeBackground(theme, hDC, part, state, &bgRect, NULL);
|
||||||
if (text)
|
if (text)
|
||||||
{
|
{
|
||||||
|
@ -257,6 +276,9 @@ static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
LOGFONTW lf;
|
LOGFONTW lf;
|
||||||
HFONT font, hPrevFont = NULL;
|
HFONT font, hPrevFont = NULL;
|
||||||
BOOL created_font = FALSE;
|
BOOL created_font = FALSE;
|
||||||
|
HWND parent;
|
||||||
|
HBRUSH hBrush;
|
||||||
|
RECT clientRect;
|
||||||
|
|
||||||
HRESULT hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf);
|
HRESULT hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
|
@ -296,6 +318,16 @@ static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
|
||||||
DrawThemeParentBackground(hwnd, hDC, NULL);
|
DrawThemeParentBackground(hwnd, hDC, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parent = GetParent(hwnd);
|
||||||
|
if (!parent) parent = hwnd;
|
||||||
|
hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC,
|
||||||
|
(WPARAM)hDC, (LPARAM)hwnd);
|
||||||
|
if (!hBrush) /* did the app forget to call defwindowproc ? */
|
||||||
|
hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC,
|
||||||
|
(WPARAM)hDC, (LPARAM)hwnd );
|
||||||
|
GetClientRect(hwnd, &clientRect);
|
||||||
|
FillRect( hDC, &clientRect, hBrush );
|
||||||
|
|
||||||
DrawThemeBackground(theme, hDC, BP_GROUPBOX, state, &bgRect, NULL);
|
DrawThemeBackground(theme, hDC, BP_GROUPBOX, state, &bgRect, NULL);
|
||||||
|
|
||||||
SelectClipRgn(hDC, NULL);
|
SelectClipRgn(hDC, NULL);
|
||||||
|
|
|
@ -938,7 +938,11 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
|
||||||
if (GetWindowTheme (infoPtr->hwndSelf)) {
|
if (GetWindowTheme (infoPtr->hwndSelf)) {
|
||||||
DrawThemeParentBackground (infoPtr->hwndSelf, hdc, 0);
|
DrawThemeParentBackground (infoPtr->hwndSelf, hdc, 0);
|
||||||
}
|
}
|
||||||
|
#ifndef __REACTOS__
|
||||||
else {
|
else {
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
#endif
|
||||||
HBRUSH brush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC,
|
HBRUSH brush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC,
|
||||||
(WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
|
(WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
|
||||||
FillRect (hdc, &rcClient, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
|
FillRect (hdc, &rcClient, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
|
||||||
|
|
Loading…
Reference in a new issue