Added wxPGProperty::OnValidationFailure(); needed it and some other tweaks to allow vetoing value changes of ComboBox editors
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1423,6 +1423,15 @@ public:
|
||||
*/
|
||||
virtual wxPGEditorDialogAdapter* GetEditorDialog() const;
|
||||
|
||||
/**
|
||||
Called whenever validation has failed with given pending value.
|
||||
|
||||
@remarks If you implement this in your custom property class, please
|
||||
remember to call the baser implementation as well, since they
|
||||
may use it to revert property into pre-change state.
|
||||
*/
|
||||
virtual void OnValidationFailure( wxVariant& pendingValue );
|
||||
|
||||
/** Append a new choice to property's list of choices.
|
||||
*/
|
||||
int AddChoice( const wxString& label, int value = wxPG_INVALID_VALUE )
|
||||
|
@@ -1294,12 +1294,8 @@ public:
|
||||
To add your own validation failure behavior, override
|
||||
wxPropertyGrid::DoOnValidationFailure().
|
||||
*/
|
||||
bool OnValidationFailure( wxPGProperty* property, wxVariant& invalidValue )
|
||||
{
|
||||
bool res = DoOnValidationFailure(property, invalidValue);
|
||||
property->SetFlag(wxPG_PROP_INVALID_VALUE);
|
||||
return res;
|
||||
}
|
||||
bool OnValidationFailure( wxPGProperty* property,
|
||||
wxVariant& invalidValue );
|
||||
|
||||
/** Called to indicate property and editor has valid value now.
|
||||
*/
|
||||
|
@@ -428,6 +428,8 @@ public:
|
||||
// this take advantage of it.
|
||||
virtual int GetChoiceSelection() const { return m_index; }
|
||||
|
||||
virtual void OnValidationFailure( wxVariant& pendingValue );
|
||||
|
||||
protected:
|
||||
|
||||
int GetIndex() const;
|
||||
@@ -447,6 +449,7 @@ private:
|
||||
|
||||
// Relies on ValidateValue being called always before OnSetValue
|
||||
static int ms_nextIndex;
|
||||
static int ms_prevIndex;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user