"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Graphics/TriD/TriD/ButtonControl.pm" between
PDL-2.076.tar.gz and PDL-2.077.tar.gz

About: PDL (Perl Data Language) aims to turn perl into an efficient numerical language for scientific computing (similar to IDL and MatLab).

ButtonControl.pm  (PDL-2.076):ButtonControl.pm  (PDL-2.077)
skipping to change at line 56 skipping to change at line 56
my $self = fields::new($class); my $self = fields::new($class);
$self->{Win} = $win; $self->{Win} = $win;
$self; $self;
} }
=head2 mouse_moved =head2 mouse_moved
=for ref =for ref
A do nothing function to prevent errors if not defined in a subclass
A do-nothing function to prevent errors if not defined in a subclass
=cut =cut
sub mouse_moved{ sub mouse_moved{
print "mouse_moved @_\n" if $PDL::Graphics::TriD::verbose; print "mouse_moved @_\n" if $PDL::Graphics::TriD::verbose;
} }
=head2 ButtonRelease =head2 ButtonRelease
=for ref =for ref
A do nothing function to prevent errors if not defined in a subclass
A do nothing function to prevent errors if not defined in a subclass
=cut =cut
sub ButtonRelease{ sub ButtonRelease{
my ($this,$x,$y) = @_; my ($this,$x,$y) = @_;
$this->{Win}{Active} = 0; $this->{Win}{Active} = 0;
print "ButtonRelease @_\n" if $PDL::Graphics::TriD::verbose; print "ButtonRelease @_\n" if $PDL::Graphics::TriD::verbose;
} }
=head2 ButtonPress =head2 ButtonPress
=for ref =for ref
Activates the viewport the mouse is inside when pressed Activates the viewport the mouse is inside when pressed
=cut =cut
$PDL::Graphics::TriD::cur = $PDL::Graphics::TriD::cur; # warnings $PDL::Graphics::TriD::current_window = $PDL::Graphics::TriD::current_window; # w arnings
sub ButtonPress{ sub ButtonPress{
my ($this,$x,$y) = @_; my ($this,$x,$y) = @_;
# #
# GL (0,0) point is Lower left X and Tk is upper left. # GL (0,0) point is Lower left X and Tk is upper left.
# #
$y = $PDL::Graphics::TriD::cur->{Height}-$y; $y = $PDL::Graphics::TriD::current_window->{Height}-$y;
# print "$x $y ",$this->{Win}{X0}," ",$this->{Win}{Y0}," ",$this->{Win}{W}," ", $this->{Win}{H},"\n"; # print "$x $y ",$this->{Win}{X0}," ",$this->{Win}{Y0}," ",$this->{Win}{W}," ", $this->{Win}{H},"\n";
if($this->{Win}{X0} <= $x && $this->{Win}{X0}+$this->{Win}{W}>=$x if($this->{Win}{X0} <= $x && $this->{Win}{X0}+$this->{Win}{W}>=$x
&& $this->{Win}{Y0} <= $y && $this->{Win}{Y0}+$this->{Win}{H}>=$y ){ && $this->{Win}{Y0} <= $y && $this->{Win}{Y0}+$this->{Win}{H}>=$y ){
$this->{Win}{Active} = 1; $this->{Win}{Active} = 1;
} }
print "ButtonPress @_ ",ref($this->{Win}),"\n" if $PDL::Graphics::TriD::verbos e; print "ButtonPress @_ ",ref($this->{Win}),"\n" if $PDL::Graphics::TriD::verbos e;
} }
=head2 set_wh =head2 set_wh
=for ref =for ref
Define the width and Height of the window for button control Define the width and Height of the window for button control
=cut =cut
sub set_wh { sub set_wh {
my($this,$w,$h) = @_; my($this,$w,$h) = @_;
print ref($this)," $w,$h\n" if $PDL::Graphics::TriD::verbose; print ref($this)," $w,$h\n" if $PDL::Graphics::TriD::verbose;
$this->{W} = $w; $this->{W} = $w;
$this->{H} = $h; $this->{H} = $h;
$w = 0 unless defined $w; $w = 0 unless defined $w;
$h = 0 unless defined $h; $h = 0 unless defined $h;
 End of changes. 6 change blocks. 
6 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)