Fix wxPGProperty::GetChoiceSelection

Return the index of the integer choice item on the list instead of item value itself.

See #16401.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek
2014-08-06 13:26:00 +00:00
parent 5f9bd3678f
commit 0f9ba6c59f

View File

@@ -1949,6 +1949,8 @@ void wxPGProperty::DeleteChoice( int index )
int wxPGProperty::GetChoiceSelection() const
{
wxASSERT_MSG( m_choices.IsOk(), wxT("No choices defined") );
wxVariant value = GetValue();
wxString valueType = value.GetType();
int index = wxNOT_FOUND;
@@ -1958,7 +1960,7 @@ int wxPGProperty::GetChoiceSelection() const
if ( valueType == wxPG_VARIANT_TYPE_LONG )
{
index = value.GetLong();
index = m_choices.Index(value.GetLong());
}
else if ( valueType == wxPG_VARIANT_TYPE_STRING )
{