If the button is a toggle button and no arg has been specified,

pass the value of 'selected' (true or false) as the argument.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4349 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-08-29 20:55:16 +00:00
parent de5f5c4aec
commit 124835193e
@@ -36,8 +36,14 @@ public class CommandButton extends Button
if (enabled) {
// stop the click event
event.stopImmediatePropagation();
// dispatch the command event
CommandEvent.dispatch(this, _cmd, _arg);
// if the arg is null and we're a toggle button, dispatch our state
var arg :Object = _arg;
if (arg == null && toggle) {
arg = selected;
}
CommandEvent.dispatch(this, _cmd, arg);
}
}