don't always erase the background ourselves as this is incompatible with XP themed appearance (replaces patch 1046164)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -165,7 +165,6 @@ public:
|
|||||||
// event handlers
|
// event handlers
|
||||||
// --------------
|
// --------------
|
||||||
|
|
||||||
void OnEraseBackground(wxEraseEvent& event);
|
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
#ifdef __WXWINCE__
|
#ifdef __WXWINCE__
|
||||||
void OnInitDialog( wxInitDialogEvent& event );
|
void OnInitDialog( wxInitDialogEvent& event );
|
||||||
|
@@ -332,7 +332,6 @@ wxCONSTRUCTOR_DUMMY(wxWindow)
|
|||||||
#endif // __WXUNIVERSAL__/__WXMSW__
|
#endif // __WXUNIVERSAL__/__WXMSW__
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxWindowMSW, wxWindowBase)
|
BEGIN_EVENT_TABLE(wxWindowMSW, wxWindowBase)
|
||||||
EVT_ERASE_BACKGROUND(wxWindowMSW::OnEraseBackground)
|
|
||||||
EVT_SYS_COLOUR_CHANGED(wxWindowMSW::OnSysColourChanged)
|
EVT_SYS_COLOUR_CHANGED(wxWindowMSW::OnSysColourChanged)
|
||||||
#ifdef __WXWINCE__
|
#ifdef __WXWINCE__
|
||||||
EVT_INIT_DIALOG(wxWindowMSW::OnInitDialog)
|
EVT_INIT_DIALOG(wxWindowMSW::OnInitDialog)
|
||||||
@@ -4050,29 +4049,6 @@ bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc)
|
|||||||
if ( ::IsIconic(GetHwnd()) )
|
if ( ::IsIconic(GetHwnd()) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
#if 0
|
|
||||||
if (GetParent() && GetParent()->GetExtraStyle() & wxWS_EX_THEMED_BACKGROUND)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GetExtraStyle() & wxWS_EX_THEMED_BACKGROUND)
|
|
||||||
{
|
|
||||||
if (wxUxThemeEngine::Get())
|
|
||||||
{
|
|
||||||
WXHTHEME hTheme = wxUxThemeEngine::Get()->m_pfnOpenThemeData(GetHWND(), L"TAB");
|
|
||||||
if (hTheme)
|
|
||||||
{
|
|
||||||
WXURECT rect;
|
|
||||||
::GetClientRect((HWND) GetHWND(), (RECT*) & rect);
|
|
||||||
wxUxThemeEngine::Get()->m_pfnDrawThemeBackground(hTheme, hdc, 10 /* TABP_BODY */, 0, &rect, &rect);
|
|
||||||
wxUxThemeEngine::Get()->m_pfnCloseThemeData(hTheme);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
wxDCTemp dc(hdc);
|
wxDCTemp dc(hdc);
|
||||||
|
|
||||||
dc.SetHDC(hdc);
|
dc.SetHDC(hdc);
|
||||||
@@ -4091,33 +4067,6 @@ bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMSW::OnEraseBackground(wxEraseEvent& event)
|
|
||||||
{
|
|
||||||
RECT rect;
|
|
||||||
::GetClientRect(GetHwnd(), &rect);
|
|
||||||
|
|
||||||
wxColour backgroundColour( GetBackgroundColour());
|
|
||||||
COLORREF ref = PALETTERGB(backgroundColour.Red(),
|
|
||||||
backgroundColour.Green(),
|
|
||||||
backgroundColour.Blue());
|
|
||||||
HBRUSH hBrush = ::CreateSolidBrush(ref);
|
|
||||||
if ( !hBrush )
|
|
||||||
wxLogLastError(wxT("CreateSolidBrush"));
|
|
||||||
|
|
||||||
HDC hdc = (HDC)event.GetDC()->GetHDC();
|
|
||||||
|
|
||||||
#ifndef __WXWINCE__
|
|
||||||
int mode = ::SetMapMode(hdc, MM_TEXT);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
::FillRect(hdc, &rect, hBrush);
|
|
||||||
::DeleteObject(hBrush);
|
|
||||||
|
|
||||||
#ifndef __WXWINCE__
|
|
||||||
::SetMapMode(hdc, mode);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// moving and resizing
|
// moving and resizing
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user