home *** CD-ROM | disk | FTP | other *** search
- class mx.skins.sample.RectBorder extends mx.skins.RectBorder
- {
- var offset;
- var __borderMetrics;
- var _color;
- static var symbolName = "RectBorder";
- static var symbolOwner = mx.skins.sample.RectBorder;
- static var version = "2.0.2.126";
- var colorList = {highlightColor:0,borderColor:0,buttonColor:0,shadowColor:0};
- static var classConstructed = mx.skins.sample.RectBorder.classConstruct();
- static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
- function RectBorder()
- {
- super();
- }
- function init(Void)
- {
- super.init();
- }
- function getBorderMetrics(Void)
- {
- if(this.offset == undefined)
- {
- var _loc3_ = this.getStyle(this.borderStyleName);
- this.offset = 0;
- if(_loc3_ == "solid")
- {
- this.offset = 1;
- }
- else if(_loc3_ == "inset" || _loc3_ == "outset")
- {
- this.offset = 2;
- }
- }
- if(this.getStyle(this.borderStyleName) == "menuBorder")
- {
- this.__borderMetrics = {left:1,top:1,right:2,bottom:1};
- return this.__borderMetrics;
- }
- return super.getBorderMetrics();
- }
- function drawBorder(Void)
- {
- var _loc4_ = _global.styles[this.className];
- if(_loc4_ == undefined)
- {
- _loc4_ = _global.styles.RectBorder;
- }
- var _loc3_ = this.getStyle(this.borderStyleName);
- var _loc5_ = this.getStyle(this.borderColorName);
- if(_loc5_ == undefined)
- {
- _loc5_ = _loc4_[this.borderColorName];
- }
- var _loc9_ = this.getStyle(this.backgroundColorName);
- if(_loc9_ == undefined)
- {
- _loc9_ = _loc4_[this.backgroundColorName];
- }
- if(_loc3_ != "none")
- {
- var _loc7_ = this.getStyle(this.shadowColorName);
- if(_loc7_ == undefined)
- {
- _loc7_ = _loc4_[this.shadowColorName];
- }
- var _loc6_ = this.getStyle(this.highlightColorName);
- if(_loc6_ == undefined)
- {
- _loc6_ = _loc4_[this.highlightColorName];
- }
- var _loc10_ = this.getStyle(this.buttonColorName);
- if(_loc10_ == undefined)
- {
- _loc10_ = _loc4_[this.buttonColorName];
- }
- }
- this.offset = 0;
- this.clear();
- this._color = undefined;
- if(_loc3_ != "none")
- {
- if(_loc3_ == "inset" || _loc3_ == "default" || _loc3_ == "alert" || _loc3_ == "falsedown")
- {
- this._color = this.colorList;
- this.offset = 2;
- this.draw3dBorder(_loc10_,_loc7_,_loc6_,_loc5_);
- }
- else if(_loc3_ == "outset" || _loc3_ == "falseup" || _loc3_ == "falseover")
- {
- this._color = this.colorList;
- this.offset = 2;
- this.draw3dBorder(_loc5_,_loc10_,_loc7_,_loc6_);
- }
- else if(_loc3_ == "truerollover" || _loc3_ == "truedown")
- {
- this._color = this.colorList;
- this.offset = 2;
- this.draw3dBorder(_loc10_,_loc7_,_loc6_,_loc5_);
- }
- else
- {
- var _loc11_ = this.width;
- _loc10_ = this.height;
- this.offset = 1;
- this.beginFill(_loc5_);
- this.drawRect(0,0,_loc11_,_loc10_);
- this.drawRect(1,1,_loc11_ - 1,_loc10_ - 1);
- this.endFill();
- this._color = this.borderColorName;
- }
- }
- var _loc8_ = this.offset;
- this.beginFill(_loc9_);
- this.drawRect(_loc8_,_loc8_,this.width - _loc8_,this.height - _loc8_);
- this.endFill();
- }
- function draw3dBorder(c1, c2, c3, c4)
- {
- var _loc3_ = this.width;
- var _loc2_ = this.height;
- this.beginFill(c1);
- this.drawRect(0,0,_loc3_,_loc2_);
- this.drawRect(0,0,_loc3_ - 1,_loc2_ - 1);
- this.endFill();
- this.beginFill(c2);
- this.drawRect(0,0,_loc3_,_loc2_ - 1);
- this.drawRect(1,1,_loc3_,_loc2_ - 1);
- this.endFill();
- this.beginFill(c3);
- this.drawRect(1,1,_loc3_ - 1,_loc2_ - 1);
- this.drawRect(1,1,_loc3_ - 2,_loc2_ - 2);
- this.endFill();
- this.beginFill(c4);
- this.drawRect(1,1,_loc3_ - 1,_loc2_ - 2);
- this.drawRect(2,2,_loc3_ - 1,_loc2_ - 2);
- this.endFill();
- }
- static function classConstruct()
- {
- mx.core.ext.UIObjectExtensions.Extensions();
- _global.styles.rectBorderClass = mx.skins.sample.RectBorder;
- _global.skinRegistry.RectBorder = true;
- return true;
- }
- }
-