Added addSeparator().

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@777 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2009-03-03 00:13:13 +00:00
parent 56e43572b8
commit 1b14473f25
+12
View File
@@ -105,6 +105,18 @@ public class CommandMenu extends Menu
return menu;
}
/**
* Add a separator to the specified menu, unless it would not make sense to do so, because
* the menu is empty or already ends with a separator.
*/
public static function addSeparator (menuItems :Array) :void
{
const len :int = menuItems.length;
if (len > 0 && menuItems[len - 1].type != "separator") {
menuItems.push({ type: "separator" });
}
}
/**
* The mx.controls.Menu class overrides setting and getting the verticalScrollPolicy
* basically setting the verticalScrollPolicy did nothing, and getting it always returned