{*****************************************************************************
 *
 *  FMSplash.pas - Splash screen form  (17-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 FMSplash;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls, PXStuff, ComCtrls, CommCtrl;

type
  TSplashForm = class(TForm)
    Image1: TImage;
    LabelsXMailer: TLabel;
    ListBox1: TListBox;
    Panel1: TPanel;
    ProgressBar1: TProgressBar;
    Label2: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure ShowNextStep;
  private
    { Private declarations }
    FStep : integer;
  public
    { Public declarations }
  end;

var
  SplashForm: TSplashForm;

implementation

{$R *.DFM}

procedure TSplashForm.FormCreate(Sender: TObject);
var
  S: string;
begin
  labelsXMailer.Caption := sXMailer;
  S := GetAppPath + 'LogoRR.bmp';
  if FileExists(S) then
    Image1.Picture.LoadFromFile(S);
  Image1.AutoSize := True;
  ClientWidth := Image1.Width;
  ClientHeight := Image1.Height;
  FStep := 0;
end;

procedure TSplashForm.ShowNextStep;
begin
  ProgressBar1.Perform(PBM_SETBARCOLOR, 0, clwhite);
  Label2.Caption := ListBox1.Items.Strings[FStep];
  ProgressBar1.Position:= Round(((FStep + 1) / ListBox1.Items.Count) * 100);
  inc(FStep);
  Update;                 // Redraw form
end;

procedure TSplashForm.FormActivate(Sender: TObject);
begin
  Update;
end;

initialization
   PMRegistry.AddCustomClass(TSplashForm, 'TSplashForm');

end.
