restored OnEraseBackground(), we do need it but only for the cases when the window has a non default background colour
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30549 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
547e2b0c43
commit
8681b0940e
@ -166,8 +166,9 @@ public:
|
|||||||
// --------------
|
// --------------
|
||||||
|
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
|
void OnEraseBackground(wxEraseEvent& event);
|
||||||
#ifdef __WXWINCE__
|
#ifdef __WXWINCE__
|
||||||
void OnInitDialog( wxInitDialogEvent& event );
|
void OnInitDialog(wxInitDialogEvent& event);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -333,6 +333,7 @@ wxCONSTRUCTOR_DUMMY(wxWindow)
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxWindowMSW, wxWindowBase)
|
BEGIN_EVENT_TABLE(wxWindowMSW, wxWindowBase)
|
||||||
EVT_SYS_COLOUR_CHANGED(wxWindowMSW::OnSysColourChanged)
|
EVT_SYS_COLOUR_CHANGED(wxWindowMSW::OnSysColourChanged)
|
||||||
|
EVT_ERASE_BACKGROUND(wxWindowMSW::OnEraseBackground)
|
||||||
#ifdef __WXWINCE__
|
#ifdef __WXWINCE__
|
||||||
EVT_INIT_DIALOG(wxWindowMSW::OnInitDialog)
|
EVT_INIT_DIALOG(wxWindowMSW::OnInitDialog)
|
||||||
#endif
|
#endif
|
||||||
@ -4067,6 +4068,40 @@ bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindowMSW::OnEraseBackground(wxEraseEvent& event)
|
||||||
|
{
|
||||||
|
if ( !m_hasBgCol )
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// we have a fixed solid background colour, do use it
|
||||||
|
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
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user