| Class TPileForm (unit SandShow) |
TForm
Methods for visualizing the sandpile
| Constructors |
| Functions |
procedure DrawGridDrawCell(Sender: TObject; Col, Row: Longint;
Rect: TRect; State: TGridDrawState);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormHide(Sender: TObject);
procedure QuickDrawCell(X, Y: Integer);
procedure SetGridSize;
procedure UndrawTrace;| Properties |
| Events |
| Variables |
DrawGrid : TDrawGrid;
GridSize : Byte;
TracedCells : TQueue;| Constructors |
| Functions |
procedure DrawGridDrawCell(Sender: TObject; Col, Row: Longint;
Rect: TRect; State: TGridDrawState);
procedure FormCreate(Sender: TObject);--------------------- TPileForm ----------------------
procedure FormDestroy(Sender: TObject);
procedure FormHide(Sender: TObject);
procedure QuickDrawCell(X, Y: Integer);Fill the cell with the right color
procedure SetGridSize;procedure TPileForm.ClearCells; // Clears all cells in the drawing grid var I, J: Longint; begin with Grid do begin Canvas.Brush.Color := clWindow; Canvas.FillRect(ClientRect); { for I := 0 to ColCount -1 do for J := 0 to RowCount -1 do Canvas.FillRect(CellRect(I,J)); // Fill the cell } end; end;
procedure UndrawTrace;Use trace color
| Properties |
| Events |
| Variables |
DrawGrid : TDrawGrid;
GridSize : Byte;
TracedCells : TQueue;# cells in grid (horiz. and vert.