Packageflexlib.controls
Classpublic class ScrollableMenuBar
InheritanceScrollableMenuBar Inheritance mx.controls.MenuBar

ScrollableMenuBar is an extension of MenuBar that uses flexlib.controls.ScrollableMenu instead of using the original mx.controls.Menu. This allows us to specify a maxHeight for the ScrollableMenuBar and that maxHeight will be used to determine the maxHeight for all the menus that the component generates.

We only had to override the getMenuAt method to make it generate a ScrollableMenu. In order to set the event listeners of the newly created ScrollableMenu, the eventHandler method (which was a private method of MenuBar) was duplicated in this class.

See also

mx.controls.MenuBar


Public Properties
 PropertyDefined by
  arrowScrollPolicy : String
The policy to show the up and down arrows at the top and bottom of the menu control.
ScrollableMenuBar
  verticalScrollPolicy : String
Specifys the vertical scrolling policy for this control.
ScrollableMenuBar
Public Methods
 MethodDefined by
  
Constructor
ScrollableMenuBar
  
getMenuAt(index:int):Menu
Overriding getMenuAt because the original method in MenuBar creates a new Menu object.
ScrollableMenuBar
Property detail
arrowScrollPolicyproperty
arrowScrollPolicy:String  [read-write]

The policy to show the up and down arrows at the top and bottom of the menu control.

Possible values are the same as verticalScrollPolicy and can be ScrollPolicy.AUTO, ScrollPolicy.ON and ScrollPolicy.OFF. ScrollPolicy.ON shouldn't be used since it obstructs the menu items at the top and bottom of the list. Why did I allow it? I don't know.

Implementation
    public function get arrowScrollPolicy():String
    public function set arrowScrollPolicy(value:String):void
verticalScrollPolicyproperty 
verticalScrollPolicy:String  [read-write]

Specifys the vertical scrolling policy for this control.

Implementation
    public function get verticalScrollPolicy():String
    public function set verticalScrollPolicy(value:String):void

See also

mx.core.ScrollPolicy
Constructor detail
ScrollableMenuBar()constructor
public function ScrollableMenuBar()

Constructor

Method detail
getMenuAt()method
public override function getMenuAt(index:int):Menu

Overriding getMenuAt because the original method in MenuBar creates a new Menu object. We need to create a new ScrollableMenu instead, so we're forced to override this entire method.

Parameters
index:int

Returns
Menu