Actually use the validator passed to wxGridCellTextEditor
SetValidator() had no effect if it was called after creating the editor, but in some situations it is convenient to call it from BeginEdit(), as we don't have the cell coordinates before it is called, so ensure that the validator set using this function is actually used even if it's called after creating the text control.
This commit is contained in:
@@ -671,6 +671,8 @@ void wxGridCellTextEditor::SetParameters(const wxString& params)
|
||||
void wxGridCellTextEditor::SetValidator(const wxValidator& validator)
|
||||
{
|
||||
m_validator.reset(static_cast<wxValidator*>(validator.Clone()));
|
||||
if ( m_validator && IsCreated() )
|
||||
Text()->SetValidator(*m_validator);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user