Test custom editor in the dataview sample

Show how to create and use a custom editor in the custom renderer.
This commit is contained in:
Vadim Zeitlin
2015-11-27 15:43:21 +01:00
parent 29024e39ca
commit 7e37c6763f
3 changed files with 52 additions and 8 deletions

View File

@@ -444,7 +444,13 @@ void MyListModel::GetValueByRow( wxVariant &variant,
break;
case Col_Custom:
variant = wxString::Format("%d", row % 100);
{
IntToStringMap::const_iterator it = m_customColValues.find(row);
if ( it != m_customColValues.end() )
variant = it->second;
else
variant = wxString::Format("%d", row % 100);
}
break;
case Col_Max:
@@ -531,10 +537,13 @@ bool MyListModel::SetValueByRow( const wxVariant &variant,
case Col_Date:
case Col_TextWithAttr:
case Col_Custom:
wxLogError("Cannot edit the column %d", col);
break;
case Col_Custom:
m_customColValues[row] = variant.GetString();
break;
case Col_Max:
wxFAIL_MSG( "invalid column" );
}