wxTextValidator
generated from ../src/mod_gui/misc/textval.cppwxTextValidator validates text controls, providing a variety of filtering behaviours. The following example shows a dialog with a textfield. It's only allowed to enter numeric characters. The textfield is initialised using the validator.
function init()
{
var dlg = new wxDialog(null, -1);
var txtField = new wxTextCtrl(dlg, -1);
txtField.validator = new wxTextValidator(wxFilter.NUMERIC, "10");
dlg.fit();
dlg.showModal();
wxMessageBox("You have entered: " + txtField.value);
return false;
}
wxTheApp.onInit = init;
Constants
Constructor
wxTextValidator
wxTextValidator(Style = wxFilter.NONE,
Value = "")
| Name | Type | Default | Description |
|---|---|---|---|
| Style | Integer | wxFilter.NONE | |
| Value | String | Value used to initialize the textfield. |
Constructs a new wxTextValidator object.
Properties
| Name | Type | Description |
|---|---|---|
| excludes | Array | Get/Set an array of invalid values. |
| includes | Array | Get/Set an array of valid values. |
| style | Integer | Get/Set the filter style. See wxFilter |
value ![]() |
String | Get the value entered in the textfield. |

© 2002 - 2007 Franky Braem.