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:
@@ -93,8 +93,8 @@ public class CommandMenu extends ScrollableArrowMenu
|
|||||||
/**
|
/**
|
||||||
* Actually pop up the menu. This can be used instead of show().
|
* Actually pop up the menu. This can be used instead of show().
|
||||||
*/
|
*/
|
||||||
public function popUp (
|
public function popUp (trigger :DisplayObject, popUpwards :Boolean = false,
|
||||||
trigger :DisplayObject, popUpwards :Boolean = false) :void
|
popLeftwards :Boolean = false) :void
|
||||||
{
|
{
|
||||||
var r :Rectangle = trigger.getBounds(trigger.stage);
|
var r :Rectangle = trigger.getBounds(trigger.stage);
|
||||||
|
|
||||||
@@ -107,6 +107,11 @@ public class CommandMenu extends ScrollableArrowMenu
|
|||||||
// position it below the trigger
|
// position it below the trigger
|
||||||
show(r.x, r.y + r.height);
|
show(r.x, r.y + r.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (popLeftwards) {
|
||||||
|
// reposition the x now that we know our size
|
||||||
|
x = r.x + r.width - getExplicitOrMeasuredWidth();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user