Main Page | Packages | Class Tree | Index | Help

mx.controls

class Menu

Object
  |
  +--MovieClip
        |
        +--mx.core.UIObject
              |
              +--mx.core.UIComponent
                    |
                    +--mx.core.View
                          |
                          +--mx.core.ScrollView
                                |
                                +--mx.controls.listclasses.ScrollSelectList
                                      |
                                      +--mx.controls.Menu


class Menu
extends ScrollSelectList

Menu class - extends ScrollSelectList - gives the user the ability to select an option from a scrolling list



Field Summary


__activator



__activeChildren: Object



__anchor: Number



__anchorIndex: Number



__closeDelay: Number



__delayQueue: Array



__enabled: Boolean



__hScrollPolicy: String
Instance fields Pre-sets on ScrollSelectList fields


__iconField



__lastRowRolledOver: Number



__menuBar



__menuCache: Object



__menuDataProvider: Object
MDP will be used to hold the overall XML doc, but we'll still be manipulating ScrollSelectList's __dataProvider as the "displayList" for each individual submenu


__namedItems: Object



__openDelay: Number



__parentMenu: Menu



__radioGroups: Object



__rowHeight: Number



__rowRenderer: String



__timeOut



__timer



__vScrollPolicy: String



__wasVisible



_members: Object



_selection: Object



anchorRow: Object



invUpdateSize: Boolean



menuBarIndex: Number


static
mixit: Boolean
Static initialization

static
mixit2: Boolean



popupMask: MovieClip



popupTween: Tween



supposedToLoseFocus: Boolean


static
symbolName: String


static
symbolOwner: Object


static
version: String



wasJustCreated: Boolean


Fields inherited from class mx.controls.listclasses.ScrollSelectList

__cellRenderer, __dataProvider, __hPosition, __iconField, __iconFunction, __labelField, __labelFunction, __rowCount, __rowHeight, __rowRenderer, __width, addItem, addItemAt, baseRowZ, calcPreferredWidth, changeFlag, className, clearSelected, CONTENTDEPTH, createLabel, dataProvider, dragEnabled, dragScrolling, dropEnabled, enabled, getDataProvider, getItemAt, getLength, getSelectedIndex, getSelectedIndices, getSelectedItem, getSelectedItems, getValue, invLayoutContent, invRowHeight, invUpdateControl, isPressed, isRowStyle, isSelected, lastPosition, lastSelected, lastSelID, layoutX, layoutY, length, listContent, minScrollInterval, mixIt1, mixIt2, modelChanged, multipleSelection, onMouseUp, propertyTable, removeAll, removeItemAt, replaceItemAt, roundUp, rows, scrollInterval, selectable, selected, selectedIndex, selectedIndices, selectedItem, selectedItems, selectHolder, selectionDeleted, selectItem, setDataProvider, setSelectedIndex, setSelectedIndices, sortItems, sortItemsBy, tempLabel, tH, topRowZ, tW, value, wasKeySelected

Fields inherited from class mx.core.ScrollView

__hPosition, __hScrollPolicy, __maxHPosition, __viewMetrics, __vPosition, __vScrollPolicy, className, columnWidth, heightPadding, hScroller, invLayout, MASK_DEPTH, mask_mc, numberOfCols, oldRndUp, owner, propsInited, rowC, rowH, scrollAreaChanged, specialHScrollCase, symbolName, symbolOwner, version, viewableColumns, viewableRows, vScroller, widthPadding

Fields inherited from class mx.core.View

__tabIndex, border_mc, boundingBox_mc, childNameBase, className, createClassChildAtDepth, depth, loadExternal, symbolName, symbolOwner, version

Fields inherited from class mx.core.UIComponent

clipParameters, drawFocus, enabled, focusEnabled, focusManager, focusTextField, groupName, kStretch, mergedClipParameters, origBorderStyles, origBorderValues, popUp, symbolName, symbolOwner, tabEnabled, tabIndex, version

Fields inherited from class mx.core.UIObject

__height, __width, _color, _topmost, addEventListener, buildDepthTable, changeColorStyleInChildren, changeTextStyleInChildren, childrenCreated, className, clipParameters, color, createAccessibilityImplementation, createChildAtDepth, createEvent, ction, dispatchEvent, embedFonts, findNextAvailableDepth, fontFamily, fontSize, fontStyle, fontWeight, handleEvent, idNames, ignoreClassStyleDeclaration, initProperties, marginLeft, marginRight, methodTable, notifyStyleChangeInChildren, removeEventListener, setStyle, stylecache, styleName, symbolName, symbolOwner, textAlign, textColorList, textDecoration, textIndent, validateNow, version

