From c8ee262b7f8983cfe8cccea072f394ac8e3eea81 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 14 Apr 2007 01:45:04 +0000 Subject: [PATCH] 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 --- src/as/com/threerings/flex/CommandMenu.as | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/as/com/threerings/flex/CommandMenu.as b/src/as/com/threerings/flex/CommandMenu.as index b83b60ab..b44a9b5b 100644 --- a/src/as/com/threerings/flex/CommandMenu.as +++ b/src/as/com/threerings/flex/CommandMenu.as @@ -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(); + } } /**