| <?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. |
| |
| --> |
| <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| title="ViewMenuItem" initialize="view1_initializeHandler(event)" > |
| <fx:Script> |
| <![CDATA[ |
| import mx.collections.ArrayList; |
| import mx.core.FlexGlobals; |
| import mx.events.FlexEvent; |
| public var ac:ArrayList= new ArrayList(); |
| protected function view1_initializeHandler(event:FlexEvent):void |
| { |
| // TODO Auto-generated method stub |
| addEventListener("viewMenuOpen", listenerOpen); |
| addEventListener("viewMenuClose", listenerClose); |
| dp(); |
| } |
| protected function listenerOpen(evt:Event):void |
| { |
| trace("viewMenuOpen"); |
| } |
| protected function listenerClose(evt:Event):void |
| { |
| trace("viewMenuClose"); |
| } |
| |
| private function dp():void |
| { |
| for(var i:int=10; i<100; i++) |
| ac.addItem("This is long string to test horizontal scrolling" + i); |
| list.dataProvider=ac; |
| } |
| |
| ]]> |
| </fx:Script> |
| <s:states> |
| <s:State name="portrait"/> |
| <s:State name="landscape"/> |
| </s:states> |
| <s:viewMenuItems > |
| <s:ViewMenuItem id="i1" label.landscape="Landscape" label.portrait="portrait" icon="@Embed('../menuIcons/addIcon.png')" iconPlacement="left" click="btn.label='click1'" alpha="1"/> |
| <s:ViewMenuItem id="i2" label="cancel" icon="@Embed('../menuIcons/cancelIcon.png')" iconPlacement="bottom" click="btn.label='click2'" alpha="1"/> |
| <s:ViewMenuItem id="i3" label="edit" icon="@Embed('../menuIcons/editIcon.png')" iconPlacement="right" click="btn.label='click3'" alpha="1"/> |
| <s:ViewMenuItem id="i4" label="delete" icon="@Embed('../menuIcons/deleteIcon.png')" iconPlacement="bottom" click="btn.label='click4'" alpha="1"/> |
| <s:ViewMenuItem id="i5" label="tag" icon="@Embed('../menuIcons/tagIcon.png')" iconPlacement="left" click="btn.label='click5'" alpha="1"/> |
| <s:ViewMenuItem id="i6" label="filter" icon="@Embed('../menuIcons/filterIcon.png')" iconPlacement="right" click="btn.label='click6'" alpha="1"/> |
| <s:ViewMenuItem id="i7" label="help" icon="@Embed('../menuIcons/helpIcon.png')" iconPlacement="bottom" click="btn.label='click7'" alpha="1"/> |
| </s:viewMenuItems> |
| <s:VGroup height="100%" width="100%"> |
| <s:Button id="btn" label="btn" width="100" height="70"/> |
| <s:List id="list" height="500" /> |
| </s:VGroup> |
| |
| </s:View> |