unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 =
class(TForm)
StringGrid1: TStringGrid;
procedure StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.nfm}
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
procedure TfrmRegis.sgRegisDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
procedure WriteText(StringGrid: TStringGrid; ACanvas: TCanvas;
const ARect: TRect;
const Text:
string);
const
DY = 2;
var
S:
array[0..255]
of Char;
begin
with Stringgrid, ACanvas, ARect
do begin
ExtTextOut(
Handle, Right - TextWidth(Text) - 3, Top + DY,
ETO_OPAQUE
or ETO_CLIPPED, @ARect, StrPCopy(S, Text),
Length(Text),
nil);
end;
end;
procedure Display(StringGrid: TStringGrid;
const S:
string);
begin
WriteText(StringGrid, StringGrid.Canvas, Rect, S);
end;
begin
inherited;
if (ACol
in [1,4,6,7])
then
Display(sgRegis, sgRegis.Cells[ACol, ARow]);
end;
end.