You've already forked lazarus-ccr
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8841 8e941d3f-bd1b-0410-a28a-d453659cc2b4
63 lines
1.2 KiB
ObjectPascal
63 lines
1.2 KiB
ObjectPascal
unit Main;
|
|
|
|
{$IFDEF FPC}
|
|
{$MODE Delphi}
|
|
{$ENDIF}
|
|
|
|
interface
|
|
|
|
uses
|
|
SysUtils, Variants, Classes, Types, Graphics, Controls, Forms,
|
|
Dialogs, ExtCtrls, NiceGrid;
|
|
|
|
type
|
|
TMainForm = class(TForm)
|
|
NiceGrid1: TNiceGrid;
|
|
procedure FormCreate(Sender: TObject);
|
|
procedure NiceGrid1DrawCell(Sender: TObject; ACanvas: TCanvas;
|
|
X, Y: Integer; Rc: TRect; var Handled: Boolean);
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
MainForm: TMainForm;
|
|
|
|
implementation
|
|
|
|
{$IFDEF FPC}
|
|
{$R *.lfm}
|
|
{$ELSE}
|
|
{$R *.dfm}
|
|
{$ENDIF}
|
|
|
|
procedure TMainForm.FormCreate(Sender: TObject);
|
|
var
|
|
x: Integer;
|
|
begin
|
|
for x := 0 to 19 do
|
|
begin
|
|
NiceGrid1.Cells[0, x] := IntToStr(Random(100));
|
|
NiceGrid1.Cells[1, x] := IntToStr(Random(100));
|
|
NiceGrid1.Cells[2, x] := IntToStr(Random(100));
|
|
NiceGrid1.Cells[3, x] := IntToStr(Random(100));
|
|
NiceGrid1.Cells[4, x] := IntToStr(Random(100));
|
|
end;
|
|
end;
|
|
|
|
procedure TMainForm.NiceGrid1DrawCell(Sender: TObject; ACanvas: TCanvas; X,
|
|
Y: Integer; Rc: TRect; var Handled: Boolean);
|
|
var
|
|
i: Integer;
|
|
begin
|
|
i := StrToIntDef(NiceGrid1.Cells[X, Y], 0);
|
|
if Odd(i)
|
|
then ACanvas.Font.Color := clRed;
|
|
if ((i mod 10) = 0)
|
|
then ACanvas.Brush.Color := clYellow;
|
|
end;
|
|
|
|
end.
|