From: Mark W. <ma...@ne...> - 2003-03-20 07:13:37
|
Hi, Please help, I am getting nowehere with these validators!! - Does anyone have any more information on them or working source? - Why was the PlValidator implemented instead of the Wx::Validator? - How do I actually pass data To and From the window controls? - Do I have to manually code the TransferDataToWindow for every panel in a notebook or can I call InitDialog for the dialog containing the notebook sizer? I tried this but no luck (nothing happened). I have attached my simple version of a validator. TIA Mark Wardell -------------------------------------------------------------------- package My::Validator; use vars qw(@ISA); @ISA = qw( Wx::PlValidator ); sub new { my $class = shift; my $self = $class->SUPER::new; $self->{data} = shift; return $self; } # see the docs for the three following functions sub TransferFromWindow { my $self = shift; print "TransferFromWindow called\n"; return 1; } sub TransferToWindow { my $self = shift; print "[TransferToWindow] data=${$self->{data}}\n"; #print "TransferToWindow called\n"; return ${$self->{data}}; } sub OnChar { my $self = shift; print "[Validator] OnChar called\n"; return 1; } sub Validate { my $self = shift; print "Validate called\n"; return 1; } sub Clone { my $self = shift; #print "Clone called\n"; # clone by creating a new object, which should, in the real class, have copies of all # properties of $this # could/should we use something like Storable::dclone here?? my $tmp = MOM::Validator->new($self->{data}); return $tmp; } #--------------------------------------------------------------------------- --- 1; # always return this |