flexlib :: library Documentation | All Packages | All Classes | Index | Frames No Frames |
ScrollableArrowMenu

Package | flexlib.controls
Class | public class ScrollableArrowMenu
Inheritance | ScrollableArrowMenu ScrollableMenu mx.controls.Menu

An extension of ScrollableMenu that uses two arrow buttons placed at the top and bottom of the menu for scrolling.

Default MXML Property `dataProvider`

See also

flexlib.controls.ScrollableMenu

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | arrowScrollPolicy : String Just like verticalScrollPolicy, except it controls how we display the up and down arrows for scrolling. | ScrollableArrowMenu
|  | dataProvider : Object [override] [write-only] | ScrollableMenu
|  | hideOnActivity : Boolean = true | ScrollableMenu
|  | rowCount : int [override] [write-only] | ScrollableMenu
|  | scrollJump : Number = 1 Specifies how many rows to scroll each time. | ScrollableArrowMenu
|  | scrollSpeed : Number = 80 The delay between scrolling the list, so a smaller number here will increase the speed of the scrolling. | ScrollableArrowMenu
|  | verticalScrollPolicy : String [override] Override the verticalScrollPolicy so we can re-instate scrolling functionality. | ScrollableMenu

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | ScrollableArrowMenu() Constructor | ScrollableArrowMenu
|  | createMenu(parent:DisplayObjectContainer, mdp:Object, showRoot:Boolean = true):ScrollableArrowMenu [static] We have to override the static function createMenu so that we create a ScrollableMenu instead of a normal Menu. | ScrollableArrowMenu
|  | hide():void [override] | ScrollableMenu
|  | initialize():void [override] | ScrollableArrowMenu
|  | move(x:Number, y:Number):void [override] | ScrollableMenu
|  | show(xShow:Object = null, yShow:Object = null):void [override] | ScrollableMenu

Protected Methods
Show Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined By
--- | --- | ---
|  | clearMenu(row:IMenuItemRenderer):void Clear the menu reference from the menu item renderer | ScrollableMenu
|  | configureScrollBars():void [override] Overridden to reinstate proper scrolling functionality. | ScrollableMenu
|  | createChildren():void [override] We override createChildren so we can instantiate our up and down buttons and add them as children. | ScrollableArrowMenu
|  | createSubMenu():Menu [override] | ScrollableArrowMenu
|  | measure():void [override] We overide the measure() method because we need to check if the menu is going off the stage. | ScrollableMenu
|  | mouseUpHandler(event:MouseEvent):void [override] | ScrollableMenu
|  | onScroll(event:ScrollEvent):void Callback function called when the menu scroll bar is scrolled | ScrollableMenu
|  | updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void [override] We've got to layout the up and down buttons now. | ScrollableArrowMenu

Styles

| Style | Description | Defined By
--- | --- | --- | ---
|  | downButtonStyleName | Type: String CSS Inheritance: no Name of CSS style declaration that specifies style for button used to control the vertical scrolling. This button appears on the bottom of the ScrollableArrowMenu control. The default value is`undefined`. | ScrollableArrowMenu
|  | upButtonStyleName | Type: String CSS Inheritance: no Name of CSS style declaration that specifies style for button used to control the vertical scrolling. This button appears on the top of the ScrollableArrowMenu control. The default value is`undefined`. | ScrollableArrowMenu

Property Detail

arrowScrollPolicy | property

`arrowScrollPolicy:String`

Just like verticalScrollPolicy, except it controls how we display the up and down arrows for scrolling.

If this is set to ScrollPolicy.OFF we never show the arrows. If it's ScrollPolicy.ON we always show the arrows. And if it's ScrollPolicy.AUTO then we show the arrows if they are needed. OFF and AUTO are the only ones that should probably be used, since ON gets in the way of the first menu item in the list.

Implementation
`public function get arrowScrollPolicy():String`
`public function set arrowScrollPolicy(value:String):void`

scrollJump | property |

`public var scrollJump:Number = 1`

Specifies how many rows to scroll each time. Leaving it at 1 makes for the smoothest scrolling

scrollSpeed | property |

`public var scrollSpeed:Number = 80`

The delay between scrolling the list, so a smaller number here will increase the speed of the scrolling. This is in ms.

Constructor Detail

ScrollableArrowMenu | () | Constructor

`public function ScrollableArrowMenu()`

Constructor

Method Detail

createChildren | () | method

`override protected function createChildren():void`

We override createChildren so we can instantiate our up and down buttons and add them as children.

createMenu | () | method |

`public static function createMenu(parent:DisplayObjectContainer, mdp:Object, showRoot:Boolean = true):ScrollableArrowMenu`

We have to override the static function createMenu so that we create a ScrollableMenu instead of a normal Menu.

Parameters

| `parent:DisplayObjectContainer`
| `mdp:Object`
| `showRoot:Boolean` (default = `true`)``

Returns

| `ScrollableArrowMenu`

createSubMenu | () | method |

`override protected function createSubMenu():Menu`

Returns

| `Menu`

initialize | () | method |

`override public function initialize():void`

updateDisplayList | () | method |

`override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void`

We've got to layout the up and down buttons now. They are overlaid on the list at the very top and bottom.

Parameters

| `unscaledWidth:Number`
| `unscaledHeight:Number`

Mercredi Juillet 4 2012, 09:36 PM +02:00