+ if (IsExposed( exposed_x, exposed_y, 10000, m_lineHeight+4 )) // 10000 = very much
+ {
+ int startX = horizX;
+ int endX = horizX + 10;
+
+ if (!item->HasChildren()) endX += 20;
+
+ dc.DrawLine( startX, y, endX, y );
+
+ if (item->HasPlus())
+ {
+ dc.DrawLine( horizX+20, y, horizX+30, y );
+ dc.SetPen( *wxGREY_PEN );
+ dc.SetBrush( *wxWHITE_BRUSH );
+ dc.DrawRectangle( horizX+10, y-4, 11, 9 );
+ dc.SetPen( *wxBLACK_PEN );
+ dc.DrawLine( horizX+13, y, horizX+18, y );
+
+ if (!item->IsExpanded())
+ {
+ dc.DrawLine( horizX+15, y-2, horizX+15, y+3 );
+ }
+ }
+
+ if (item->HasHilight())
+ {
+ dc.SetTextForeground( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) );
+
+ dc.SetBrush( *m_hilightBrush );
+
+ if (m_hasFocus)
+ dc.SetPen( *wxBLACK_PEN );
+ else
+ dc.SetPen( *wxTRANSPARENT_PEN );
+
+ PaintItem(item, dc);
+
+ dc.SetPen( *wxBLACK_PEN );
+ dc.SetTextForeground( *wxBLACK );
+ dc.SetBrush( *wxWHITE_BRUSH );
+ }
+ else
+ {
+ dc.SetBrush( *wxWHITE_BRUSH );
+ dc.SetPen( *wxTRANSPARENT_PEN );
+
+ PaintItem(item, dc);
+
+ dc.SetPen( *wxBLACK_PEN );
+ }
+ }
+
+ if (item->IsExpanded())
+ {
+ int semiOldY = y;
+
+ wxArrayTreeItems& children = item->GetChildren();
+ size_t count = children.Count();
+ for ( size_t n = 0; n < count; n++ )
+ {
+ y += m_lineHeight;
+ semiOldY = y;
+ PaintLevel( children[n], dc, level+1, y );
+ }
+
+ /* it may happen that the item is expanded but has no items (when you
+ * delete all its children for example) - don't draw the vertical line
+ * in this case */
+ if (count > 0) dc.DrawLine( horizX+15, oldY+5, horizX+15, semiOldY );
+ }