1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
uses ... Windows,Math, grids, DBgrids ....
// Permet de dessiner une case a cocher dans une cellule
// (a lier) a l'évènement OndrawCell de la grille
procedure GrillePDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; wG: TGrille);
var
r : Trect;
begin
if (Arow>0) AND (aCol>0) then
begin
r.Top:=Rect.Top+4;
r.Bottom:=Rect.Bottom-4;
r.Left:=Rect.Left+4;
r.Right:=Rect.Right-4;
DrawFrameControl((Sender as TStringGrid).Canvas.Handle,r,DFC_BUTTON,
IfThen(wG[acol,2]=1, // <<<<<< ici la condition >>>>>>
DFCS_CHECKED,DFCS_BUTTONCHECK));
end;
end; |
Partager