Wx::Perl::TextValidator - Perl replacement for wxTextValidator
my $storage = ''; my $validator1 = Wx::Perl::TextValidator->new( '\d', \$storage ); my $validator2 = Wx::Perl::TextValidator->new( '[abcdef]' ); my $validator3 = Wx::Perl::TextValidator->new( qr/[a-zA-Z]/ ); my $textctrl = Wx::TextCtrl->new( $parent, -1, "", $pos, $size, $style, $validator1 );
A Wx::Validator subclass that allows filtering user input to a Wx::TextCtrl.
Wx::Validator
Wx::TextCtrl
my $validator1 = Wx::Perl::TextValidator->new( $regexp, \$storage ); my $validator2 = Wx::Perl::TextValidator->new( $regexp );
Constructs a new Wx::Perl::Validator. The first argument must be a regular expression matching a single-character string and is used to validate the field contents and user input. The second argument, if present, is used in TransferDataToWindow/TransferDataToWindow as the source/destination for the fields contents.
Wx::Perl::Validator
The first argument can be a string as well as a reqular expression object created using C<qr//>.
To install Wx, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wx
CPAN shell
perl -MCPAN -e shell install Wx
For more information on module installation, please visit the detailed CPAN module installation guide.