int state,
int xoffset)
{
+ // override custom foreground with the standard one for the selected items
+ // because we currently don't allow changing the selection background and
+ // custom colours may be unreadable on it
wxColour col;
- if ( attr && attr->HasColour() )
- col = attr->GetColour();
- else if ( state & wxDATAVIEW_CELL_SELECTED )
+ if ( state & wxDATAVIEW_CELL_SELECTED )
col = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
+ else if ( attr && attr->HasColour() )
+ col = attr->GetColour();
else // use default foreground
col = GetOwner()->GetOwner()->GetForegroundColour();
wxDataViewModel *model,
const wxDataViewItem & item, unsigned int col)
{
- bool value = !m_toggle;
- wxVariant variant = value;
- model->SetValue( variant, item, col);
- model->ValueChanged( item, col );
+ model->ChangeValue(!m_toggle, item, col);
return true;
}
void wxDataViewDateRendererPopupTransient::OnCalendar( wxCalendarEvent &event )
{
- wxDateTime date = event.GetDate();
- wxVariant value = date;
- m_model->SetValue( value, m_item, m_col );
- m_model->ValueChanged( m_item, m_col );
+ m_model->ChangeValue( event.GetDate(), m_item, m_col );
DismissAndNotify();
}