Show
Ignore:
Timestamp:
08/09/10 10:51:45 (22 months ago)
Author:
mszopinski
Message:

calendar, simple display

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ssme/trunk/flex/Common/src/com/kh/ssme/components/GridCanvas.as

    r4031 r4037  
    3131    [Style(name="outerBorderThickness", type="Number", format="Number")] 
    3232    [Style(name="outerBorderAlpha", type="Number", format="Number")] 
     33    [Style(name="verticalMargin", type="Number", format="Number")] 
     34    [Style(name="leftHorizontalMargin", type="Number", format="Number")] 
     35    [Style(name="rightHorizontalMargin", type="Number", format="Number")]     
    3336    public class GridCanvas extends StyledCanvas { 
    3437 
     
    4447                columns_ = value 
    4548                invalidateDisplayList(); 
    46             }             
     49            } 
    4750        } 
    4851 
     
    8588        public function get outerBorderAlpha_():Number{ 
    8689            return this.getStyle("outerBorderAlpha"); 
    87         }        
     90        } 
    8891        public function set innerBorderThicknesses_(value:Array):void{ 
    8992            this.setStyle("innerBorderThicknesses", value); 
     
    104107            return this.getStyle("innerBorderAlphas"); 
    105108        } 
    106         //---------------------------------------------         
     109 
     110        public function set verticalMargin_(value:Number):void{ 
     111            this.setStyle("verticalMargin", value); 
     112        } 
     113        public function get verticalMargin_():Number{ 
     114            return this.getStyle("verticalMargin"); 
     115        } 
     116        public function set leftHorizontalMargin_(value:Number):void{ 
     117            this.setStyle("leftHorizontalMargin", value); 
     118        } 
     119        public function get leftHorizontalMargin_():Number{ 
     120            return this.getStyle("leftHorizontalMargin"); 
     121        } 
     122        public function set rightHorizontalMargin_(value:Number):void{ 
     123            this.setStyle("rightHorizontalMargin", value); 
     124        } 
     125        public function get rightHorizontalMargin_():Number{ 
     126            return this.getStyle("rightHorizontalMargin"); 
     127        } 
     128        //--------------------------------------------- 
    107129 
    108130        /** 
     
    117139            [ArrayElementType("int")] 
    118140            var inBorderThicknesses:Array = getStyle_("innerBorderThicknesses", [ 0 ]); 
    119             [ArrayElementType("uint")]             
     141            [ArrayElementType("uint")] 
    120142            var inBorderColors:Array = getStyle_("innerBorderColors", [ 0x000000 ]); 
    121             [ArrayElementType("Number")]             
     143            [ArrayElementType("Number")] 
    122144            var inBorderAlphas:Array = getStyle_("innerBorderAlphas", [ 1.0 ]); 
    123             var cornerRadius:Number = getStyle_("cornerRadius", 0.0);  
     145            var cornerRadius:Number = getStyle_("cornerRadius", 0.0); 
     146            var verticalMargin:Number = getStyle_("verticalMargin",0); 
     147            var leftHorizontalMargin:Number = getStyle_("leftHorizontalMargin",0); 
     148            var rightHorizontalMargin:Number = getStyle_("rightHorizontalMargin",0);             
    124149 
    125150 
     
    133158                                   CapsStyle.NONE); 
    134159                graphics.beginFill(this.getStyle("backgroundColor"), this.getStyle("backgroundAlpha")); 
    135                 graphics.drawRoundRect(outBorderThickness, outBorderThickness, unscaledWidth-2*outBorderThickness, unscaledHeight-2*outBorderThickness, cornerRadius, cornerRadius); 
     160                graphics.drawRoundRect(outBorderThickness+leftHorizontalMargin, outBorderThickness+verticalMargin,  // x, y 
     161                        unscaledWidth-(2*outBorderThickness+leftHorizontalMargin+rightHorizontalMargin),            // width 
     162                        unscaledHeight-(2*outBorderThickness+2*verticalMargin),                                     // height 
     163                        cornerRadius, cornerRadius); 
    136164                graphics.endFill(); 
    137             }             
     165            } 
    138166 
    139167            //border 
     
    146174                                   LineScaleMode.NORMAL,    //scale 
    147175                                   CapsStyle.NONE); 
    148                 graphics.drawRoundRect(outBorderThickness*0.5, outBorderThickness*0.5, unscaledWidth-outBorderThickness, unscaledHeight-outBorderThickness, cornerRadius, cornerRadius);              
    149             }             
     176                graphics.drawRoundRect(leftHorizontalMargin+outBorderThickness*0.5, verticalMargin+outBorderThickness*0.5,  // x, y 
     177                        unscaledWidth-outBorderThickness-leftHorizontalMargin-rightHorizontalMargin,                        // width, 
     178                        unscaledHeight-outBorderThickness-2*verticalMargin,                                                 // height 
     179                        cornerRadius, cornerRadius); 
     180            } 
    150181 
    151182 
     
    163194 
    164195                    if(columns_.length>=i){ 
    165                         var xstep:Number = (unscaledWidth - 2*outBorderThickness - (columns_[i] - 1)*inBorderThickness) / columns_[i]; 
    166                         var x:Number = outBorderThickness 
     196                        var xstep:Number = (unscaledWidth - (2*outBorderThickness+leftHorizontalMargin+rightHorizontalMargin) - (columns_[i] - 1)*inBorderThickness) / columns_[i]; 
     197                        var x:Number = outBorderThickness+leftHorizontalMargin; 
    167198                        for ( var col:int = 1; col < columns_[i]; col++ ) 
    168199                        { 
    169200                            x += (xstep + inBorderThickness); 
    170                             graphics.moveTo(x - inBorderThickness*0.5, outBorderThickness);// + inBorderThickness*0.5); 
    171                             graphics.lineTo(x - inBorderThickness*0.5, unscaledHeight - outBorderThickness);// - inBorderThickness*0.5); 
     201                            graphics.moveTo(x - inBorderThickness*0.5, outBorderThickness + verticalMargin);// + inBorderThickness*0.5); 
     202                            graphics.lineTo(x - inBorderThickness*0.5, unscaledHeight - outBorderThickness - verticalMargin);// - inBorderThickness*0.5);                           
    172203                        } 
    173204                    } 
    174205                    if(rows_.length>=i){ 
    175                         var ystep:Number = (unscaledHeight - 2*outBorderThickness - (rows_[i] - 1)*inBorderThickness) / rows_[i];                         
    176                         var y:Number = outBorderThickness; 
     206                        var ystep:Number = (unscaledHeight - (2*outBorderThickness+2*verticalMargin) - (rows_[i] - 1)*inBorderThickness) / rows_[i]; 
     207                        var y:Number = outBorderThickness+verticalMargin; 
    177208                        for (var row:int = 1; row < rows_[i]; row++ ) 
    178209                        { 
    179210                            y += (ystep + inBorderThickness); 
    180                             graphics.moveTo(outBorderThickness,// + inBorderThickness*0.5, 
     211                            graphics.moveTo(outBorderThickness + leftHorizontalMargin,// + inBorderThickness*0.5, 
    181212                                    y - inBorderThickness*0.5); 
    182                             graphics.lineTo(unscaledWidth - outBorderThickness, // - inBorderThickness*0.5, 
     213                            graphics.lineTo(unscaledWidth - outBorderThickness - rightHorizontalMargin, // - inBorderThickness*0.5, 
    183214                                    y - inBorderThickness*0.5); 
    184215                        } 
     
    190221 
    191222 
    192  
    193223        } 
    194224