+ // 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);