Fields inherited from class MovieClip

_alpha, _currentframe, _droptarget, _focusrect, _framesloaded, _height, _lockroot, _name, _parent, _quality, _rotation, _soundbuftime, _target, _totalframes, _url, _visible, _width, _x, _xmouse, _xscale, _y, _ymouse, _yscale, enabled, focusEnabled, hitArea, tabChildren, tabEnabled, tabIndex, tooltipText, trackAsMenu, useHandCursor

Fields inherited from class Object

__proto__, constructor, prototype

Properties inherited from class mx.controls.listclasses.ScrollSelectList

cellRenderer, iconField, iconFunction, labelField, labelFunction, rowCount, rowHeight

Properties inherited from class mx.core.ScrollView

hPosition, hScrollPolicy, maxHPosition, maxVPosition, vPosition, vScrollPolicy

Properties inherited from class mx.core.View

numChildren, tabIndex

Properties inherited from class mx.core.UIComponent

height, width

Properties inherited from class mx.core.UIObject

bottom, height, left, minHeight, minWidth, right, scaleX, scaleY, top, visible, width, x, y

Constructor

public
Menu ( )
Constructor

Method Summary


__onMouseUp ( )
Menu visibility management

public
addMenuItem ( arg : Object ): Object
Append a menu item at the end of this menu.

public
addMenuItemAt ( index: Number, arg: Object ): Object
Insert a menu item into this menu.


callMenuDelay ( request: String, args: Object ): Void



callTimeOut ( Void ): Void



cancelMenuDelay ( Void ): Void



clearMenuDelay ( Void ): Void



clearTimeOut ( Void ): Void



closeSubMenu ( o: Object ): Void
close submenu


createChildren ( Void ): Void
Child construction

public static
createMenu ( parent, mdp, initObj )
Return the Menu instance described by the given MenuDataProvider, and place the instance in the given parent container.


draw ( Void ): Void
redraw by re-laying out

public
getDataProvider ( ): Object



getGroupSelection ( )
Group accessors Getter for group.selection

public
getMenuItemAt ( index: Number ): Object
Retrieve a menu item from this menu


getRootMenu ( Void ): Menu
Climb up and find the root menu

public
hide ( Void ): Void
If the Menu is visible, hide it and any visible submenus.


hideAllMenus ( Void )
Internal utilities

public
indexOf ( item : Object ): Number
Return the index of the given item within this menu.


init ( Void ): Void
Generic initializer


invalidateStyle ( propName : String ): Void
Theme support

public static
isItemEnabled ( itm : Object ): Boolean
utilities for querying an item's state

public static
isItemSelected ( itm : Object ): Boolean



isMouseOverMenu ( Void )



keyDown ( e: Object ): Void
takes keystrokes and maps them to selection movement increments

public
modelChanged ( eventObj )
Event handlers


moveSelBy ( incr : Number ): Void
Handle Key Events overwrite super's moveSelBy for altered functionality - need to include setVPosition calls if scolling is added


notifyStyleChangeInChildren ( sheetName, styleProp, newValue ): Void



onKillFocus ( )



onRowDragOver ( rowIndex : Number ): Void



onRowPress ( rowIndex : Number ): Void
::: PRIVATE INTERACTION METHODS all the below catch mouse events from the rows


onRowRelease ( rowIndex : Number ): Void



onRowRollOut ( rowIndex : Number ): Void



onRowRollOver ( rowIndex : Number ): Void



onSetFocus ( )



onTweenEnd ( val : Array ): Void



onTweenUpdate ( val : Array ): Void



openSubMenu ( o: Object ): Void
open submenu


propagateToSubMenus ( prop: String, value )


public
removeAll ( Void ): Object
Remove all items from the menu.

public
removeMenuItem ( item: Object ): Object
Remove an item from the menu.

public
removeMenuItemAt ( index: Number ): Object
Remove the item at a given index from the menu.


runDelayQueue ( Void ): Void



setCellRenderer ( cR ): Void


public
setDataProvider ( dP ): Void
Accessor support


setGroupSelection ( item )
Setter for group.selection


setIconField ( v : String ): Void



setIconFunction ( v : Function ): Void



setLabelField ( lbl: String )



setLabelFunction ( lbl: Function )



