Скачиваний:
4
Добавлен:
01.05.2014
Размер:
1 Кб
Скачать
unit UShow;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, UMatr;

type
  TShow_F = class(TForm)
    DrawGrid1: TDrawGrid;
    procedure DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
      Rect: TRect; State: TGridDrawState);
  private
    { Private declarations }

  public
    { Public declarations }
    A_:Matr;    
    procedure Load(Const a:matr; Const N : Ind_m);
  end;

var
  Show_F: TShow_F;

implementation

{$R *.dfm}

Procedure TShow_F.Load(Const A : Matr; Const N : Ind_M);
Begin
  A_ := A;
  DrawGrid1.RowCount := N + 1;
  DrawGrid1.ColCount := N + 1;
End;

procedure TShow_F.DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
Var S :String;
    P, Q : UMatr.Next;
begin
  S := '0';
  DrawGrid1.Canvas.Font.Color := ClBlack;
  If ARow = 0 then Begin
    S := IntToStr(ACol);
  End;
  If ACol = 0 then Begin
    S := IntToStr(ARow);
  End;

  With DrawGrid1.Canvas do Begin
    If (ACol <> 0) And (ARow <> 0) then
    Begin
       Font.Color := ClRed;
       P := A_.BaseRow[ARow-1].Right;
       Q := P;
      While Q^.Col <> 0 do
       Begin
        If Q^.Col = ACol then
          Begin
           S := IntToStr(Q^.Val);
           Font.Color := ClGreen;
          End;
        Q := Q.Right;
       End;
    End;
    TextOut(Rect.Left + 10, Rect.Top + 10, S);
  End;
end;

end.
Соседние файлы в папке Возведение матрицы в степень
  • #
    01.05.201451 б4Uprog.ddp
  • #
    01.05.20141 Кб4Uprog.dfm
  • #
    01.05.2014345 б5Uprog.pas
  • #
    01.05.20144 Кб4UShow.dcu
  • #
    01.05.2014708 б4UShow.dfm
  • #
    01.05.20141 Кб4UShow.pas