+ if (item->HasPlus() && HasButtons()) // should the item show a button?
+ {
+ if (!HasFlag(wxTR_NO_LINES))
+ {
+ if (x > (signed)m_indent)
+ dc.DrawLine(x - m_indent, y_mid, x - 5, y_mid);
+ else if (HasFlag(wxTR_LINES_AT_ROOT))
+ dc.DrawLine(3, y_mid, x - 5, y_mid);
+ dc.DrawLine(x + 5, y_mid, x + m_spacing, y_mid);
+ }
+
+ if (m_imageListButtons != NULL)
+ {
+ // draw the image button here
+ int image_h = 0, image_w = 0, image = wxTreeItemIcon_Normal;
+ if (item->IsExpanded()) image = wxTreeItemIcon_Expanded;
+ if (item->IsSelected())
+ image += wxTreeItemIcon_Selected - wxTreeItemIcon_Normal;
+ m_imageListButtons->GetSize(image, image_w, image_h);
+ int xx = x - (image_w>>1);
+ int yy = y_mid - (image_h>>1);
+ dc.SetClippingRegion(xx, yy, image_w, image_h);
+ m_imageListButtons->Draw(image, dc, xx, yy,
+ wxIMAGELIST_DRAW_TRANSPARENT);
+ dc.DestroyClippingRegion();
+ }
+ else if (HasFlag(wxTR_TWIST_BUTTONS))
+ {
+ // draw the twisty button here
+ dc.SetPen(*wxBLACK_PEN);
+ dc.SetBrush(*m_hilightBrush);