setMenuDelay ( delay: Number, request: String, args: Object ): Void
Interval functions used to delay submenu tasks setMenuDelay - sets the interval timer or defers to queue callMenuDelay - calls the delayed function and signals to clear the interval clearMenuDelay - clears the interval and checks the queue for more tasks cancelMenuRequest - cancels last request and removes it from the queue runDelayQueue - cycles through delayed tasks setTimeOut - sets a timer to test for out of bounds cursor movement clearTimeOut - clears timeout interval callTimeOut - checks if cursor is out of bounds from branch item openSubMenu - opens a submenu after the specified delay time closeSubMenu - closes a submenu(s) after the specified delay time

public
setMenuItemEnabled ( item: Object, enable: Boolean ): Void
Mark a menu item as 'enabled' (or not), and notify listeners.

public
setMenuItemSelected ( item: Object, select: Boolean ): Void
Mark a menu item as 'selected' (or not), and notify listeners.


setRowHeight ( v : Number ): Void



setTimeOut ( delay: Number, id: Number ): Void


public
show ( x: Number, y: Number ): Void
If the Menu isn't presently visible, place the top-left corner at the given coordinates within the parent, resize the menu as needed, and make it visible.


size ( Void ): Void
respond to size changes

Methods inherited from class mx.controls.listclasses.ScrollSelectList

__onMouseUp, createChildren, dragScroll, draw, findInputText, findString, getPropertiesAt, getPropertiesOf, getRowCount, getRowHeight, getStateAt, getStyle, init, invalidateStyle, keyDown, layoutContent, moveSelBy, onRowDragOut, onRowDragOver, onRowPress, onRowRelease, onRowRollOut, onRowRollOver, selectRow, setCellRenderer, setEnabled, setIconField, setIconFunction, setLabelField, setLabelFunction, setPropertiesAt, setRowCount, setRowHeight, setVPosition, updateControl

Methods inherited from class mx.core.ScrollView

__onMouseWheel, childLoaded, createChild, createChildren, doLayout, draw, getHPosition, getHScrollPolicy, getMaxHPosition, getViewMetrics, getVPosition, getVScrollPolicy, init, invalidate, onScroll, scrollProxy, setEnabled, setHPosition, setHScrollPolicy, setMaxHPosition, setScrollProperties, setVPosition, setVScrollPolicy, size

Methods inherited from class mx.core.View

addLayoutObject, childLoaded, convertToUIObject, createChild, createChildren, destroyChildAt, doLayout, draw, extension, getChildAt, init, initLayout, size

Methods inherited from class mx.core.UIComponent

dispatchValueChangedEvent, enabledChanged, findFocusFromObject, findFocusInChildren, getFocus, getFocusManager, init, isParent, onKillFocus, onSetFocus, pressFocus, releaseFocus, setEnabled, setFocus, setVisible, size

Methods inherited from class mx.core.UIObject

__getTextFormat, _createChildren, _getTextFormat, cancelAllDoLaters, constructObject, createChildren, createClassObject, createEmptyObject, createLabel, createObject, createSkin, destroyObject, doLater, doLaterDispatcher, draw, drawRect, getClassStyleDeclaration, getMinHeight, getMinWidth, getSkinIDName, getStyle, getStyleName, init, initFromClipParameters, invalidate, invalidateStyle, mergeClipParameters, move, redraw, setColor, setMinHeight, setMinWidth, setSize, setSkin, setVisible, size

Methods inherited from class MovieClip

attachAudio, attachMovie, beginFill, beginGradientFill, clear, createEmptyMovieClip, createTextField, curveTo, duplicateMovieClip, endFill, getBounds, getBytesLoaded, getBytesTotal, getDepth, getInstanceAtDepth, getNextHighestDepth, getSWFVersion, getTextSnapshot, getURL, globalToLocal, gotoAndPlay, gotoAndStop, hitTest, lineStyle, lineTo, loadMovie, loadVariables, localToGlobal, moveTo, nextFrame, onData, onDragOut, onDragOver, onEnterFrame, onKeyDown, onKeyUp, onKillFocus, onLoad, onMouseDown, onMouseMove, onMouseUp, onPress, onRelease, onReleaseOutside, onRollOut, onRollOver, onSetFocus, onUnload, play, prevFrame, removeMovieClip, setMask, startDrag, stop, stopDrag, swapDepths, unloadMovie, valueOf

Methods inherited from class Object

addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toLocaleString, toString, unwatch, valueOf, watch



Field Documentation

__activator

var __activator

__activeChildren

var __activeChildren: Object

__anchor

var __anchor: Number

__anchorIndex

var __anchorIndex: Number

__closeDelay

var __closeDelay: Number

__delayQueue

var __delayQueue: Array

__enabled

var __enabled: Boolean

