From d57f1dd7fe65ddfd7679a16fcd072d3d6ab466f3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 25 Jan 2009 19:07:11 +0000 Subject: [PATCH] undo r58380 as it breaks tree control background repainting (see #9832) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/treectrl.cpp | 4 ---- src/msw/window.cpp | 16 ++++++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index df434131aa..d358be2f32 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -734,10 +734,6 @@ bool wxTreeCtrl::Create(wxWindow *parent, if ( !MSWCreateControl(WC_TREEVIEW, wstyle, pos, size) ) return false; - // this significantly reduces flicker when refreshing the control, for some - // reason the native control itself doesn't avoid background repainting - SetBackgroundStyle(wxBG_STYLE_CUSTOM); - #if wxUSE_COMCTL32_SAFELY wxWindow::SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); wxWindow::SetForegroundColour(wxWindow::GetParent()->GetForegroundColour()); diff --git a/src/msw/window.cpp b/src/msw/window.cpp index e808841ca4..3707a1bad7 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -4722,14 +4722,6 @@ bool wxWindowMSW::HandleEraseBkgnd(WXHDC hdc) void wxWindowMSW::OnEraseBackground(wxEraseEvent& event) { - if ( GetBackgroundStyle() == wxBG_STYLE_CUSTOM ) - { - // don't skip the event here, custom background means that the app - // is drawing it itself in its OnPaint(), so don't draw it at all - // now to avoid flicker - return; - } - // standard non top level controls (i.e. except the dialogs) always erase // their background themselves in HandleCtlColor() or have some control- // specific ways to set the colours (common controls) @@ -4739,6 +4731,14 @@ void wxWindowMSW::OnEraseBackground(wxEraseEvent& event) return; } + if ( GetBackgroundStyle() == wxBG_STYLE_CUSTOM ) + { + // don't skip the event here, custom background means that the app + // is drawing it itself in its OnPaint(), so don't draw it at all + // now to avoid flicker + return; + } + wxDC *dc = event.GetDC(); if (!dc) return; wxMSWDCImpl *impl = (wxMSWDCImpl*) dc->GetImpl(); -- 2.45.2