- if (!HasFlag(wxTR_NO_LINES))
- {
- // draw line down to last child
- if (children[n]->HasPlus() && HasButtons()) {
- y2 = y + h/2 - m_btnHeight2;
- if (HasButtons()) {
- dc.DrawLine(x+m_indent, oldY, x+m_indent, y2);
- }else{
- dc.DrawLine(x, oldY, x, y2);
- }
- oldY = y2 + m_btnHeight;
- }else{
- y2 = y + h/2;
- if (HasButtons()) {
- dc.DrawLine(x+m_indent, oldY, x+m_indent, y2);
- }else{
- dc.DrawLine(x, oldY, x, y2);
- }
- oldY = y2;
- }
- }
+ // then draw the connecting lines
+ if (!HasFlag(wxTR_NO_LINES) && count > 0)
+ {
+ // clip to the column width
+ size_t clip_width = m_owner->GetHeaderWindow()->GetColumn(m_main_column).GetWidth();
+ wxDCClipper clipper(dc, x_colstart, y_top, clip_width, 10000);