Flex Gumbo中如何通过selectAll函数检测用户是否用Ctrl+A/Command+A或菜单项选中FxTextArea的例子
By Minidxer | May 27, 2009
接下来的例子演示了Flex Gumbo中如何通过selectAll函数,检测用户是否用Ctrl+A/Command+A或菜单项选中FxTextArea。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码):
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <Application name="FxTextArea_selectAll_test"
- xmlns="http://ns.adobe.com/mxml/2009"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <Script>
- <![CDATA[
- import mx.controls.Alert;
- private function textArea_selectAll(evt:Event):void {
- Alert.show(evt.type);
- }
- ]]>
- </Script>
- <Label text="Right-click the FxTextArea control below and select 'Select All' from the context menu." />
- <FxTextArea id="textArea"
- width="100%"
- height="100%"
- selectAll="textArea_selectAll(event);">
- <content>
- <String source="data/lorem.html" />
- </content>
- </FxTextArea>
- </Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
FxTextArea, Gumbo |
No Comments » |
Tags: FxTextArea, Gumbo, selectAll