⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showinfou.pas

📁 source for card readers
💻 PAS
字号:
unit ShowInfoU;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics,
  Controls, Forms, Dialogs, TemplateU, StdCtrls, Buttons, ExtCtrls,
  SightingU;

type
  TfrmShowInfo = class(TfrmTemplate)
    lblPrompt: TLabel;
    lblGrid: TLabel;
    lblNumber: TLabel;
    lblSightType: TLabel;
    lblDate: TLabel;
    lblBreeding: TLabel;
  public
    procedure ShowInfo (ASighting: TSighting); // receive reference to Sighting
  end; // end TfrmShowInfo = class(TfrmTemplate)

var
  frmShowInfo: TfrmShowInfo;

implementation

{$R *.dfm}

procedure TfrmShowInfo.ShowInfo(ASighting: TSighting);
begin
  // first display substitutable properties
  lblGrid.Caption := 'Grid: ' + ASighting.Grid;
  lblNumber.Caption := 'Number: ' + IntToStr(ASighting.Number);
  lblSightType.Caption := 'Type: ' + ASighting.SightType;

  // now display child-specific properties
  if ASighting is TBirdSighting then
    with (ASighting as TBirdSighting) do
    begin
      lblDate.Caption := 'Date: ' + SightDate;
      lblDate.Visible := True;
      lblBreeding.Caption := 'Breeding: ' +
                             BoolToStr(Breeding, True);
      lblBreeding.Visible := True;
    end
  else if ASighting is TTreeSighting then
  begin  
    lblDate.Visible := False;
    lblBreeding.Visible := False;
  end;
  ShowModal;
end; // end procedure TfrmShowInfo.ShowInfo

end. // end ShowInfoU

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -