> Dear Mattia,
> I would like to use validators in my Perl application, but am not clear
> whether they have been wrapped.
>
> Are they available?
Yes, and no; you can use Wx::PlValidator and derive
your own valiadtors, but the standard
Wx::TextValidator and Wx::GenericValidator are not wrapped,
because at the time I has quite a lot other more important classes to wrap ( it was
before wxPerl 0.01 ), and then just forgot about it.
By the way, I think that wxGenericValidator and wxTextValidator are
quite limited, and their functionalities can be implemented
in Perl ( using Wx::PlValidator ), probably with a better interface.
To derive a new validator:
package MyValidator;
use vars qw(@ISA); @ISA = qw(Wx::PlValidator);
sub new {
my $class = shift;
my $this = $class->SUPER::new();
...
return $this;
}
# see the docs for the three following functions
sub TransferFromWindow { ... }
sub TransferToWindow { ... }
sub Validate { ... }
1;
Of course no one stops you from contributing your validators
back to wxPerl, if you feel like it...
Regards
Mattia
|