Skinning Flex containers using WSDoubleBorderSkin

Skinning Flex containers using WSDoubleBorderSkin

July 4th, 2007

WSDoubleBorderSkin is a programmatic skin extending mx.skins.Border for adding double borders on Flex containers such as Canvas, HBox, VBox, Form etc. It supports properties for different border positions such as borderTop or borderBottom, colors and thicknesses using CSS. It’s designed for using Flex states based on mx.states.Transition. The WSDoubleBorderSkin is tested under Flex 2 and 3 (Moxie).

Screen shot

Instructions

Code snippets for using WSDoubleBorderSkin

  1. //
  2. //  [1] Define style properties:
  3. <mx:Style>
  4.     . wsDoubleBorder
  5.     {
  6.         borderSkin: ClassReference ( "skins.WSDoubleBorderSkin" );
  7.         borderTopThickness: 3;
  8.         borderTopColor: #3ad2ed;
  9.         borderRightThickness: 3;
  10.         borderRightColor: #3399CC;
  11.         borderBottomThickness: 3;
  12.         borderBottomColor: #FF6600;
  13.         borderLeftThickness: 3;
  14.         borderLeftColor: #99CC00;         
  15.         backgroundColor: #FFFFFF;
  16.         backgroundAlpha: 90;
  17.         /*  Optionally: using one border only
  18.         doubleBorder: false;
  19.         */
  20.     }
  21. </mx:Style>
  22. //
  23. //  [2] Point these styles to a container, e.g. Canvas:
  24. <mx:Canvas id= "standardCanvas"
  25.     styleName= "wsDoubleBorder" />   
  26. //
  27. //  [2 b] Optionally: Using common properties "borderThickness"
  28. //  and "borderColor" for using one color or one thickness
  29. //  without any style definitions within <mx:Style>:
  30. <mx:Canvas id= "standardCanvas"
  31.     width= "300" height= "200"
  32.     borderSkin= "skins.WSDoubleBorderSkin"
  33.     borderThickness= "3" borderColor= "#99CC00" backgroundColor: "#FFFFFF" />
  34. // 
  35. //  That’s all ;)
  36.  
  37.  

Example (incl. source code)

Here you’ll find an example including the source code. WSDoubleBorderSkin is open source licensed under the Mozilla Public License 1.1.

Have fun! ;-)

Related Articles

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值