aboutsummaryrefslogtreecommitdiff
path: root/src/MTools
diff options
context:
space:
mode:
authormarion2007-07-20 14:50:25 +0000
committermarion2007-07-20 14:50:25 +0000
commite61ee56e425cc7bd0c878729ec84b746a96c7e24 (patch)
tree4d82a19701fba28a28379b0307f1bf45d5d0f87a /src/MTools
parent389dc2edaab8987dfc1475149940b9e615c2182b (diff)
downloadmtc-e61ee56e425cc7bd0c878729ec84b746a96c7e24.zip
mtc-e61ee56e425cc7bd0c878729ec84b746a96c7e24.tar.gz
mtc-e61ee56e425cc7bd0c878729ec84b746a96c7e24.tar.bz2
mtc-e61ee56e425cc7bd0c878729ec84b746a96c7e24.tar.xz
Déplacement du plisten pour supprimer warning
Diffstat (limited to 'src/MTools')
-rw-r--r--src/MTools/Anim/MPath.pm57
-rw-r--r--src/MTools/GUI/MClip.pm90
2 files changed, 74 insertions, 73 deletions
diff --git a/src/MTools/Anim/MPath.pm b/src/MTools/Anim/MPath.pm
index eb8b221..6d73cff 100644
--- a/src/MTools/Anim/MPath.pm
+++ b/src/MTools/Anim/MPath.pm
@@ -98,34 +98,35 @@ sub pathchanged {
}
sub start {
- my ($self) = @_;
-
- my @points = @{$self -> mget ('path')};
- if (!@points) {return;}
- $self -> {__x} = $points [0] -> [0];
- $self -> {__y} = $points [0] -> [1];
- my $pacing = new Anim::Pacing::Linear (-duration => $self -> mget ('duration'));
- $self -> {__percentage} = 0;
- my $animationpath = new Anim::Path::Rectilinear (
- -xdep => 0,
- -ydep => 0,
- -xdest => 100,
- -ydest => 0,
- );
- $self -> {__animation} = my $animation = new Anim (
- -pacing => $pacing,
- -resources => [
- $animationpath,
- -command => sub { $self -> __event (@_)},
- -endcommand => sub {$self -> notify ('ANIMATION_END'); $self -> {__animation} = undef;},
- ],
- -stopcommand => sub {
- $self -> notify ('ANIMATION_ABORD', $self -> __getPoint ($self -> {__percentage}));
- $self -> {__animation} = undef;
- },
- -loop => $self -> mget ('loop'),
- );
- $animation -> start ();
+ my ($self) = @_;
+
+ my @points = @{$self -> mget ('path')};
+ if (!@points) {return;}
+ $self -> {__x} = $points [0] -> [0];
+ $self -> {__y} = $points [0] -> [1];
+ my $pacing = new Anim::Pacing::Linear (-duration => $self -> mget ('duration'));
+ $self -> {__percentage} = 0;
+ my $animationpath = new Anim::Path::Rectilinear (
+ -xdep => 0,
+ -ydep => 0,
+ -xdest => 100,
+ -ydest => 0,
+ );
+ $self -> {__animation} = my $animation = new Anim (
+ -pacing => $pacing,
+ -resources => [
+ $animationpath,
+ -command => sub { $self -> __event (@_)},
+ -endcommand => sub {$self -> notify ('ANIMATION_END');
+ $self -> {__animation} = undef;},
+ ],
+ -stopcommand => sub {
+ $self -> notify ('ANIMATION_ABORD', $self -> __getPoint ($self -> {__percentage}));
+ $self -> {__animation} = undef;
+ },
+ -loop => $self -> mget ('loop'),
+ );
+ $animation -> start ();
}
sub stop {
diff --git a/src/MTools/GUI/MClip.pm b/src/MTools/GUI/MClip.pm
index bc8405d..cf4f850 100644
--- a/src/MTools/GUI/MClip.pm
+++ b/src/MTools/GUI/MClip.pm
@@ -34,55 +34,55 @@ BEGIN
}
sub new {
- my ($class, $clipped, $path, $debug) = @_;
- my $self = new MTools::MObjet ();
- bless $self, $class;
-
- $self -> recordProperty ('-visible', 1);
- $self -> plisten ('-visible', sub {
- my ($src, $key, $val) = @_;
- if ($val == 0)
- {
- mconfigure($self->{__clipped}, -clip => undef);
- }
- else
- {
- mconfigure($self->{__clipped}, -clip => $self->{__clip});
- }
- });
-
- if (!defined $debug) {$debug = 0}
-
- my $clip = $path;
- if(ref ($path) eq 'ARRAY')
- {
- my $type = shift @{$path};
- $clip = $zinc -> add ($type, $clipped -> {instance}, $path,
- -filled => 1,
- -priority => 10,
- -linewidth => 0,
- -fillcolor => "#000000",
- -visible => $debug,
- -sensitive => 0,
- );
- }
- elsif(ref ($path) eq '')
- {
- $clip = minstance ($clip, $clipped);
- MTools::chggroup ($clip, $clipped);
- MTools::mconfigure ($clip, -visible => $debug, -sensitive => 0);
- }
- else
- {
- MTools::chggroup ($clip, $clipped);
- MTools::mconfigure (-visible => $debug, -sensitive => 0);
- $clip = minstance ($clip);
- }
+ my ($class, $clipped, $path, $debug) = @_;
+ my $self = new MTools::MObjet ();
+ bless $self, $class;
+
+ if (!defined $debug) {$debug = 0}
+
+ my $clip = $path;
+ if(ref ($path) eq 'ARRAY')
+ {
+ my $type = shift @{$path};
+ $clip = $zinc -> add ($type, $clipped -> {instance}, $path,
+ -filled => 1,
+ -priority => 10,
+ -linewidth => 0,
+ -fillcolor => "#000000",
+ -visible => $debug,
+ -sensitive => 0,
+ );
+ }
+ elsif(ref ($path) eq '')
+ {
+ $clip = minstance ($clip, $clipped);
+ MTools::chggroup ($clip, $clipped);
+ MTools::mconfigure ($clip, -visible => $debug, -sensitive => 0);
+ }
+ else
+ {
+ MTools::chggroup ($clip, $clipped);
+ MTools::mconfigure ($clip, -visible => $debug, -sensitive => 0);
+ $clip = minstance ($clip);
+ }
$self -> {__clipped} = $clipped;
$self -> {__clip} = $clip;
mconfigure ($clipped, -clip => $clip);
+
+ $self -> recordProperty ('-visible', 1);
+ $self -> plisten ('-visible', sub {
+ my ($src, $key, $val) = @_;
+ if ($val == 0)
+ {
+ mconfigure($self->{__clipped}, -clip => undef);
+ }
+ else
+ {
+ mconfigure($self->{__clipped}, -clip => $self->{__clip});
+ }
+ });
return $self;
-}
+ }
sub translate {
my ($self, @args) = @_;