}
int wxEnumProperty::ms_nextIndex = -2;
+int wxEnumProperty::ms_prevIndex = -1;
void wxEnumProperty::OnSetValue()
{
setAsNextIndex = -1;
value = text;
}
- else if ( m_index != useIndex )
+ else if ( useIndex != GetIndex() )
{
if ( useIndex != -1 )
{
}
else
{
- if ( m_index != intVal )
+ if ( intVal != GetIndex() )
{
ms_nextIndex = intVal;
}
return false;
}
+void
+wxEnumProperty::OnValidationFailure( wxVariant& WXUNUSED(pendingValue) )
+{
+ // Revert index
+ m_index = ms_prevIndex;
+ ResetNextIndex();
+}
+
void wxEnumProperty::SetIndex( int index )
{
+ ms_prevIndex = m_index;
ms_nextIndex = -2;
m_index = index;
}
int wxEnumProperty::GetIndex() const
{
+ if ( m_value.IsNull() )
+ return -1;
+
if ( ms_nextIndex != -2 )
return ms_nextIndex;
+
return m_index;
}