From 2e6a9dad0813bb7cbcdb8db7bffe1985095b87be Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 22 Feb 2006 12:33:02 +0000 Subject: [PATCH] skip the paint event instead of calling wxControl version when not doing any custom drawing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37668 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 0cec7d35e4..ef2f5d71a9 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -2585,6 +2585,15 @@ WXLPARAM wxListCtrl::OnCustomDraw(WXLPARAM lParam) // Necessary for drawing hrules and vrules, if specified void wxListCtrl::OnPaint(wxPaintEvent& event) { + bool drawHRules = HasFlag(wxLC_HRULES); + bool drawVRules = HasFlag(wxLC_VRULES); + + if (!InReportView() || !drawHRules && !drawVRules) + { + event.Skip(); + return; + } + wxPaintDC dc(this); wxControl::OnPaint(event); @@ -2592,12 +2601,6 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) // Reset the device origin since it may have been set dc.SetDeviceOrigin(0, 0); - bool drawHRules = HasFlag(wxLC_HRULES); - bool drawVRules = HasFlag(wxLC_VRULES); - - if (!InReportView() || !drawHRules && !drawVRules) - return; - wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID); dc.SetPen(pen); dc.SetBrush(* wxTRANSPARENT_BRUSH); -- 2.45.2