diff options
author | caramel | 2007-09-12 09:55:12 +0000 |
---|---|---|
committer | caramel | 2007-09-12 09:55:12 +0000 |
commit | 2b7266dc0591818d289ff215fff8acd031de7366 (patch) | |
tree | 3b65ef0ee33339cfd1a19b2df16ab88d8750227d /src/MTools | |
parent | c9c5e72e45bec517b39cd016f80cd57e3f52cf05 (diff) | |
download | mtc-2b7266dc0591818d289ff215fff8acd031de7366.zip mtc-2b7266dc0591818d289ff215fff8acd031de7366.tar.gz mtc-2b7266dc0591818d289ff215fff8acd031de7366.tar.bz2 mtc-2b7266dc0591818d289ff215fff8acd031de7366.tar.xz |
Amelioration optionnelle du RadioBouton, qui desormais accepte l'etat de survol
Diffstat (limited to 'src/MTools')
-rw-r--r-- | src/MTools/Widget/MRadioBouton.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/MTools/Widget/MRadioBouton.pm b/src/MTools/Widget/MRadioBouton.pm index 1dfa1a4..768a00d 100644 --- a/src/MTools/Widget/MRadioBouton.pm +++ b/src/MTools/Widget/MRadioBouton.pm @@ -36,6 +36,7 @@ sub new { bless $self, $class; my $on = $options {g_on}; + my $over = defined $options {g_over} ? $options {g_over} : $on; my $off = $options {g_off}; $self -> recordEvent ('RELEASE'); @@ -44,6 +45,8 @@ sub new { my @gon; push (@gon, $on); + my @gover; + push (@gover, $over); my @goff; push (@goff, $off); @@ -59,17 +62,32 @@ sub new { my $sw = new MTools::MSwitch ( $self, on => \@gon, + over => \@gover, off => \@goff, ); my $st = new MTools::MState ( current_state => 'on', events => { + enter => [$self, '<Enter>'], + leave => [$self, '<Leave>'], press => [$self, '<Button-1>'], press2 => [$self, 'PRESS'], release => [$self, 'RELEASE'], }, transitions => { on => { + enter => { + to => 'over', + }, + press2 => { + to => 'off', + notify => 'PRESSED', + }, + }, + over => { + leave => { + to => 'on', + }, press => { to => 'off', notify => 'PRESSED', |