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:
@@ -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" );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user