<?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. openjudge-回文串判断【递归】

    回文串判断 总时间限制: 1000ms 内存限制: 65536kB 描述 任意给定一个非空的字符串,判断其是否是回文串.回文串是指正向看和反向看均相等的串,如AbcDcbA和cDDc.如果是回文串,则 ...

  2. 通过命令行安装Android app

    手动安装安卓app的命令为:adb install -r C:\Users\Lihao\workspace\Appium_Demo\apps\app_F_1.3.0.apk

  3. SVN的分支、主干合并的使用说明

    EBAPP代码SVN服务器地址:http://scm.jrj.cn/webapp/ 使用右键菜单中SVN的二级菜单Repo-Broswer查看SVN服务器目录结构 目录结构如下: 名称及功能说明: T ...

  4. apache2: Could not reliably determine the server's fully qualified domain name

    错误信息:apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 ...

  5. ABP系列文章总目录:

    转自:http://www.cnblogs.com/mienreal/p/4528470.html 1.ABP总体介绍 2.ASP.NET Boilerplate入门 3.ABP分层架构 4.ABP模 ...

  6. 给Jquery动态添加的元素添加事件2

    $('div').on('click', 'button', function(e){console.log($(e.target).is(':button'))}); $('<button&g ...

  7. HTML5判断设备在线离线及监听网络状态变化例子

    经测试android ipad默认的浏览器支持,用appcan封装的网页也支持 本文原创,转载请说明出处 <!doctype html> <html> <head> ...

  8. bzoj3917: [Baltic2014]sequence

    Description  序列A由从N开始的连续K个数按顺序构成,现在将A中的每个数只保留某一个数码,记为序列B,给定K和B,求可能的最小的N Input 第一行一个数K,第二行K个数B_i Outp ...

  9. bzoj2289: 【POJ Challenge】圆,圆,圆

    Description 1tthinking随便地画了一些圆. ftiasch认为这些圆有交集(面积非零)的可能性不大.因为他实在画了太多圆,所以你被请来判断是否存在交集. Input 第1行,一个整 ...

  10. System.ArgumentOutOfRangeException: 年、月和日参数描述无法表示的 DateTime。

    c#日期控件 格式设为 yyyy-MM,通过updown 方式调整日期. 当为月度最后一天,且要调整月没有当前月的最后一天时,就会报标题错误. 如:当前为1月31日,要调整为2月时,就会报错.因为2月 ...