Packageflexlib.controls
Classpublic class VerticalMenuBar
InheritanceVerticalMenuBar Inheritance mx.controls.MenuBar

A VerticalMenuBar control defines a vertical, top-level menu bar that contains one or menu items, just like the horizontal MenuBar control.

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 Syntaxexpanded Hide 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

mx.controls.MenuBar


Public Properties
 PropertyDefined by
  direction : String
Specifies which direction, either left or right, the menu opens.
VerticalMenuBar
Public Methods
 MethodDefined by
  
Constructor
VerticalMenuBar
  
getMenuAt(index:int):Menu
Overridden to allow us to display the Menus to the left or right of the MenuItems.
VerticalMenuBar
Protected Methods
 MethodDefined 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
Public Constants
 ConstantDefined 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
Property detail
directionproperty
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".

Implementation
    public function get direction():String
    public function set direction(value:String):void
Constructor detail
VerticalMenuBar()constructor
public function VerticalMenuBar()

Constructor

Method detail
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.

Parameters
index:int

Returns
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.

Parameters
unscaledWidth:Number
 
unscaledHeight:Number
Constant detail
LEFTconstant
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;

RIGHTconstant 
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.