Show
Ignore:
Timestamp:
08/11/10 12:55:02 (22 months ago)
Author:
mszopinski
Message:

calendar, one-day display

Files:
1 modified

Legend:

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

    r4037 r4040  
    3939         * Number of columns 
    4040         */ 
    41         private var columns_:Array; 
     41        private var columns_:Array;   
    4242        public function get columns():Array{ 
    4343            return columns_; 
     
    4949            } 
    5050        } 
     51        public var columnsPosition:Array;               
     52 
    5153 
    5254        /** 
     
    6365            } 
    6466        } 
     67        public var rowsPosition:Array;           
    6568 
    6669 
     
    183186 
    184187            // inner border 
    185             var inBorderThickness:int; 
     188            var inBorderThickness:int, xTempPos:int, yTempPos:int; 
     189            columnsPosition = []; 
     190            rowsPosition = []; 
    186191            for (var i:int = 0; i<inBorderThicknesses.length; i++){ 
    187                 if (inBorderThicknesses[i] > 0) 
    188                 { 
     192                // for each border level 
     193                if (inBorderThicknesses[i] > 0){ 
    189194                    inBorderThickness = inBorderThicknesses[i]; 
    190195                    graphics.lineStyle(inBorderThickness,inBorderColors[i],inBorderAlphas[i], 
     
    193198                                       CapsStyle.NONE); 
    194199 
     200                    var tempColumnsPos:Array = [], tempRowsPos:Array = [];                       
    195201                    if(columns_.length>=i){ 
    196202                        var xstep:Number = (unscaledWidth - (2*outBorderThickness+leftHorizontalMargin+rightHorizontalMargin)  - (columns_[i] - 1)*inBorderThickness) / columns_[i]; 
     203                        // left border position 
    197204                        var x:Number = outBorderThickness+leftHorizontalMargin; 
    198                         for ( var col:int = 1; col < columns_[i]; col++ ) 
    199                         { 
     205                        xTempPos = x - inBorderThickness*0.5; 
     206                        tempColumnsPos.push( xTempPos ); 
     207                        // draw column lines 
     208                        for ( var col:int = 1; col < columns_[i]; col++ ){ 
    200209                            x += (xstep + inBorderThickness); 
    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);                           
     210                            xTempPos = x - inBorderThickness*0.5; 
     211                            graphics.moveTo(xTempPos, outBorderThickness + verticalMargin); 
     212                            graphics.lineTo(xTempPos, unscaledHeight - outBorderThickness - verticalMargin); 
     213                            tempColumnsPos.push( xTempPos ); 
    203214                        } 
     215                        // right border position 
     216                        x += (xstep + inBorderThickness); 
     217                        xTempPos = x - inBorderThickness*0.5; 
     218                        tempColumnsPos.push( xTempPos ); 
    204219                    } 
    205220                    if(rows_.length>=i){ 
    206221                        var ystep:Number = (unscaledHeight - (2*outBorderThickness+2*verticalMargin) - (rows_[i] - 1)*inBorderThickness) / rows_[i]; 
     222                        // top border position                         
    207223                        var y:Number = outBorderThickness+verticalMargin; 
    208                         for (var row:int = 1; row < rows_[i]; row++ ) 
    209                         { 
     224                        yTempPos = y - inBorderThickness*0.5; 
     225                        tempRowsPos.push( yTempPos ); 
     226                        // draw rows lines 
     227                        for (var row:int = 1; row < rows_[i]; row++ ){ 
    210228                            y += (ystep + inBorderThickness); 
    211                             graphics.moveTo(outBorderThickness + leftHorizontalMargin,// + inBorderThickness*0.5, 
    212                                     y - inBorderThickness*0.5); 
    213                             graphics.lineTo(unscaledWidth - outBorderThickness - rightHorizontalMargin, // - inBorderThickness*0.5, 
    214                                     y - inBorderThickness*0.5); 
     229                            yTempPos = y - inBorderThickness*0.5; 
     230                            graphics.moveTo(outBorderThickness + leftHorizontalMargin, yTempPos); 
     231                            graphics.lineTo(unscaledWidth - outBorderThickness - rightHorizontalMargin, yTempPos); 
     232                            tempRowsPos.push( yTempPos );                             
    215233                        } 
     234                        // bottom border position 
     235                        y += (ystep + inBorderThickness); 
     236                        yTempPos = y - inBorderThickness*0.5; 
     237                        tempRowsPos.push( yTempPos ); 
    216238                    } 
    217  
     239                    columnsPosition.push( tempColumnsPos ); 
     240                    rowsPosition.push( tempRowsPos );                     
    218241                } 
    219242            } 
    220243 
    221  
    222  
    223244        } 
    224245