|
From: James L. <ja...@mi...> - 2001-12-13 11:12:31
|
Mattia,
Thanks, as usual, for the to-the-point and quick support!
If/when I manage to produce a useful validator, I would be more than
happy to submit it. Currently I'm still getting my head round how
everything fits together!
James
> -----Original Message-----
> From: Mattia Barbon [mailto:mb...@ds...]
> Sent: 13 December 2001 11:04
> To: wxp...@li...
> Subject: [wxperl-users] Re: wxValidator available via wxPerl
>=20
>=20
> > Dear Mattia,
> > I would like to use validators in my Perl application, but=20
> am not clear
> > whether they have been wrapped.
> >=20
> > 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=20
> classes to wrap ( it was=20
> before wxPerl 0.01 ), and then just forgot about it.
>=20
> 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.
>=20
> To derive a new validator:
>=20
> package MyValidator;
>=20
> use vars qw(@ISA); @ISA =3D qw(Wx::PlValidator);
>=20
> sub new {
> my $class =3D shift;
> my $this =3D $class->SUPER::new();
>=20
> ...
>=20
> return $this;
> }
>=20
> # see the docs for the three following functions
> sub TransferFromWindow { ... }
> sub TransferToWindow { ... }
> sub Validate { ... }
>=20
> 1;
>=20
> Of course no one stops you from contributing your validators
> back to wxPerl, if you feel like it...
>=20
> Regards
> Mattia
>=20
> _______________________________________________
> wxperl-users mailing list
> wxp...@li...
> https://lists.sourceforge.net/lists/listinfo/wxperl-users
>=20
>=20
|