Hi James,
I've taken a look at the wxIndustrialControls source and I think porting
the code to Perl could be quite straightforward.
Would you object if I provided Perl code for the LinearMeter control
that you could then adapt more or less as you wish. I think this would
be the best way of answering your questions below and explaining one or
two problems with the implementation in your scripts / modules as posted.
Regards
Mark
On 23/01/2013 15:43, James Lynes wrote:
Good morning:
I've recently ported several C++ wxIndustrial Controls to wxPerl and I'm
now abstracting the LinearMeter example into a module so that multiple
meters can exist on a window. I have a couple of questions that I hope the
group can help me with.
First: I create a frame. Create 6 panels. Write a label on each panel(just
to see if the panel is created in the correct location, it is). Create 6
meter objects. And draw the 6 meters(for testing just a filled box).
Instead of getting a window with 6 boxes with labels, I get a blank window
that gets 6 boxes drawn on it. Then the window goes back to the default
background color with 6 labels written on it. The filled boxes are
overwritten. I'm looking for 6 filled boxes with a label on them. What have
I missed?
Second: In the original port I have the following construct that works fine:
my @TagsVal;
push(@TagsVal, $val);
In my abstracted version I have translated this to:
$self->{TAGSVAL} = []; # Object array
definition
sub TagsVal { # Object
accessor definition
my $self = shift;
if(@_) {$self->{TAGSVAL} = @_}
return $self->{TAGSVAL};
}
push($Meter->TagsVal(), $val); # Don't think this
is correct syntax???
# want
to push $val into the object TAGSVAL array
Thanks for your input!
James
Source files attached: LinearMeter.pl Original Port
LinearMeter.pm Object version
LM.pl Object Main
Program