aboutsummaryrefslogtreecommitdiff
path: root/src/MTools/Comp/MMover.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/MTools/Comp/MMover.pm')
-rw-r--r--src/MTools/Comp/MMover.pm20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/MTools/Comp/MMover.pm b/src/MTools/Comp/MMover.pm
index 7346e83..a2a5b9c 100644
--- a/src/MTools/Comp/MMover.pm
+++ b/src/MTools/Comp/MMover.pm
@@ -66,6 +66,8 @@ sub new {
$self -> recordEvent ('PRESSED_OFF');
$self -> recordEvent ('MOVED_OFF');
$self -> recordEvent ('RELEASED_OFF');
+ $self -> recordEvent ('MOVED_OUT_OF_BOUNDS');
+
$button = 1 if ! defined $button;
binding ($src, "<Button-$button>", [\&__pressed, $self, Ev('x'), Ev('y'), Ev('t')]);
@@ -90,12 +92,23 @@ sub setPos {
@targets = @{$tgs};
for (my $i = 0; $i < @targets; $i++)
{
- $targets [$i] -> $translate_cbk ($dx, $dy);
+ my $obj = $targets [$i];
+ if(ref ($obj) ne '') {
+ $obj -> $translate_cbk ($dx, $dy);
+ }
+ else {
+ $zinc -> $translate_cbk ($obj, $dx, $dy);
+ }
}
}
else
{
- $tgs -> $translate_cbk ($dx, $dy);
+ if(ref ($tgs) ne '') {
+ $tgs -> $translate_cbk ($dx, $dy);
+ }
+ else {
+ $zinc -> $translate_cbk ($tgs, $dx, $dy);
+ }
}
$self -> mconfigure ('x', $x);
$self -> mconfigure ('y', $y);
@@ -159,6 +172,7 @@ sub __moved {
}
if( $dx == 0 && $dy == 0 )
{
+ $self -> notify ('MOVED_OUT_OF_BOUNDS', $x, $y, $t);
return;
}
my $allower = $self -> mget ('allower');
@@ -171,6 +185,7 @@ sub __moved {
$dy -= $ddy;
if( $dx == 0 && $dy == 0 )
{
+ $self -> notify ('MOVED_OUT_OF_BOUNDS', $x, $y, $t);
return;
}
}
@@ -184,6 +199,7 @@ sub __moved {
sub __released {
my ($self, $x, $y, $t) = @_;
+
$self -> {__started} = 0;
if (!$self -> mget('-visible')) {
$self -> notify ('RELEASED_OFF', $x, $y, $t);