blob: c22f782021b3d15ae24c6e30235e881a65335b03 [file] [log] [blame]
<?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="Home">
<fx:Script>
<![CDATA[
// The event listener for the click event for
// the ViewMenuItem controls.
private function itemClickInfo(event:MouseEvent):void {
switch (event.currentTarget.label) {
case "Add" :
myTA.text = "Add selected";
break;
case "Cancel" :
myTA.text = "Cancel selected";
break;
case "Delete" :
myTA.text = "Delete selected";
break;
case "Edit" :
myTA.text = "Edit selected";
break;
case "Search" :
myTA.text = "Search selected";
break;
default :
myTA.text = "Error";
}
}
]]>
</fx:Script>
<!-- Define the ViewMenuItem controls. -->
<s:viewMenuItems>
<s:ViewMenuItem label="Add" click="itemClickInfo(event);"/>
<s:ViewMenuItem label="Cancel" click="itemClickInfo(event);"/>
<s:ViewMenuItem label="Delete" click="itemClickInfo(event);"/>
<s:ViewMenuItem label="Edit" click="itemClickInfo(event);"/>
<s:ViewMenuItem label="Search" click="itemClickInfo(event);"/>
</s:viewMenuItems>
<s:VGroup paddingTop="10" paddingLeft="10">
<s:TextArea id="myTA" text="Select a menu item"/>
<s:Button label="Open Menu"
click="mx.core.FlexGlobals.topLevelApplication.viewMenuOpen=true;"/>
<s:Button label="Close Menu"
click="mx.core.FlexGlobals.topLevelApplication.viewMenuOpen=false;"/>
</s:VGroup>
</s:View>