1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| procedure TFormMenu.GridDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
........
{Tracer un rectangle dans la cellule}
Rect:=CellRect(ACol,ARow); // Enlever les marges pour remplir entierement la cellule
FillRect(Rect); // Remplir la zone rectangulaire avec le pinceau en cours
if (gdSelected in State) then
begin
DrawingStyle:=gdsGradient;
Brush.Style:=bsClear; // Rect est transparent
StartColor:=GetShadowColor(clHighlight, 45);
EndColor:=GetShadowColor(clHighlight, 10);
StyleServices.GetElementColor(StyleServices.GetElementDetails(tgCellSelected), ecGradientColor1, StartColor);
StyleServices.GetElementColor(StyleServices.GetElementDetails(tgCellSelected), ecGradientColor2, EndColor);
{DrawText affiche le texte}
DrawText(Handle,PChar(Cells[ACol,ARow]),-1,Rect,DT_VCENTER or DT_CENTER or DT_SINGLELINE); // Alignement vertical ou horizontal |
Partager