aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ManaTools/Shared/GUI/Event.pm8
-rw-r--r--lib/ManaTools/Shared/GUI/EventHandlerRole.pm5
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/ManaTools/Shared/GUI/Event.pm b/lib/ManaTools/Shared/GUI/Event.pm
index f9793a7f..655adffb 100644
--- a/lib/ManaTools/Shared/GUI/Event.pm
+++ b/lib/ManaTools/Shared/GUI/Event.pm
@@ -133,12 +133,12 @@ has 'backend' => (
sub processEvent {
my $self = shift;
my $yevent = shift;
- return 1 if ($yevent->eventType != $self->eventType);
- return 1 if ($yevent->eventType == $yui::YEvent::WidgetEvent && !$self->equalsWidget($yevent->widget));
- return 1 if ($yevent->eventType == $yui::YEvent::MenuEvent && !$self->equalsItem($yevent->item));
+ return -1 if ($yevent->eventType != $self->eventType);
+ return -1 if ($yevent->eventType == $yui::YEvent::WidgetEvent && !$self->equalsWidget($yevent->widget));
+ return -1 if ($yevent->eventType == $yui::YEvent::MenuEvent && !$self->equalsItem($yevent->item));
my $event = $self->event();
return $event->($self, $yevent, $self->backend()) if defined($event);
- return 1;
+ return -1;
}
sub equalsWidget {
diff --git a/lib/ManaTools/Shared/GUI/EventHandlerRole.pm b/lib/ManaTools/Shared/GUI/EventHandlerRole.pm
index 83db71b3..fd785cba 100644
--- a/lib/ManaTools/Shared/GUI/EventHandlerRole.pm
+++ b/lib/ManaTools/Shared/GUI/EventHandlerRole.pm
@@ -278,7 +278,7 @@ sub delWidget {
my $self = shift;
my $widget = shift;
my $event = $self->findWidget($widget);
- $self->delEvent($event) if (defined $event);
+ $self->delEvent($event->name()) if (defined $event);
}
#=============================================================
@@ -361,7 +361,8 @@ sub processEvents {
my $events = $self->events();
# loop all the items
for my $event (values %{$events}) {
- return 0 if(!$event->processEvent($yevent));
+ my $processed = $event->processEvent($yevent);
+ return $processed if $processed >= 0;
}
return 1;
}