Added popLeftwards. Only really useful for menus without submenus.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@198 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2007-04-14 01:45:04 +00:00
parent a3b441fcaa
commit c8ee262b7f
+7 -2
View File
@@ -93,8 +93,8 @@ public class CommandMenu extends ScrollableArrowMenu
/**
* Actually pop up the menu. This can be used instead of show().
*/
public function popUp (
trigger :DisplayObject, popUpwards :Boolean = false) :void
public function popUp (trigger :DisplayObject, popUpwards :Boolean = false,
popLeftwards :Boolean = false) :void
{
var r :Rectangle = trigger.getBounds(trigger.stage);
@@ -107,6 +107,11 @@ public class CommandMenu extends ScrollableArrowMenu
// position it below the trigger
show(r.x, r.y + r.height);
}
if (popLeftwards) {
// reposition the x now that we know our size
x = r.x + r.width - getExplicitOrMeasuredWidth();
}
}
/**