Allow associating a validator with wxGridCellTextEditor.

Add wxGridCellTextEditor::SetValidator() for finer control over text input in
wxGrid.

Closes #15176.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-05-16 14:32:55 +00:00
parent 79be3fb48d
commit c6dae1699e
4 changed files with 33 additions and 4 deletions

View File

@@ -75,9 +75,9 @@ public:
// parameters string format is "max_width"
virtual void SetParameters(const wxString& params);
virtual void SetValidator(const wxValidator& validator);
virtual wxGridCellEditor *Clone() const
{ return new wxGridCellTextEditor(m_maxChars); }
virtual wxGridCellEditor *Clone() const;
// added GetValue so we can get the value which is in the control
virtual wxString GetValue() const;
@@ -92,8 +92,9 @@ protected:
void DoReset(const wxString& startValue);
private:
size_t m_maxChars; // max number of chars allowed
wxString m_value;
size_t m_maxChars; // max number of chars allowed
wxScopedPtr<wxValidator> m_validator;
wxString m_value;
wxDECLARE_NO_COPY_CLASS(wxGridCellTextEditor);
};