Add wxIntegerValidator and wxFloatingPointValidator classes.
Add validators for integer and floating point numbers. Add an example of their use to the validate sample as well as a new unit test and documentation for them. Use the new classes instead of wxTextValidator in wxGrid code. Closes #12166. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -28,12 +28,12 @@
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/checkbox.h"
|
||||
#include "wx/combobox.h"
|
||||
#include "wx/valtext.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/math.h"
|
||||
#include "wx/listbox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/valnum.h"
|
||||
#include "wx/textfile.h"
|
||||
#include "wx/spinctrl.h"
|
||||
#include "wx/tokenzr.h"
|
||||
@@ -660,7 +660,7 @@ void wxGridCellNumberEditor::Create(wxWindow* parent,
|
||||
wxGridCellTextEditor::Create(parent, id, evtHandler);
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
Text()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
Text()->SetValidator(wxIntegerValidator<int>());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -875,7 +875,7 @@ void wxGridCellFloatEditor::Create(wxWindow* parent,
|
||||
wxGridCellTextEditor::Create(parent, id, evtHandler);
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
Text()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
Text()->SetValidator(wxFloatingPointValidator<double>(m_precision));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user