Properly handle choices mapped
If the choice is an integer, we need to be able to handle it directly because we can't get the wxAny to a wxString if the underlying type doesn't map
This commit is contained in:
@@ -83,7 +83,14 @@ public:
|
||||
wxPGChoices choices = aProperty->GetChoices( this );
|
||||
|
||||
if( choices.GetCount() )
|
||||
aProperty->set<wxString>( object, choices.GetLabel( aValue.GetInteger() ) );
|
||||
{
|
||||
// If the property type is int, use the choice value directly
|
||||
// Otherwise, convert to the choice label string
|
||||
if( aProperty->TypeHash() == TYPE_HASH( int ) )
|
||||
aProperty->set<int>( object, aValue.GetInteger() );
|
||||
else
|
||||
aProperty->set<wxString>( object, choices.GetLabel( aValue.GetInteger() ) );
|
||||
}
|
||||
else
|
||||
aProperty->set<wxVariant>( object, aValue );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user