- wxString s;
- item->GetText( s );
- long lw,lh;
- dc->GetTextExtent( s, &lw, &lh );
- if (m_bound_all.width > m_spacing)
- m_bound_label.x = m_bound_all.x;
- else
- m_bound_label.x = m_bound_all.x + (m_spacing/2) - lw/2;
- m_bound_label.y = m_bound_all.y + m_bound_all.height - lh;
- m_bound_label.width = lw;
- m_bound_label.height = lh;
- AssignRect( m_bound_hilight, m_bound_label );
- m_bound_hilight.x -= 2;
- m_bound_hilight.y -= 2;
- m_bound_hilight.width += 4;
- m_bound_hilight.height += 4;
+ AssignRect( m_bound_label, m_bound_all );
+ m_bound_all.x -= 2;
+ m_bound_all.y -= 2;
+ m_bound_all.width += 4;
+ m_bound_all.height += 3;
+ AssignRect( m_bound_hilight, m_bound_all );
+ AssignRect( m_bound_icon, 0, 0, 0, 0 );
+ wxNode *node = m_items.First();
+ if (node)
+ {
+ wxListItemData *item = (wxListItemData*)node->Data();
+ if (item->HasImage())
+ {
+ m_bound_icon.x = m_bound_all.x + 2;
+ m_bound_icon.y = m_bound_all.y + 2;
+ int w;
+ int h;
+ m_owner->GetImageSize( item->GetImage(), w, h );
+ m_bound_icon.width = w;
+ m_bound_icon.height = h;
+ m_bound_label.x += 4 + w;
+ m_bound_label.width -= 4 + w;
+ }
+ }
+ break;
+ }
+ case wxLC_REPORT:
+ {
+ long lw,lh;
+ dc->GetTextExtent( "H", &lw, &lh );
+ m_bound_all.x = 0;
+ m_bound_all.y -= 0;
+ m_bound_all.height = lh+3;
+ m_bound_all.width = window_width;
+ AssignRect( m_bound_hilight, m_bound_all );
+ AssignRect( m_bound_label, m_bound_all );
+ AssignRect( m_bound_icon, 0, 0, 0, 0 );
+ wxNode *node = m_items.First();
+ if (node)
+ {
+ wxListItemData *item = (wxListItemData*)node->Data();
+ wxString s;
+ item->GetText( s );
+ if (s.IsEmpty()) s = wxT("H");
+ long lw,lh;
+ dc->GetTextExtent( s, &lw, &lh );
+ m_bound_label.width = lw;
+ m_bound_label.height = lh;
+ if (item->HasImage())
+ {
+ m_bound_icon.x = m_bound_all.x + 2;
+ m_bound_icon.y = m_bound_all.y + 2;
+ int w;
+ int h;
+ m_owner->GetImageSize( item->GetImage(), w, h );
+ m_bound_icon.width = w;
+ m_bound_icon.height = h;
+ m_bound_label.x += 4 + w;
+ }
+ }
+ break;