Package | flexlib.controls |
Class | public class VerticalMenuBar |
Inheritance | VerticalMenuBar ![]() |
For information and an example on the attributes that you can use in the data provider for the VerticalMenuBar control, see the Menu control.
MXML Syntax
The <flexlib:VerticalMenuBar>
tag inherits all of the tag attributes of its superclass, and
adds the following tag attributes:
<flexlib:VerticalMenuBar Properties direction="left|right" />
See also
Property | Defined by | ||
---|---|---|---|
direction : String
Specifies which direction, either left or right, the menu opens.
| VerticalMenuBar |
Method | Defined by | ||
---|---|---|---|
Constructor
| VerticalMenuBar | ||
getMenuAt(index:int):Menu
Overridden to allow us to display the Menus to the left or right of the MenuItems.
| VerticalMenuBar |
Method | Defined by | ||
---|---|---|---|
measure():void
Changed to calculate based on vertical layout.
| VerticalMenuBar | ||
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Changed to calculate based on vertical layout.
| VerticalMenuBar |
Constant | Defined by | ||
---|---|---|---|
LEFT : String = "left" [static]
There are two possiblities for direction: left or right.
| VerticalMenuBar | ||
RIGHT : String = "right" [static]
There are two possiblities for direction: left or right.
| VerticalMenuBar |
direction | property |
direction:String
[read-write]Specifies which direction, either left or right, the menu opens.
This can be set via MXML or Actionscript. The direction will take effect the next time a menu item is clicked.
The default value is "right"
.
public function get direction():String
public function set direction(value:String):void
VerticalMenuBar | () | constructor |
public function VerticalMenuBar()
Constructor
getMenuAt | () | method |
public override function getMenuAt(index:int):Menu
Overridden to allow us to display the Menus to the left or right of the MenuItems.
We're overriding getMenuAt for two reasons. First, we set a custom itemRenderer for the menu if we're supposed to be facing left. Second, we add a listener that gets executed when the menu is shown. The secret to what we're doing is we're repositiong the menu only after it has been positioned originally by the mx.controls.MenuBar class. This allows us to not have to override a ton of private methods of the MenuBar class. The fundamental problem with extending MenuBar for our purposes is that the showMenu method is private. If showMenu was protected we might be able to just override that and specify our own coordinates for where to place the menu. But instead, we do it a sneaky way and try to move the Menu the instant it gets shown.
Parametersindex:int |
Menu |
measure | () | method |
protected override function measure():void
Changed to calculate based on vertical layout. Pretty much the same code as in MenuBar, but instad of using the X and width properties, now we're using Y and height.
updateDisplayList | () | method |
protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Changed to calculate based on vertical layout. Pretty much the same code as in MenuBar, but instad of using the X and width properties, now we're using Y and height.
ParametersunscaledWidth:Number |
|
unscaledHeight:Number |
LEFT | constant |
public static const LEFT:String = "left"
There are two possiblities for direction: left or right. Here we define these two constants that you should use in your AS code to change the direction of the VerticalMenuBar. So to change the direction the code would be something like: menubar.direction = VerticalMenuBar.LEFT;
RIGHT | constant |
public static const RIGHT:String = "right"
There are two possiblities for direction: left or right. Here we define these two constants that you should use in your AS code to change the direction of the VerticalMenuBar.