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
This commit is contained in:
Václav Slavík
2006-02-22 12:33:02 +00:00
parent b74865fa61
commit 2e6a9dad08

View 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);