no changes; just code cleanup in OnEraseBackground()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1344,34 +1344,27 @@ void wxToolBar::OnMouseEvent(wxMouseEvent& event)
|
|||||||
// colour: for example, when it must blend in with a notebook page.
|
// colour: for example, when it must blend in with a notebook page.
|
||||||
void wxToolBar::OnEraseBackground(wxEraseEvent& event)
|
void wxToolBar::OnEraseBackground(wxEraseEvent& event)
|
||||||
{
|
{
|
||||||
wxColour bgCol = GetBackgroundColour();
|
if ( !UseBgCol() )
|
||||||
if (!bgCol.Ok())
|
|
||||||
{
|
{
|
||||||
event.Skip();
|
event.Skip();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxColour bgCol = GetBackgroundColour();
|
||||||
|
|
||||||
// notice that this 'dumb' implementation may cause flicker for some of the
|
// notice that this 'dumb' implementation may cause flicker for some of the
|
||||||
// controls in which case they should intercept wxEraseEvent and process it
|
// controls in which case they should intercept wxEraseEvent and process it
|
||||||
// themselves somehow
|
// themselves somehow
|
||||||
|
|
||||||
RECT rect;
|
RECT rect = wxGetClientRect(GetHwnd());
|
||||||
::GetClientRect(GetHwnd(), &rect);
|
|
||||||
|
|
||||||
HBRUSH hBrush = ::CreateSolidBrush(wxColourToRGB(bgCol));
|
AutoHBRUSH hBrush(wxColourToRGB(bgCol));
|
||||||
|
|
||||||
HDC hdc = GetHdcOf((*event.GetDC()));
|
HDC hdc = GetHdcOf((*event.GetDC()));
|
||||||
|
|
||||||
#ifndef __WXWINCE__
|
wxCHANGE_HDC_MAP_MODE(hdc, MM_TEXT);
|
||||||
int mode = ::SetMapMode(hdc, MM_TEXT);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
::FillRect(hdc, &rect, hBrush);
|
::FillRect(hdc, &rect, hBrush);
|
||||||
::DeleteObject(hBrush);
|
|
||||||
|
|
||||||
#ifndef __WXWINCE__
|
|
||||||
::SetMapMode(hdc, mode);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxToolBar::HandleSize(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)
|
bool wxToolBar::HandleSize(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)
|
||||||
|
Reference in New Issue
Block a user