首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > PowerDesigner >

在覆盖updateDisplayList步骤中使用 图标的经典写法

2012-07-05 
在覆盖updateDisplayList方法中使用 图标的经典写法?package com.ztesoft.zsmart.corelib.skins{import fl

在覆盖updateDisplayList方法中使用 图标的经典写法

?

package com.ztesoft.zsmart.corelib.skins{import flash.display.Graphics;import mx.core.mx_internal;import mx.skins.ProgrammaticSkin;/** * The skin for all the states of the icon in a PopUpButton *  */public class PopUpIconSkin extends ProgrammaticSkin{    //--------------------------------------    //    //  Constructor    //    //--------------------------------------    /**     *  Constructor      */    public function PopUpIconSkin()    {        super();                 }        //--------------------------------------    //    //  Variables    //    //--------------------------------------    /**     *  @private     */    mx_internal var arrowColor:uint = 0x111111;        //--------------------------------------    //    //  Overridden properties    //    //--------------------------------------    //----------------------------------//  measuredWidth    //----------------------------------        /**     *  @private     */        override public function get measuredWidth():Number    {        return 7;    }        //----------------------------------//  measuredHeight    //----------------------------------        /**     *  @private     */            override public function get measuredHeight():Number    {        return 5;    }        //--------------------------------------    //    //  Overridden methods    //    //--------------------------------------    /**     *  @private     */    override protected function updateDisplayList(w:Number, h:Number):void    {super.updateDisplayList(w, h);        var g:Graphics = graphics;        g.clear();        g.beginFill(mx_internal::arrowColor);        g.moveTo(w / 2, height);        g.lineTo(0, 0);        g.lineTo(w, 0);        g.lineTo(w / 2, h);        g.endFill();    }}}
?

?

热点排行