Added addSeparator().
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@777 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -105,6 +105,18 @@ public class CommandMenu extends Menu
|
|||||||
return 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
|
* The mx.controls.Menu class overrides setting and getting the verticalScrollPolicy
|
||||||
* basically setting the verticalScrollPolicy did nothing, and getting it always returned
|
* basically setting the verticalScrollPolicy did nothing, and getting it always returned
|
||||||
|
|||||||
Reference in New Issue
Block a user