__hScrollPolicy

var __hScrollPolicy: String
Instance fields Pre-sets on ScrollSelectList fields

__iconField

var __iconField

__lastRowRolledOver

var __lastRowRolledOver: Number

__menuBar

var __menuBar

__menuCache

var __menuCache: Object

__menuDataProvider

var __menuDataProvider: Object
MDP will be used to hold the overall XML doc, but we'll still be manipulating ScrollSelectList's __dataProvider as the "displayList" for each individual submenu

__namedItems

var __namedItems: Object

__openDelay

var __openDelay: Number

__parentMenu

var __parentMenu: Menu

__radioGroups

var __radioGroups: Object

__rowHeight

var __rowHeight: Number

__rowRenderer

var __rowRenderer: String

__timeOut

var __timeOut

__timer

var __timer

__vScrollPolicy

var __vScrollPolicy: String

__wasVisible

var __wasVisible

_members

var _members: Object

_selection

var _selection: Object

anchorRow

var anchorRow: Object

invUpdateSize

var invUpdateSize: Boolean

menuBarIndex

var menuBarIndex: Number

mixit

static var mixit: Boolean
Static initialization

mixit2

static var mixit2: Boolean

popupMask

var popupMask: MovieClip

popupTween

var popupTween: Tween

supposedToLoseFocus

var supposedToLoseFocus: Boolean

symbolName

static var symbolName: String

symbolOwner

static var symbolOwner: Object

version

static var version: String

wasJustCreated

var wasJustCreated: Boolean

Constructor Documentation

Menu

public function Menu()
Constructor


Method Documentation

__onMouseUp

function __onMouseUp()
Menu visibility management

Overrides:

addMenuItem

public function addMenuItem(arg : Object): Object
Append a menu item at the end of this menu.

Parameters:
arg
arg may be either (1) a String (to be used as the item's label), (2) an Object (whose properties will be copied into the resulting XMLNode's attributes), (3) an XMLNode (used directly), or (4) an XML instance whose firstChild will be cloned and used.
Returns:
an XMLNode carrying a representation of the menu item's state

addMenuItemAt

public function addMenuItemAt(index: Number,
 arg: Object): Object
Insert a menu item into this menu.

Parameters:
index
the index where the item should be inserted
arg
may be either (1) a String (to be used as the item's label), (2) an Object (whose properties will be copied into the resulting XMLNode's attributes), (3) an XMLNode (used directly), or (4) an XML instance whose firstChild will be cloned and used.
Returns:
an XMLNode carrying a representation of the menu item's state

callMenuDelay

function callMenuDelay(request: String,
 args: Object): Void

callTimeOut

function callTimeOut(Void): Void

cancelMenuDelay

function cancelMenuDelay(Void): Void

clearMenuDelay

function clearMenuDelay(Void): Void

clearTimeOut

function clearTimeOut(Void): Void

closeSubMenu

function closeSubMenu(o: Object): Void
close submenu

createChildren

function createChildren(Void): Void
Child construction

Overrides:

createMenu

public static function createMenu(parent,
 mdp,
 initObj)
Return the Menu instance described by the given MenuDataProvider, and place the instance in the given parent container.

Parameters:
parent
the container
mdp
a MenuDataProvider to base the menu on
initObj
Returns:
a Menu instance, already placed inside the parent, but invisible

draw

function draw(Void): Void
redraw by re-laying out

Overrides:

getDataProvider

public function getDataProvider(): Object
Overrides:

getGroupSelection

function getGroupSelection()
Group accessors Getter for group.selection

getMenuItemAt

public function getMenuItemAt(index: Number): Object
Retrieve a menu item from this menu

Parameters:
index
the index of the item to be retrieved
Returns:
a reference to the XMLNode that was removed

getRootMenu

function getRootMenu(Void): Menu
Climb up and find the root menu

hide

public function hide(Void): Void
If the Menu is visible, hide it and any visible submenus.

hideAllMenus

function hideAllMenus(Void)
Internal utilities

indexOf

public function indexOf(item : Object): Number
Return the index of the given item within this menu.

If the target item does not belong to this menu, then return undefined.

Parameters:
item
item the target item
Returns:
the index of the given item, or undefined

init

function init(Void): Void
Generic initializer

Overrides:

invalidateStyle

function invalidateStyle(propName : String): Void
Theme support

Overrides:

isItemEnabled

public static function isItemEnabled(itm : Object): Boolean
utilities for querying an item's state

isItemSelected

public static function isItemSelected(itm : Object): Boolean

isMouseOverMenu

