blob: 86e2d931331f6908f70b1c00997a4d9979b07a53 [file] [log] [blame]
{ "type": "class",
"qname": "mx.controls.Menu",
"baseClassname": "mx.core.UIComponent"
,
"description": "The Menu control creates a pop-up menu of individually selectable choices, similar to the File or Edit menu found in most software applications. The popped up menu can have as many levels of submenus as needed. After a Menu control has opened, it remains visible until it is closed by any of the following actions: <ul> <li>A call to the <code>Menu.hide()</code> method.</li> <li>When a user selects an enabled menu item.</li> <li>When a user clicks outside of the Menu control.</li> <li>When a user selects another component in the application.</li> </ul> <p>The Menu class has no corresponding MXML tag. You must create it using ActionScript.</p> <p>The Menu control has the following sizing characteristics:</p> <table class=&quot;innertable&quot;> <tr> <th>Characteristic</th> <th>Description</th> </tr> <tr> <td>Default size</td> <td>The width is determined from the Menu text. The default height is the number of menu rows multiplied by 19 pixels per row (the default row height).</td> </tr> </table> <p>The data provider for Menu items can specify several attributes that determine how the item is displayed and behaves, as the following XML data provider shows:</p> <pre>\\n &lt;mx:XML format=&quot;e4x&quot; id=&quot;myMenuData&quot;&gt;\\n &lt;root&gt;\\n &lt;menuitem label=&quot;MenuItem A&quot; icon=&quot;myTopIcon&quot;&gt;\\n &lt;menuitem label=&quot;SubMenuItem A-1&quot; enabled=&quot;False&quot;/&gt;\\n &lt;menuitem label=&quot;SubMenuItem A-2&quot;/&gt;\\n &lt;/menuitem&gt;\\n &lt;menuitem label=&quot;MenuItem B&quot; type=&quot;check&quot; toggled=&quot;true&quot;/&gt;\\n &lt;menuitem label=&quot;MenuItem C&quot; type=&quot;check&quot; toggled=&quot;false&quot; icon=&quot;myTopIcon&quot;/&gt;\\n &lt;menuitem type=&quot;separator&quot;/&gt;\\n &lt;menuitem label=&quot;MenuItem D&quot; icon=&quot;myTopIcon&quot;&gt;\\n &lt;menuitem label=&quot;SubMenuItem D-1&quot; type=&quot;radio&quot; groupName=&quot;one&quot;/&gt;\\n &lt;menuitem label=&quot;SubMenuItem D-2&quot; type=&quot;radio&quot; groupName=&quot;one&quot; toggled=&quot;true&quot;/&gt;\\n &lt;menuitem label=&quot;SubMenuItem D-3&quot; type=&quot;radio&quot; groupName=&quot;one&quot;/&gt;\\n &lt;/menuitem&gt;\\n &lt;/root&gt;\\n &lt;/mx:XML&gt;</pre> <p>The following table lists the attributes you can specify, their data types, their purposes, and how the data provider must represent them if the menu uses the DefaultDataDescriptor class to parse the data provider:</p> <table class=&quot;innertable&quot;> <tr> <th>Attribute</th> <th>Type</th> <th>Description</th> </tr> <tr> <td><code>enabled</code></td> <td>Boolean</td> <td>Specifies whether the user can select the menu item (<code>true</code>), or not (<code>false</code>). If not specified, Flex treats the item as if the value were <code>true</code>. If you use the default data descriptor, data providers must use an <code>enabled</code> XML attribute or object field to specify this characteristic.</td> </tr> <tr> <td><code>groupName</code></td> <td>String</td> <td> (Required, and meaningful, for <code>radio</code> type only) The identifier that associates radio button items in a radio group. If you use the default data descriptor, data providers must use a <code>groupName</code> XML attribute or object field to specify this characteristic.</td> </tr> <tr> <td><code>icon</code></td> <td>Class</td> <td>Specifies the class identifier of an image asset. This item is not used for the <code>check</code>, <code>radio</code>, or <code>separator</code> types. You can use the <code>checkIcon</code> and <code>radioIcon</code> styles to specify the icons used for radio and check box items that are selected. The menu's <code>iconField</code> or <code>iconFunction</code> property determines the name of the field in the data that specifies the icon, or a function for determining the icons.</td> </tr> <tr> <td><code>label</code></td> <td>String</td> <td>Specifies the text that appears in the control. This item is used for all menu item types except <code>separator</code>. The menu's <code>labelField</code> or <code>labelFunction</code> property determines the name of the field in the data that specifies the label, or a function for determining the labels. (If the data provider is in E4X XML format, you must specify one of these properties to display a label.) If the data provider is an Array of Strings, Flex uses the String value as the label.</td> </tr> <tr> <td><code>toggled</code></td> <td>Boolean</td> <td>Specifies whether a check or radio item is selected. If not specified, Flex treats the item as if the value were <code>false</code> and the item is not selected. If you use the default data descriptor, data providers must use a toggled XML attribute or object field to specify this characteristic.</td> </tr> <tr> <td><code>type</code></td> <td>String</td> <td>Specifies the type of menu item. Meaningful values are <code>separator</code>, <code>check</code>, or <code>radio</code>. Flex treats all other values, or nodes with no type entry, as normal menu entries. If you use the default data descriptor, data providers must use a type XML attribute or object field to specify this characteristic.</td> </tr> </table>",
"tags": [
{ "tagName": "includeExample",
"values": ["examples/SimpleMenuExample.mxml"]},
{ "tagName": "see",
"values": ["mx.controls.MenuBar", "mx.controls.PopUpMenuButton", "mx.controls.menuClasses.IMenuDataDescriptor", "mx.controls.treeClasses.DefaultDataDescriptor", "mx.effects.Tween", "mx.managers.PopUpManager"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"members": [
{ "type": "method",
"qname": "createMenu",
"namespace": "public",
"bindable": [],
"details": ["static"],
"deprecated": {},
"description": "Creates and returns an instance of the Menu class. The Menu control's content is determined by the method's <code>mdp</code> argument. The Menu control is placed in the parent container specified by the method's <code>parent</code> argument. This method does not show the Menu control. Instead, this method just creates the Menu control and allows for modifications to be made to the Menu instance before the Menu is shown. To show the Menu, call the <code>Menu.show()</code> method. control in. The Menu control may not actually be parented by this object. root node of the data provider.",
"tags": [
{ "tagName": "see",
"values": ["mx.controls.Menu@dataProvider", "mx.controls.Menu@showRoot", "mx.controls.Menu#popUpMenu()"]},
{ "tagName": "param",
"values": ["parent A container that the PopUpManager uses to place the Menu", "mdp The data provider for the Menu control.", "showRoot A Boolean flag that specifies whether to display the"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "return",
"values": ["An instance of the Menu class."]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "mx.controls.Menu",
"params": [{ "name": "parent", "type": "mx.core.UIComponent"},
{ "name": "mdp", "type": "Object"},
{ "name": "showRoot", "type": "Boolean"}]}
,
{ "type": "method",
"qname": "popUpMenu",
"namespace": "public",
"bindable": [],
"details": ["static"],
"deprecated": {},
"description": "Sets the dataProvider of an existing Menu control and places the Menu control in the specified parent container. This method does not show the Menu control; you must use the <code>Menu.show()</code> method to display the Menu control. The <code>Menu.createMenu()</code> method uses this method. control in. The Menu control may not actually be parented by this object. If you omit this property, the method sets the Menu control's parent to the application. property, the method sets the Menu data provider to a new, empty XML object.",
"tags": [
{ "tagName": "param",
"values": ["menu Menu control to popup.", "parent A container that the PopUpManager uses to place the Menu", "mdp dataProvider object set on the popped up Menu. If you omit this"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "menu", "type": "mx.controls.Menu"},
{ "name": "parent", "type": "mx.core.UIComponent"},
{ "name": "mdp", "type": "Object"}]}
,
{ "type": "method",
"qname": "mx.controls.Menu",
"namespace": "",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Constructor. <p>Applications do not normally call the Menu constructor directly. Instead, Applications will call the <code>Menu.createMenu()</code> method.</p>",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "",
"params": []}
,
{ "type": "field",
"qname": "popupTween",
"return": "mx.effects.Tween",
"namespace": "mx_internal",
"bindable": [],
"details": [],
"deprecated": {}},
{ "type": "field",
"qname": "supposedToLoseFocus",
"return": "Boolean",
"namespace": "mx_internal",
"bindable": [],
"details": [],
"deprecated": {}},
{ "type": "accessor",
"access": "read-write",
"return": "mx.controls.Menu",
"qname": "parentMenu",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The parent menu in a hierarchical chain of menus, where the current menu is a submenu of the parent.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "return",
"values": ["The parent Menu control."]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Object",
"qname": "dataProvider",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "private",
"values": []} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "showRoot",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "A Boolean flag that specifies whether to display the data provider's root node. If the dataProvider object has a root node, and showRoot is set to <code>false</code>, the Menu control does not display the root node; only the descendants of the root node will be displayed. This flag has no effect on data providers without root nodes, like Lists and Arrays.",
"tags": [
{ "tagName": "default",
"values": ["true"]},
{ "tagName": "see",
"values": ["#hasRoot"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "Boolean",
"qname": "hasRoot",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "A flag that indicates that the current data provider has a root node; for example, a single top node in a hierarchical structure. XML and Object are examples of types that have a root node, while Lists and Arrays do not.",
"tags": [
{ "tagName": "default",
"values": ["false"]},
{ "tagName": "see",
"values": ["#showRoot"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "mx.core.IFlexDisplayObject",
"qname": "defaultButton",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "",
"tags": [
{ "tagName": "private",
"values": []} ]},
{ "type": "method",
"qname": "setMenuItemToggled",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Toggles the menu item. The menu item type identifier must be a check box or radio button, otherwise this method has no effect. toggled.",
"tags": [
{ "tagName": "param",
"values": ["item The menu item to toggle.", "toggle Boolean value that indicates whether the item is"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "item", "type": "Object"},
{ "name": "toggle", "type": "Boolean"}]}
,
{ "type": "method",
"qname": "show",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Shows the Menu control. If the Menu control is not visible, this method places the Menu in the upper-left corner of the parent application at the given coordinates, resizes the Menu control as needed, and makes the Menu control visible. The x and y arguments of the <code>show()</code> method specify the coordinates of the upper-left corner of the Menu control relative to the sandbox root, which is not necessarily the direct parent of the Menu control. For example, if the Menu control is in an HBox container which is nested within a Panel container, the x and y coordinates are relative to the Application container, not to the HBox container. corner (optional). corner (optional).",
"tags": [
{ "tagName": "param",
"values": ["x Horizontal location of the Menu control's upper-left", "y Vertical location of the Menu control's upper-left"]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "parent", "type": "org.apache.royale.core.IUIBase"},
{ "name": "xShow", "type": "Number"},
{ "name": "yShow", "type": "Number"}]}
,
{ "type": "method",
"qname": "hide",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Hides the Menu control and any of its submenus if the Menu control is visible.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": []}
,
{ "type": "method",
"qname": "deleteDependentSubMenus",
"namespace": "mx_internal",
"bindable": [],
"details": [],
"deprecated": {},
"return": "void",
"params": []}
,
{ "type": "method",
"qname": "hideAllMenus",
"namespace": "mx_internal",
"bindable": [],
"details": [],
"deprecated": {},
"return": "void",
"params": []}
,
{ "type": "method",
"qname": "getRootMenu",
"namespace": "mx_internal",
"bindable": [],
"details": [],
"deprecated": {},
"description": "From any menu, walks up the parent menu chain and finds the root menu.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "mx.controls.Menu",
"params": []}
,
{ "type": "accessor",
"access": "read-only",
"return": "Array",
"qname": "subMenus",
"namespace": "mx_internal",
"bindable": [],
"details": [],
"deprecated": {},
"description": "For autotesting, get the current set of submenus",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "method",
"qname": "itemToLabel",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Returns the string the renderer would display for the given data object based on the labelField and labelFunction properties. If the method cannot convert the parameter to a string, it returns a single space.",
"tags": [
{ "tagName": "param",
"values": ["data Object to be rendered."]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "return",
"values": ["The string to be displayed based on the data."]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "String",
"params": [{ "name": "data", "type": "Object"}]}
,
{ "type": "accessor",
"access": "read-write",
"return": "org.apache.royale.core.IFactory",
"qname": "itemRenderer",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The class or factory used to display each item.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "labelField",
"namespace": "public",
"bindable": ["labelFieldChanged"],
"details": [],
"deprecated": {},
"description": "The name of the field in the data provider items to display as the label. By default the list looks for a property named <code>label</code> on each item and displays it. However, if the data objects do not contain a <code>label</code> property, you can set the <code>labelField</code> property to use a different property in the data object. An example would be &quot;FullName&quot; when viewing a set of people names fetched from a database.",
"tags": [
{ "tagName": "default",
"values": [""label""]},
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "royaleignorecoercion",
"values": ["org.apache.royale.core.ISelectionModel"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Number",
"qname": "rowHeight",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The height of the rows in pixels. Unless the <code>variableRowHeight</code> property is <code>true</code>, all rows are the same height. If not specified, the row height is based on the font size and other properties of the renderer.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "org.apache.royale.core.IBead",
"qname": "presentationModel",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The DataGrid's presentation model",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.9"]},
{ "tagName": "royaleignorecoercion",
"values": ["org.apache.royale.core.IListPresentationModel", "org.apache.royale.core.IBead"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "method",
"qname": "addedToParent",
"namespace": "public",
"bindable": [],
"details": ["override"],
"deprecated": {},
"return": "void",
"params": []}
,
{ "type": "method",
"qname": "getLayoutHost",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Returns the ILayoutHost which is its view. From ILayoutParent.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.8"]},
{ "tagName": "royaleignorecoercion",
"values": ["org.apache.royale.core.ILayoutHost"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "org.apache.royale.core.ILayoutHost",
"params": []}
,
{ "type": "accessor",
"access": "read-write",
"return": "int",
"qname": "selectedIndex",
"namespace": "public",
"bindable": ["change","valueCommit"],
"details": [],
"deprecated": {},
"description": "The index in the data provider of the selected item. <p>The default value is -1 (no selected item).</p>",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "royaleignorecoercion",
"values": ["org.apache.royale.core.ISelectionModel"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "Object",
"qname": "selectedItem",
"namespace": "public",
"bindable": ["change","valueCommit"],
"details": [],
"deprecated": {},
"description": "The selected item in the data provider.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "org.apache.royale.events.IEventDispatcher",
"qname": "parentMenuBar",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {}},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "submenuField",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The name of the field to use in the data that indicates a sub-menu. The default value is &quot;menu&quot;.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.9"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]}]
,
"events": [
{ "qname": "change",
"type": "mx.events.MenuEvent"
,
"description": "Dispatched when selection changes as a result of user interaction.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["mx.events.MenuEvent.CHANGE"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "qname": "itemClick",
"type": "mx.events.MenuEvent"
,
"description": "Dispatched when a menu item is selected.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["mx.events.MenuEvent.ITEM_CLICK"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "qname": "menuHide",
"type": "mx.events.MenuEvent"
,
"description": "Dispatched when a menu or submenu is dismissed.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["mx.events.MenuEvent.MENU_HIDE"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "qname": "menuShow",
"type": "mx.events.MenuEvent"
,
"description": "Dispatched when a menu or submenu opens.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["mx.events.MenuEvent.MENU_SHOW"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "qname": "itemRollOut",
"type": "mx.events.MenuEvent"
,
"description": "Dispatched when a user rolls the mouse out of a menu item.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["mx.events.MenuEvent.ITEM_ROLL_OUT"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "qname": "itemRollOver",
"type": "mx.events.MenuEvent"
,
"description": "Dispatched when a user rolls the mouse over a menu item.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 9", "AIR 1.1"]},
{ "tagName": "eventType",
"values": ["mx.events.MenuEvent.ITEM_ROLL_OVER"]},
{ "tagName": "productversion",
"values": ["Flex 3"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]}]
}