aboutsummaryrefslogtreecommitdiff
path: root/src/MTools
diff options
context:
space:
mode:
authormerlin2007-11-26 08:58:30 +0000
committermerlin2007-11-26 08:58:30 +0000
commit2279735610af3a6986bf2f83b46f5e78b2c80014 (patch)
tree8d80798e5832e9b7daed45761b4ab369a3e4caf1 /src/MTools
parent3a88ad93c9165176b292d10afd0c271303f5538f (diff)
downloadmtc-2279735610af3a6986bf2f83b46f5e78b2c80014.zip
mtc-2279735610af3a6986bf2f83b46f5e78b2c80014.tar.gz
mtc-2279735610af3a6986bf2f83b46f5e78b2c80014.tar.bz2
mtc-2279735610af3a6986bf2f83b46f5e78b2c80014.tar.xz
Emission d'evenements supplementaires sur Button ButtonRelease et Button_Motion lorsque la valeur de la propriete visible est 0
Diffstat (limited to 'src/MTools')
-rw-r--r--src/MTools/Comp/MMover.pm19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/MTools/Comp/MMover.pm b/src/MTools/Comp/MMover.pm
index 6b8c1c1..ae523d7 100644
--- a/src/MTools/Comp/MMover.pm
+++ b/src/MTools/Comp/MMover.pm
@@ -63,6 +63,9 @@ sub new {
$self -> recordEvent ('PRESSED');
$self -> recordEvent ('MOVED');
$self -> recordEvent ('RELEASED');
+ $self -> recordEvent ('PRESSED_OFF');
+ $self -> recordEvent ('MOVED_OFF');
+ $self -> recordEvent ('RELEASED_OFF');
$button = 1 if ! defined $button;
binding ($src, "<Button-$button>", [\&__pressed, $self, Ev('x'), Ev('y'), Ev('t')]);
@@ -100,7 +103,10 @@ sub setPos {
sub __pressed {
my ($self, $x, $y, $t) = @_;
- if(!$self -> mget('-visible')) {return;}
+ if(!$self -> mget('-visible')) {
+ $self -> notify ('PRESSED_OFF', $x, $y, $t);
+ return;
+ }
$self -> {__started} = 1;
$self -> {__last_mouse_x} = $x;
$self -> {__last_mouse_y} = $y;
@@ -109,8 +115,10 @@ sub __pressed {
sub __moved {
my ($self, $x, $y, $t) = @_;
- if (!$self -> {__started}) {return;}
- if(!$self -> mget('-visible')) {return;}
+ if (!$self -> {__started} || !$self -> mget('-visible')) {
+ $self -> notify ('MOVED_OFF', $x, $y, $t);
+ return;
+ }
my $dx = $x - $self -> {__last_mouse_x};
my $dy = $y - $self -> {__last_mouse_y};
@@ -177,7 +185,10 @@ sub __moved {
sub __released {
my ($self, $x, $y, $t) = @_;
$self -> {__started} = 0;
- if(!$self -> mget('-visible')) {return;}
+ if (!$self -> mget('-visible')) {
+ $self -> notify ('RELEASED_OFF', $x, $y, $t);
+ return;
+ }
$self -> notify ('RELEASED', $self -> {__last_mouse_x}, $self -> {__last_mouse_y}, $t);
}