<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"> <fx:Script>
<![CDATA[
private var buttonBarXML:XML = describeType(ButtonBar);
protected function labelFun(item:Object):String
{
//trace(buttonBarXML.factory.toString());
var cat:String = item.label.toUpperCase();
var len:uint = buttonBarXML.factory.child(item.data).length();
return item.label + " (" + len + ")"; }
]]>
</fx:Script> <fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
<s:ArrayList id="arr">
<fx:Array>
<fx:Object label="Accessors" data="accessor"/>
<fx:Object label="Methods" data="method"/>
<fx:Object label="ImplementsInterface" data="implementsInterface"/>
<fx:Object label="Variable" data="variable"/>
</fx:Array>
</s:ArrayList>
</fx:Declarations>
<s:ButtonBar id="buttonBar" dataProvider="{arr}" labelFunction="labelFun" />
</s:Application>

[Flex] ButtonBar系列——labelFunction用户提供的函数,在每个项目上运行以确定其标签的更多相关文章

  1. [Flex] ButtonBar系列——flex3 labelFunction用户提供的函数,在每个项目上运行以确定其标签

    <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="h ...

  2. [Flex] Accordion系列-动态添加或删除Accordion容器中项目

    <?xml version="1.0" encoding="utf-8"?> <!--Flex中如何使用addChild()和removeCh ...

  3. 【Android Studio安装部署系列】二十一、Android studio将项目上传到github中

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 概述 两个相关概念:git和github Git是一个开源的分布式版本控制系统,用以有效.高速的处理从很小到非常大的项目版本管理.Git ...

  4. [Flex] ButtonBar系列——垂直布局

    <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="ht ...

  5. [Flex] ButtonBar系列——皮肤和外观设置

    <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="ht ...

  6. [Flex] ButtonBar系列——简单布局

    <?xml version="1.0" encoding="utf-8"?> <!--通过layout属性,设置ButtonBar布局--&g ...

  7. [Flex] ButtonBar系列——最后一个项目的样式设置

    <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="ht ...

  8. [Flex] ButtonBar系列——控制ButtonBar菜单是否可用

    <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="ht ...

  9. [Flex] ButtonBar系列——arrowKeysWrapFocus属性如果为 true,则使用箭头键在组件内导航时,如果击中某一端则将折回。

    <?xml version="1.0" encoding="utf-8"?> <!--arrowKeysWrapFocus 如果为 true, ...

随机推荐

  1. 事件、委托、委托方法的总结(使用EventHandler<>)

    在C#中,定义事件.委托.委托方法可以使用类库内的EventHandler泛型委托来定义事件.并根据该泛型委托定义实现方法: 同样您也可以自定义委托 来定义事件以及 根据自定义的委托来定义实现事件的方 ...

  2. 4.Nexus按项目类型分配不同的工厂来发布不同的项目

    在[3.发布Maven项目到nexus中]配置了把项目发布到nexus中的方法但是有时候,一个公司会有很多项目[crm,oa,erp]等等的项目.如果把这些项目全部都放到releases或者snaps ...

  3. cacti 添加

    一,为已有host添加新的监控图 (基于snmp) 在console控制台下点击“New Graphs”,选择要添加监控图的主机.在Graph Templates中选择一个Graph模板,本例选择SN ...

  4. 关于IE10出现LinkButton点击无效的解决方案

    关于IE10出现LinkButton点击无效的情况: 一般高配置的系统如Win7旗舰版SP1系统不会出现这种情况,针对家庭普通版和专业版的用户通过测试都有这种情况,对于开发人员要解决不同系统和IE的兼 ...

  5. webpack 多entry 配置

    // webpack 多entry 配置var path = require('path'); module.exports = { entry: { entry2: './entry.js', de ...

  6. 火狐和ie下获取javascript 获取event

    javascript 获取event 先从一个简单的例子说起,一个简单的button控件如下: <input type='button' name='mybtn' id='mybtn' oncl ...

  7. linux系统下搭建php环境之-Discuz论坛

    1.安装搭建论坛必要的软件 apache php mysql CentOS系统我们可以直接使用 yum install 的方式进行软件安装,腾讯云有提供软件安装源,是同步CentOS官方的安装源,包涵 ...

  8. linux shell 整理收集(不断更新)

    1)主从复制延时判断 (转 http://www.cnblogs.com/gomysql/p/3862018.html) 说明: 不要通过Seconds_Behind_Master去判断,该值表示sl ...

  9. SqlHelper文件复习

    SqlHelper这是个cs类文件,将经常使用到的数据库操作写到一个文件下,方便调用,以及减少代码量.使用这个文件的前提是要建立一个app.config文件,并且引用configuration程序集: ...

  10. 236. Lowest Common Ancestor of a Binary Tree

    Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According ...