else
state_w += MARGIN_BETWEEN_IMAGE_AND_TEXT;
}
- else
- {
- state = wxTREE_ITEMSTATE_NONE;
- }
}
m_height = (image_h > text_h) ? image_h : text_h;
void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
{
item->SetFont(this, dc);
+ item->CalculateSize(this, dc);
wxCoord text_h = item->GetTextHeight();
x=0;
GetVirtualSize(&w, &h);
wxRect rect( x, item->GetY()+offset, w, total_h-offset);
-#if !defined(__WXGTK20__) && !defined(__WXMAC__)
- dc.DrawRectangle(rect);
-#else
if (!item->IsSelected())
{
dc.DrawRectangle(rect);
wxRendererNative::Get().
DrawItemSelectionRect(this, dc, rect, flags);
}
-#endif
}
- else
+ else // no full row highlight
{
if ( item->IsSelected() &&
(state != wxTREE_ITEMSTATE_NONE || image != NO_IMAGE) )
{
wxRect rect( item->GetX()-2, item->GetY()+offset,
item->GetWidth()+2, total_h-offset );
-#if !defined(__WXGTK20__) && !defined(__WXMAC__)
- dc.DrawRectangle( rect );
-#else
if ( hasBgColour )
{
dc.DrawRectangle( rect );
}
- else
+ else // no specific background colour
{
rect.x -= 1;
rect.width += 2;
wxRendererNative::Get().
DrawItemSelectionRect(this, dc, rect, flags);
}
-#endif
}
}
return wxListBox::GetClassDefaultAttributes(variant);
#else
wxVisualAttributes attr;
- attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
+ attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT);
attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX);
attr.font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
return attr;