📄 untabout.pas
字号:
{
接龙游戏关于窗
黄文林 2006-02-13
}
unit untAbout;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ShellAPI;
type
TfrmAbout = class(TForm)
lblTitle: TLabel;
btnOK: TButton;
lblLink: TLabel;
pnlText: TPanel;
imgText: TImage;
imgICON: TImage;
lblTitle2: TLabel;
tmrDraw: TTimer;
procedure FormCreate(Sender: TObject);
procedure lblLinkClick(Sender: TObject);
procedure tmrDrawTimer(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure imgTextMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure imgTextMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
imgTemp: TImage;
FTop: Integer;
procedure UpdateText; //更新显示信息
procedure DrawText; //画显示信息
public
{ Public declarations }
end;
implementation
{$R *.dfm}
procedure TfrmAbout.UpdateText;
var
rect: TRect;
begin
rect.Top := FTop;
rect.Left := 0;
rect.Right := imgText.Width;
rect.Bottom := FTop + imgText.Height;
imgText.Canvas.CopyRect(imgText.ClientRect, imgTemp.Canvas, rect);
end;
procedure TfrmAbout.DrawText;
const
rowheight = 20;
var
i, m, t, w: Integer;
SRec: TSearchRec;
s: array[0..5, 0..1] of string;
begin
FindFirst(Application.ExeName,FaAnyFile,SRec); //取程序创建日期
s[0,0] := 'Version:';
s[0,1] := '1.0';
s[1,0] := 'Last Date:';
s[1,1] := DateTimeToStr(FileDateToDateTime(SRec.Time));
s[2,0] := 'Author:';
s[2,1] := 'Czcn';
s[3,0] := 'Email:';
s[3,1] := 'czcn@163.com';
s[4,0] := 'QQ:';
s[4,1] := '36025277';
s[5,0] := 'MSN:';
s[5,1] := 'hwl952@hotmail.com';
with imgTemp do
begin
Width := imgText.Width;
Height := imgText.Height + rowheight * 6;
Canvas.Pen.Color := clGray;
Canvas.Brush.Color := clGray;
Canvas.Font.Color := clWhite;
Canvas.Rectangle(0, 0, Width, Height);
m := Width div 2;
t := imgText.Height;
for i := 0 to 5 do
begin
w := Canvas.TextWidth(s[i,0]);
Canvas.TextOut(m - w - 5, t, s[i, 0]);
Canvas.TextOut(m + 5, t, s[i, 1]);
t := t + rowheight;
end;
end;
end;
procedure TfrmAbout.FormCreate(Sender: TObject);
begin
imgICON.Picture.Icon := Application.Icon; //取工程图标
imgTemp := TImage.Create(self);
DrawText;
UpdateText;
tmrDraw.Enabled := True;
end;
procedure TfrmAbout.FormDestroy(Sender: TObject);
begin
imgTemp.Free;
end;
procedure TfrmAbout.lblLinkClick(Sender: TObject);
begin
ShellExecute(0,'open',pchar('mailto:czcn@163.com'),nil,nil,SW_SHOW);
end;
procedure TfrmAbout.tmrDrawTimer(Sender: TObject);
begin
FTop := FTop + 1;
if FTop > imgTemp.Height then FTop := 0;
UpdateText;
end;
procedure TfrmAbout.imgTextMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
tmrDraw.Enabled := False;
end;
procedure TfrmAbout.imgTextMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
tmrDraw.Enabled := True;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -