back to gui 

wxTextValidator

generated from ../src/mod_gui/misc/textval.cpp

wxTextValidator 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 read only String Get the value entered in the textfield.


SourceForge.net Logo Support This Project

Table of Contents

Prototype

wxValidator

Constructor

wxTextValidator

Properties

excludes
includes
style
value


Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.