blob: 4048b37e35211d23c356c9a9fe8a5334fa4a971a [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:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
protected function changeHandler():void
{
txt.maxChars = this.maxChars.value;
txt.restrict = this.restrictStr.text;
txt.textFlow.textAlign = alignVal.selectedItem;
txt.textFlow.direction = direction.selectedItem;
}
]]>
</fx:Script>
<s:Panel title="TextArea Sample" width="100%" height="100%">
<s:layout>
<s:HorizontalLayout paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10"/>
</s:layout>
<s:VGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="Specify Max Character Input:"/>
<s:NumericStepper id="maxChars" maximum="200" value="100" stepSize="2" change="this.changeHandler()"/>
</s:HGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="Specify Text Alignment:"/>
<s:DropDownList id="alignVal" prompt="left" change="this.changeHandler()">
<s:dataProvider>
<mx:ArrayList>
<fx:String>left</fx:String>
<fx:String>right</fx:String>
<fx:String>center</fx:String>
<fx:String>justify</fx:String>
<fx:String>start</fx:String>
<fx:String>end</fx:String>
</mx:ArrayList>
</s:dataProvider>
</s:DropDownList>
</s:HGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="Direction:"/>
<s:DropDownList id="direction" prompt="ltr" change="this.changeHandler()">
<s:dataProvider>
<mx:ArrayList>
<fx:String>ltr</fx:String>
<fx:String>rtl</fx:String>
</mx:ArrayList>
</s:dataProvider>
</s:DropDownList>
</s:HGroup>
<s:HGroup verticalAlign="middle">
<s:Label text="Specify characters to restrict (use - for range):"/>
<s:TextInput id="restrictStr" change="this.changeHandler()" text="a-z 1-9"/>
</s:HGroup>
<s:VGroup>
<s:Label text="Text:"/>
<s:TextArea id="txt" width="300" height="70" color="0x323232" horizontalCenter="0" verticalCenter="0" restrict="a-z 1-9"
change="this.changeHandler()"/>
</s:VGroup>
</s:VGroup>
<s:Label width="200" top="20" right="80"
text="TextArea is a text-entry control that lets users enter and edit multiple lines of richly formatted text.
It can display horizontal and vertical scrollbars for scrolling through the text and supports vertical scrolling with the mouse wheel. This sample also shows
how you can restrict character input on the text area. The default when this is run will not allow the number 0 or caps based on the restrict range shown. The
sample also shows how you can specify a direction on the text."/>
</s:Panel>
</s:Module>