wxRemotelyScrolledTreeCtrl draws its own lines if wxTR_ROW_LINES flag
is used, but prevents the base class from seeing the flag so they won't be drawn twice with possibly different colours. Also changed all tabs to spaces, so the diffs will show a lot of whitespace-only changes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -117,6 +117,7 @@ public:
|
||||
DECLARE_EVENT_TABLE()
|
||||
protected:
|
||||
wxWindow* m_companionWindow;
|
||||
bool m_drawRowLines;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@@ -65,11 +65,18 @@ BEGIN_EVENT_TABLE(wxRemotelyScrolledTreeCtrl, wxTreeCtrl)
|
||||
EVT_SCROLLWIN(wxRemotelyScrolledTreeCtrl::OnScroll)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxRemotelyScrolledTreeCtrl::wxRemotelyScrolledTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt,
|
||||
const wxSize& sz, long style):
|
||||
wxTreeCtrl(parent, id, pt, sz, style)
|
||||
wxRemotelyScrolledTreeCtrl::wxRemotelyScrolledTreeCtrl(
|
||||
wxWindow* parent, wxWindowID id, const wxPoint& pt,
|
||||
const wxSize& sz, long style)
|
||||
: wxTreeCtrl(parent, id, pt, sz, style & ~wxTR_ROW_LINES)
|
||||
{
|
||||
m_companionWindow = NULL;
|
||||
|
||||
// We draw the row lines ourself so they match what's done
|
||||
// by the companion window. That is why the flag is turned
|
||||
// off above, so wxGenericTreeCtrl doesn't draw them in a
|
||||
// different colour.
|
||||
m_drawRowLines = (style & wxTR_ROW_LINES) != 0;
|
||||
}
|
||||
|
||||
wxRemotelyScrolledTreeCtrl::~wxRemotelyScrolledTreeCtrl()
|
||||
@@ -252,10 +259,8 @@ void wxRemotelyScrolledTreeCtrl::OnPaint(wxPaintEvent& event)
|
||||
|
||||
wxTreeCtrl::OnPaint(event);
|
||||
|
||||
// The generic tree already knows how to draw lines
|
||||
#ifdef __WXMSW__
|
||||
if ((GetWindowStyle() & wxTR_ROW_LINES) == 0)
|
||||
return FALSE;
|
||||
if (! m_drawRowLines)
|
||||
return;
|
||||
|
||||
// Reset the device origin since it may have been set
|
||||
dc.SetDeviceOrigin(0, 0);
|
||||
@@ -282,7 +287,6 @@ void wxRemotelyScrolledTreeCtrl::OnPaint(wxPaintEvent& event)
|
||||
cy = itemRect.GetBottom();
|
||||
dc.DrawLine(0, cy, clientSize.x, cy);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user