1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| package fr.proxiflex.flex.controls
{
import flash.display.Graphics;
import flash.display.Shape;
import flash.display.Sprite;
import mx.controls.AdvancedDataGrid;
import mx.controls.advancedDataGridClasses.AdvancedDataGridColumn;
import mx.controls.advancedDataGridClasses.AdvancedDataGridHeaderInfo;
import mx.core.FlexShape;
import mx.core.mx_internal;
use namespace mx_internal ;
public class PXADG extends AdvancedDataGrid
{
override protected function drawColumnBackground(s:Sprite, columnIndex:int,
color:uint, column:AdvancedDataGridColumn):void
{
var background:Shape;
background = Shape(s.getChildByName(columnIndex.toString()));
if (!background)
{
background = new FlexShape();
s.addChild(background);
background.name = columnIndex.toString();
}
var g:Graphics = background.graphics;
g.clear();
if(columnIndex >= lockedColumnCount &&
columnIndex < lockedColumnCount + horizontalScrollPosition)
return;
// PX: ajout transparence (octet de poids fort de backgroundColor)
//g.beginFill(color);
g.beginFill( color & 0xffffff, ( color >> 24 ) / 100 ) ;
var lastRow:Object = rowInfo
[listItems.length - 1];
var headerInfo:AdvancedDataGridHeaderInfo = getHeaderInfo(getOptimumColumns()[columnIndex]);
var xx:Number = headerInfo.headerItem.x;
if(columnIndex >= lockedColumnCount)
xx = getAdjustedXPos(xx);
var yy:Number = headerRowInfo[0].y;
if (headerVisible)
yy += headerRowInfo[0].height;
// BUG: lastRow est null quand on réduit l'application (dans AIR au moins)
var height : Number = listContent.height - yy ;
if ( lastRow != null )
{
// Height is usually as tall is the items in the row, but not if
// it would extend below the bottom of listContent
height = Math.min(lastRow.y + lastRow.height, height);
}
g.drawRect(xx, yy, headerInfo.headerItem.width,
listContent.height - yy);
g.endFill();
}
}
} |
Partager