- if (item->GetImage() != -1)
- {
- dc.SetClippingRegion( item->GetX(), item->GetY(), image_w-2, text_h );
- m_imageListNormal->Draw( item->GetImage(), dc,
- item->GetX(), item->GetY()-1,
- wxIMAGELIST_DRAW_TRANSPARENT );
- dc.DestroyClippingRegion();
- }
+ int total_h = (image_h > text_h) ? image_h : text_h;
+ if(m_lineHeight > total_h) total_h = m_lineHeight;
+
+ dc.DrawRectangle( item->GetX()-2, item->GetY(), image_w+text_w+4, total_h );
+
+ if ((item->IsExpanded()) && (item->GetSelectedImage() != -1))
+ {
+ dc.SetClippingRegion( item->GetX(), item->GetY(), image_w-2, total_h );
+ m_imageListNormal->Draw( item->GetSelectedImage(), dc,
+ item->GetX(),
+ item->GetY() +((total_h > image_h)?((total_h-image_h)/2):0),
+ wxIMAGELIST_DRAW_TRANSPARENT );
+ dc.DestroyClippingRegion();
+ }
+ else if (item->GetImage() != -1)
+ {
+ dc.SetClippingRegion( item->GetX(), item->GetY(), image_w-2, total_h );
+ m_imageListNormal->Draw( item->GetImage(), dc,
+ item->GetX(),
+ item->GetY() +((total_h > image_h)?((total_h-image_h)/2):0),
+ wxIMAGELIST_DRAW_TRANSPARENT );
+ dc.DestroyClippingRegion();
+ }