]> git.saurik.com Git - wxWidgets.git/commitdiff
skip the paint event instead of calling wxControl version when not doing any custom...
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 22 Feb 2006 12:33:02 +0000 (12:33 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 22 Feb 2006 12:33:02 +0000 (12:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37668 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listctrl.cpp

index 0cec7d35e423ee9b6f79efcee2dbe710a3216c2a..ef2f5d71a9a6eea3223e3ce64dcc1287f0e170eb 100644 (file)
@@ -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);