wxPropertyGrid validation failure was not (always) reset when a valid value was entered after an invalid one.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64795 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2987,6 +2987,7 @@ bool wxPropertyGrid::PerformValidation( wxPGProperty* p, wxVariant& pendingValue
|
||||
//
|
||||
|
||||
m_validationInfo.m_failureBehavior = m_permanentValidationFailureBehavior;
|
||||
m_validationInfo.m_isFailing = true;
|
||||
|
||||
//
|
||||
// Variant list a special value that cannot be validated
|
||||
@@ -3119,6 +3120,8 @@ bool wxPropertyGrid::PerformValidation( wxPGProperty* p, wxVariant& pendingValue
|
||||
pendingValue = value;
|
||||
}
|
||||
|
||||
m_validationInfo.m_isFailing = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3255,6 +3258,8 @@ void wxPropertyGrid::DoOnValidationFailureReset( wxPGProperty* property )
|
||||
DrawItemAndChildren(property);
|
||||
}
|
||||
}
|
||||
|
||||
m_validationInfo.m_isFailing = false;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -3271,6 +3276,9 @@ bool wxPropertyGrid::DoPropertyChanged( wxPGProperty* p, unsigned int selFlags )
|
||||
|
||||
m_inDoPropertyChanged = 1;
|
||||
|
||||
// If property's value is being changed, assume it is valid
|
||||
OnValidationFailureReset(selected);
|
||||
|
||||
// Maybe need to update control
|
||||
wxASSERT( m_chgInfo_changedProperty != NULL );
|
||||
|
||||
@@ -3544,6 +3552,13 @@ void wxPropertyGrid::HandleCustomEditorEvent( wxEvent &event )
|
||||
selected,
|
||||
wnd ) )
|
||||
valueIsPending = true;
|
||||
|
||||
// Mark value always as pending if validation is currently
|
||||
// failing and value was not unspecified
|
||||
if ( !valueIsPending &&
|
||||
!pendingValue.IsNull() &&
|
||||
m_validationInfo.m_isFailing )
|
||||
valueIsPending = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user