Added CommandEvent.markAsHandled().

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4430 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-10-18 01:38:48 +00:00
parent 1468a3fa3d
commit 7d68d9c617
2 changed files with 11 additions and 2 deletions
@@ -47,6 +47,16 @@ public class CommandEvent extends Event
this.arg = arg;
}
/**
* Mark this command as handled, stopping its propagation up the
* hierarchy.
*/
public function markAsHandled () :void
{
preventDefault();
stopImmediatePropagation();
}
override public function clone () :Event
{
return create(command, arg);
+1 -2
View File
@@ -96,8 +96,7 @@ public class Controller
if (handleAction(event.command, event.arg)) {
// if we handle the event, stop it from moving outward to another
// controller
event.preventDefault();
event.stopImmediatePropagation();
event.markAsHandled();
}
}