-
- wxPen *pen =
-#ifndef __WXMAC__
- // don't draw rect outline if we already have the
- // background color under Mac
- (item->IsSelected() && m_hasFocus) ? wxBLACK_PEN :
-#endif // !__WXMAC__
- wxTRANSPARENT_PEN;
-
- wxColour colText;
- if ( item->IsSelected() )
- {
- colText = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
- }
- else
- {
- wxTreeItemAttr *attr = item->GetAttributes();
- if (attr && attr->HasTextColour())
- colText = attr->GetTextColour();
- else
- colText = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOWTEXT);
- }
-
- // prepare to draw
- dc.SetTextForeground(colText);
- dc.SetPen(*pen);
-
- // draw
- PaintItem(item, dc);
-
- if (HasFlag(wxTR_ROW_LINES))
- {
- // if the background colour is white, choose a
- // contrasting color for the lines
- dc.SetPen(*((GetBackgroundColour() == *wxWHITE)
- ? wxMEDIUM_GREY_PEN : wxWHITE_PEN));
- dc.DrawLine(0, y_top, 10000, y_top);
- dc.DrawLine(0, y, 10000, y);
- }
-
- // restore DC objects
- dc.SetBrush(*wxWHITE_BRUSH);
- dc.SetPen(m_dottedPen);
- dc.SetTextForeground(*wxBLACK);