Flex中如何利用backgroundDisabledColor和disabledOverlayAlpha样式,在一个容器的enabled属性为false时添加一个覆盖层
2012-10-12 16:38
691 查看
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white"
creationComplete="init();">
<mx:Script>
<![CDATA[
private function init():void {
var col:uint = panel.getStyle("backgroundColor");
colorPicker.selectedColor = col;
}
]]>
</mx:Script>
<mx:ApplicationControlBar dock="true">
<mx:CheckBox id="checkBox"
label="enabled"
selected="true" />
<mx:Spacer width="50%" />
<mx:Label text="backgroundDisabledColor:" />
<mx:ColorPicker id="colorPicker" />
<mx:Spacer width="50%" />
<mx:Label text="disabledOverlayAlpha:" />
<mx:HSlider id="slider"
minimum="0"
maximum="1"
value="0.6"
liveDragging="true"
tickInterval="0.1"
showTrackHighlight="true" />
</mx:ApplicationControlBar>
<mx:Panel id="panel"
title="Panel title"
status="Panel status"
enabled="{checkBox.selected}"
backgroundColor="red"
backgroundDisabledColor="{colorPicker.selectedColor}"
disabledOverlayAlpha="{slider.value}">
<mx:Form>
<mx:FormHeading label="LOGIN" />
<mx:FormItem label="Username:">
<mx:TextInput id="userame" />
</mx:FormItem>
<mx:FormItem label="Password:">
<mx:TextInput id="password"
displayAsPassword="true" />
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Login" />
</mx:FormItem>
</mx:Form>
</mx:Panel>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white"
creationComplete="init();">
<mx:Script>
<![CDATA[
private function init():void {
var col:uint = panel.getStyle("backgroundColor");
colorPicker.selectedColor = col;
}
]]>
</mx:Script>
<mx:ApplicationControlBar dock="true">
<mx:CheckBox id="checkBox"
label="enabled"
selected="true" />
<mx:Spacer width="50%" />
<mx:Label text="backgroundDisabledColor:" />
<mx:ColorPicker id="colorPicker" />
<mx:Spacer width="50%" />
<mx:Label text="disabledOverlayAlpha:" />
<mx:HSlider id="slider"
minimum="0"
maximum="1"
value="0.6"
liveDragging="true"
tickInterval="0.1"
showTrackHighlight="true" />
</mx:ApplicationControlBar>
<mx:Panel id="panel"
title="Panel title"
status="Panel status"
enabled="{checkBox.selected}"
backgroundColor="red"
backgroundDisabledColor="{colorPicker.selectedColor}"
disabledOverlayAlpha="{slider.value}">
<mx:Form>
<mx:FormHeading label="LOGIN" />
<mx:FormItem label="Username:">
<mx:TextInput id="userame" />
</mx:FormItem>
<mx:FormItem label="Password:">
<mx:TextInput id="password"
displayAsPassword="true" />
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Login" />
</mx:FormItem>
</mx:Form>
</mx:Panel>
</mx:Application>
相关文章推荐
- Flex中如何利用titleIcon属性给Panel容器标题部添加一个ICON图标的例子
- Flex中如何用backgroundDisabledColor样式,自定义TextInput控件在无效状态下填充颜色
- Flex中如何利用status属性,在Alert消息框上添加一个状态信息
- Flex利用titleIcon属性给Panel容器标题部添加一个ICON图标
- Flex中如何利用closeButtonSkin或closeButtonUpSkin, closeButtonOverSkin, closeButtonDownSkin, closeButtonDisabledSkin样式,改变TitleWindow容器的
- 关于如何利用原生js动态给一个空对象添加属性以及属性值
- Flex Gumbo中如何通过contentBackgroundColor样式,设置TextInput内文本背景颜色
- Flex中如何通过strokeWidth, strokeColor和shadowColor样式,创建一个自定义风格的HRule或VRule
- Flex中如何利用seriesFilters属性,添加/删除LineChart图表曲线阴影
- Flex中如何通过dropShadowColor, shadowDirection和shadowDistance样式,创建一个有阴影效果的TextArea控件
- Flex中如何利用getTabAt函数遍历TabNavigator容器的各个Tab,并且通过labelPlacement属性设置标签位置
- Flex中如何利用AccordionHeader的paddingLeft样式,指定Accordion容器头部文本位置
- Flex中如何利用getTabAt函数遍历TabNavigator容器的各个Tab,并且通过labelPlacement属性设置标签位置
- Flex中如何利用backgroundImage和backgroundAttachment样式,设置VBox背景图片
- Flex中如何通过selectionColor和selectionDisabledColor样式设置DataGrid的行选中与无效时颜色的例子
- Flex中如何利用seriesFilters属性,添加/删除LineChart图表曲线阴影
- 如何利用运行时给系统分类添加一个属性?
- Flex中如何利用seriesFilters属性,添加/删除LineChart图表曲线阴影
- Flex中如何通过disabledColor样式设置NumericStepper控件无效时文本颜色的例子
- Flex中如何通过backgroundImage和backgroundSize样式,设置VBox容器的背景图片以及大小