home *** CD-ROM | disk | FTP | other *** search
- unit About;
-
- interface
-
- uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, StdCtrls,
- Buttons, ExtCtrls, SysUtils, OleCtrls, LEAD, LEADDef;
-
- type
- TAboutBox = class(TForm)
- Panel1: TPanel;
- ProgramIcon: TImage;
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- GroupBox1: TGroupBox;
- Product: TLabel;
- Level: TLabel;
- Version: TLabel;
- BDate: TLabel;
- BTime: TLabel;
- LeadCtrl1: TLeadCtrl;
- procedure FormCreate(Sender: TObject);
- procedure FormShow(Sender: TObject);
- private
- { Private declarations }
- bImageLoaded: bool;
- public
- { Public declarations }
- end;
-
- var
- AboutBox: TAboutBox;
-
- implementation
-
- {$R *.DFM}
-
- procedure TAboutBox.FormCreate(Sender: TObject);
- var
- S : String;
- begin
- {get the version info from the LEAD OCX}
- Product.Caption:=LeadCtrl1.VersionProduct;
- BDate.Caption:=LeadCtrl1.VersionDate;
- BTime.Caption:=LeadCtrl1.VersionTime;
- If (LeadCtrl1.VersionLevel = VERSIONLEVEL_EXP) then
- Level.Caption:='Express'
- else If (LeadCtrl1.VersionLevel = VERSIONLEVEL_MEDICAL) then
- Level.Caption:='Medical Express'
- else
- Level.Caption:='Professional';
- Str(LeadCtrl1.VersionMajor, S);
- Version.Caption:=S;
- Str(LeadCtrl1.VersionMinor, S);
- Version.Caption:=Version.Caption + '.';
- Version.Caption:=Version.Caption + S;
-
- { Load the image when you are about to show the ABout form }
- bImageLoaded := False;
- end;
-
- procedure TAboutBox.FormShow(Sender: TObject);
- var
- nRet, nWidth, nHeight : integer;
- rWidth, rHeight : real;
- begin
- {load an image called image1.cmp and display it as a Glyph}
- {note, this image is in the images subdir of the LEADTOOLS}
- {install dir. Also, if you change dirs and then open this}
- {dialog, Load will fail and no image will be used.}
- if bImageLoaded = false then
- begin
- bImageLoaded := true;
- LeadCtrl1.EnableMethodErrors := False;
- Screen.Cursor := crHourglass;
- nRet:=LeadCtrl1.Load('..\..\..\..\images\image1.cmp', 0, 0, 1);
- if (nRet = 0) then
- begin
- { resize the image to fit the OCX, and maintain aspect ratio }
- if (LeadCtrl1.BitmapWidth>LeadCtrl1.BitmapHeight) then
- Begin
- nWidth:=LeadCtrl1.Width;
- rHeight:=nWidth * (LeadCtrl1.BitmapHeight / LeadCtrl1.BitmapWidth);
- nHeight:=Round(rHeight);
- LeadCtrl1.Size(nWidth, nHeight, RESIZE_RESAMPLE);
- end
- else
- Begin
- nHeight:=LeadCtrl1.Height;
- rWidth:=nHeight * (LeadCtrl1.BitmapWidth / LeadCtrl1.BitmapHeight);
- nWidth:=Round(rWidth);
- nRet:=LeadCtrl1.Size(nWidth, nHeight, RESIZE_RESAMPLE);
- end;
- end;
- Screen.Cursor := crDefault;
- end;
- end;
-
- end.
-
-