function isMouseOverMenu(Void)

keyDown

function keyDown(e: Object): Void
takes keystrokes and maps them to selection movement increments

Overrides:

modelChanged

public function modelChanged(eventObj)
Event handlers

Overrides:

moveSelBy

function moveSelBy(incr : Number): Void
Handle Key Events overwrite super's moveSelBy for altered functionality - need to include setVPosition calls if scolling is added

no clicks!

Overrides:

notifyStyleChangeInChildren

function notifyStyleChangeInChildren(sheetName,
 styleProp,
 newValue): Void
Overrides:

onKillFocus

function onKillFocus()
Overrides:

onRowDragOver

function onRowDragOver(rowIndex : Number): Void
Overrides:

onRowPress

function onRowPress(rowIndex : Number): Void
::: PRIVATE INTERACTION METHODS all the below catch mouse events from the rows

Overrides:

onRowRelease

function onRowRelease(rowIndex : Number): Void
Overrides:

onRowRollOut

function onRowRollOut(rowIndex : Number): Void
Overrides:

onRowRollOver

function onRowRollOver(rowIndex : Number): Void
Overrides:

onSetFocus

function onSetFocus()
Overrides:

onTweenEnd

function onTweenEnd(val : Array): Void

onTweenUpdate

function onTweenUpdate(val : Array): Void

openSubMenu

function openSubMenu(o: Object): Void
open submenu

propagateToSubMenus

function propagateToSubMenus(prop: String,
 value)

removeAll

public function removeAll(Void): Object
Remove all items from the menu.

Overrides:

removeMenuItem

public function removeMenuItem(item: Object): Object
Remove an item from the menu.

If it doesn't belong to this Menu, then do nothing and return undefined.

Parameters:
item
the item to be removed
Returns:
a reference to the XMLNode that was removed, or undefined if the given item does not belong to this Menu instance.

removeMenuItemAt

public function removeMenuItemAt(index: Number): Object
Remove the item at a given index from the menu.

If there's no item at the given index, then do nothing and return undefined.

Parameters:
index
the index of the item to be removed
Returns:
a reference to the XMLNode that was removed (if any)

runDelayQueue

function runDelayQueue(Void): Void

setCellRenderer

function setCellRenderer(cR): Void
Overrides:

setDataProvider

public function setDataProvider(dP): Void
Accessor support

Overrides:

setGroupSelection

function setGroupSelection(item)
Setter for group.selection

setIconField

function setIconField(v : String): Void
Overrides:

setIconFunction

function setIconFunction(v : Function): Void
Overrides:

setLabelField

function setLabelField(lbl: String)
Overrides:

setLabelFunction

function setLabelFunction(lbl: Function)
Overrides:

setMenuDelay

function setMenuDelay(delay: Number,
 request: String,
 args: Object): Void
Interval functions used to delay submenu tasks setMenuDelay - sets the interval timer or defers to queue callMenuDelay - calls the delayed function and signals to clear the interval clearMenuDelay - clears the interval and checks the queue for more tasks cancelMenuRequest - cancels last request and removes it from the queue runDelayQueue - cycles through delayed tasks setTimeOut - sets a timer to test for out of bounds cursor movement clearTimeOut - clears timeout interval callTimeOut - checks if cursor is out of bounds from branch item openSubMenu - opens a submenu after the specified delay time closeSubMenu - closes a submenu(s) after the specified delay time

setMenuItemEnabled

public function setMenuItemEnabled(item: Object,
 enable: Boolean): Void
Mark a menu item as 'enabled' (or not), and notify listeners.

Parameters:
item
the target item
enable
a boolean indicating whether the item is enabled or not

setMenuItemSelected

public function setMenuItemSelected(item: Object,
 select: Boolean): Void
Mark a menu item as 'selected' (or not), and notify listeners.

Parameters:
item
the target item
select
a boolean indicating whether the item is selected or not

setRowHeight

function setRowHeight(v : Number): Void
Overrides:

setTimeOut

function setTimeOut(delay: Number,
 id: Number): Void

show

public function show(x: Number,
 y: Number): Void
If the Menu isn't presently visible, place the top-left corner at the given coordinates within the parent, resize the menu as needed, and make it visible.

This method also fires a "show" event to all listeners.

Parameters:
x
(optional) the horizontal location of the top-left corner
y
(optional) the vertical location of the top-left corner

size

function size(Void): Void
respond to size changes

Overrides:


The documentation was generated from the following file:


Copyright © 1997-2005 Macromedia, Inc. All rights reserved. Generated with AS2Doc