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
| procedure TInclineTest.GridDraftReadDrawCell(Sender: TObject; ACol,ARow: Integer; Rect: TRect; State: TGridDrawState);
var i:integer;
DesParametres:TParametresOnDrawCell;
Zone:TZoneFusionnee;
begin
//On récupère les Paramêtres de OnDrawCell
DesParametres.ACol:=ACol;
DesParametres.ARow:=ARow;
DesParametres.Rect:=Rect;
DesParametres.State:=State;
//Quel est le StringGrid qui déclenche l'évènement ?
DesParametres.LeStringGrid:=(sender as TStringGrid);
i:=1;
if not(ARow in [6..8]) then
begin
while i<(GridDraftRead.ColCount - 1) do
begin
//création de la zone fusionnée Zone:=SetZoneFusionnee(GridDraftRead,GridDraftRead.Cells[ACol,ARow],i,ARow,i+1,ARow,alHCenter,alVCenter,JustCenter);
if not DessineZone(DesParametres,Zone)then
begin
if (ARow=0)and (ACol in [1..(GridDraftRead.ColCount-1)]) then
begin
GridDraftRead.Canvas.Brush.Color:=clYellow;
end;
DessineCellule(DesParametres,alHCenter,alVCenter,JustCenter);
end;
i:=i+2;
end;
end;
end; |
Partager