home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 11
/
Freelog011.iso
/
BestOf
/
PhoenixMail
/
Source
/
phoenix
/
FMInfo.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-02-12
|
5KB
|
197 lines
{*****************************************************************************
*
* FMInfo.pas - About... Form (16-August-1998)
*
* Copyright (c) 1998-99 Michael Haller
*
* Author: Michael Haller
* E-mail: michael@discountdrive.com
* Homepage: http://www.discountdrive.com/sunrise
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
*----------------------------------------------------------------------------
*
* Revision history:
*
* DATE REV DESCRIPTION
* ----------- --- ----------------------------------------------------------
*
*****************************************************************************}
unit FMInfo;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, PXStuff, ExtCtrls, PanelEx, LangSup;
type
TInfoForm = class(TForm)
Button1: TButton;
Bevel1: TBevel;
Timer1: TTimer;
Button2: TButton;
ListBox1: TListBox;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Notebook1: TNotebook;
PanelEx1: TPanelEx;
Memo1: TMemo;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
procedure PaintBox1Paint(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Timer1Timer(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
Bitmap: TBitmap;
XPos, YPos: Integer;
public
{ Public declarations }
end;
var
InfoForm: TInfoForm;
implementation
uses
Main;
{$R *.DFM}
procedure TInfoForm.FormCreate(Sender: TObject);
var
I, LineH, Pos: Integer;
S: String;
procedure CenterText;
var
I: Integer;
begin
I := Abs((Bitmap.Width div 2) - (Bitmap.Canvas.TextWidth(S) div 2));
Bitmap.Canvas.TextOut(I, Pos, S);
end;
begin
AttachLanguageToForm(Self);
if bOfficeFonts then Font.Name := sOfficeFontName;
// AttachLanguageToMemo(2, Memo1);
NoteBook1.ActivePage := 'About';
Button2.Caption := Label2.Caption;
Caption := Label5.Caption;
Label1.Caption := sInfoVersion+' ';
S := 'Version ' + sMailerVer1;
if MainForm.CheckBox2.Checked then S := 'Version ' + sMailerVer2;
ListBox1.Items.Insert(1, S);
Memo1.Lines.Add('');
Memo1.Lines.Delete(0);
Memo1.Lines.Add('The source code of Phoenix Mail is available for free at');
Memo1.Lines.Add(sHomepage);
Memo1.Lines.Add('');
Memo1.Lines.Add('');
YPos := 0;
XPos := 20;
Bitmap := TBitmap.Create;
//Bitmap.Assign(Image3.Picture.Bitmap);
Bitmap.Height := 1100;
Bitmap.Width := 280;
with Bitmap.Canvas do begin
Brush.Color := clBlack;
FillRect(Rect(0, 0, Bitmap.Width, Bitmap.Height));
Font.Name := 'Arial';
Font.Color := clWhite;
Font.Size := 9;
LineH := TextHeight('TMgyqpMJKLHhdghsdf') div 2;
Pos := 120;
for I := 0 to ListBox1.Items.Count-1 do begin
S := ListBox1.Items[I];
if (Length(S) > 0) and (S[1] = '$') then begin
Delete(S, 1, 1);
Inc(Pos, LineH*2);
Font.Style := [];
Font.Color := clYellow;
CenterText;
Font.Color := clWhite;
end else
if (Length(S) > 0) and (S[1] = '#') then begin
Inc(Pos, LineH*5);
Delete(S, 1, 1);
Font.Style := [fsBold];
CenterText;
Inc(Pos, LineH);
end else begin
Inc(Pos, LineH*2);
Font.Style := [];
CenterText;
end;
end;
end;
Timer1.Enabled := True;
end;
procedure TInfoForm.PaintBox1Paint(Sender: TObject);
var
DR, SR: TRect;
begin
PanelEx1.Canvas.CopyMode := cmSrcCopy;
DR := Rect(XPos, 0, PanelEx1.Width+XPos, PanelEx1.Height);
SR := Rect(0, YPos, PanelEx1.Width, YPos+PanelEx1.Height);
PanelEx1.Canvas.CopyRect(DR, Bitmap.Canvas, SR);
end;
procedure TInfoForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Bitmap.Free;
end;
procedure TInfoForm.Timer1Timer(Sender: TObject);
var
R: TRect;
begin
Inc(YPos);
if YPos >= Bitmap.Height-20 then YPos := -PanelEx1.Height;
ScrollWindow(PanelEx1.Handle, 0, -1, nil, nil);
R := Rect(0, PanelEx1.Height-1, PanelEx1.Width, 1);
InvalidateRect(PanelEx1.Handle, @R, True);
end;
procedure TInfoForm.Button2Click(Sender: TObject);
begin
if NoteBook1.ActivePage = 'About' then begin
NoteBook1.ActivePage := 'License';
Button2.Caption := Label3.Caption;
Caption := Label4.Caption;
Timer1.Enabled := False;
end else begin
NoteBook1.ActivePage := 'About';
Button2.Caption := Label2.Caption;
Caption := Label5.Caption;
Timer1.Enabled := True;
end;
end;
end.