| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| |
| <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" width="400" height="300" > |
| <mx:Script> |
| <![CDATA[ |
| import mx.events.FlexNativeMenuEvent; |
| import Assets.CustomData; |
| import Assets.CustomChildData; |
| |
| [Bindable] |
| private var colorData:XMLList = |
| <> |
| <mymenu label="colors"> |
| <mymenuette label="warm"> |
| <mymenu label="two"> |
| <mymenuette label="orange" toggled="true" enabled="false"/> |
| <mymenuette label="red" toggled="false" enabled="true"/> |
| <mymenuette label="yellow"/> |
| </mymenu> |
| </mymenuette> |
| <mymenuette label="cold"> |
| <mymenu label="one"> |
| <mymenuette label="blue"/> |
| <mymenuette label="green" toggled="true" enabled="true"/> |
| <mymenuette label="purple"/> |
| </mymenu> |
| </mymenuette> |
| </mymenu> |
| </>; |
| [Bindable] |
| private var foodData:XMLList = |
| <> |
| <menuitem myLabel="Fruit" myEnabled="true"> |
| <menuitem myLabel="Strawberry" myToggled="true" myEnabled="false"/> |
| <menuitem myLabel="Banana" myType="fruit"/> |
| <menuitem myType="separator"/> |
| <menuitem myLabel="Citrus"/> |
| <menuitem myLabel="Orange"> |
| <menuitem myLabel="Blood" myToggled="false"/> |
| <menuitem myLabel="Navel" myToggled="true"/> |
| <menuitem myLabel="Valencia" myToggled="false"/> |
| </menuitem> |
| <menuitem myLabel="Grapefruit"> |
| <menuitem myLabel="Ruby Red" myType="check" myToggled="true"/> |
| </menuitem> |
| <menuitem myLabel="Peach" changeMe="one"/> |
| </menuitem> |
| <menuitem myLabel="Meat"> |
| <menuitem myLabel="Chicken"/> |
| <menuitem myLabel="Beef"/> |
| <menuitem myLabel="Lamb"/> |
| <menuitem myLabel="Pork"/> |
| </menuitem> |
| </>; |
| |
| [Bindable] |
| public var dbData:XMLList = |
| <> |
| <menuitem label="ありがと"/> |
| <menuitem label="二はお馬"/> |
| </>; |
| |
| [Bindable] |
| public var childData:CustomChildData = new CustomChildData(); |
| |
| [Bindable] |
| public var cdd:CustomData = new CustomData(); |
| ]]> |
| </mx:Script> |
| <mx:menu> |
| <mx:FlexNativeMenu id="fnm_1" dataProvider="{colorData}" labelField="@label" dataDescriptor="{childData}"/> |
| </mx:menu> |
| <mx:flexContextMenu> |
| <mx:FlexNativeMenu id="fnm_2" dataProvider="{foodData}" labelField="@myLabel" dataDescriptor="{cdd}"/> |
| </mx:flexContextMenu> |
| |
| <mx:FlexNativeMenu id="dbMenu" dataProvider="{dbData}" labelField="@label"/> |
| |
| <mx:VBox id="doubleByteBox" borderStyle="solid" flexContextMenu="{dbMenu}"> |
| <mx:Label text="My double byte menu"/> |
| </mx:VBox> |
| |
| </mx:WindowedApplication> |