Initial commit - Delphi MES client project
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
unit uSplash;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
|
||||
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Layouts,
|
||||
FMX.ExtCtrls, FMX.StdCtrls,uMain;
|
||||
|
||||
type
|
||||
TSplashForm = class(TForm)
|
||||
StartupTimer: TTimer;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure StartupTimerTimer(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
private
|
||||
FInitialized:boolean;
|
||||
{ Private declarations }
|
||||
public
|
||||
procedure LoadMainForm;
|
||||
end;
|
||||
|
||||
var
|
||||
SplashForm: TSplashForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.fmx}
|
||||
procedure TSplashForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
StartupTimer.Enabled := false;
|
||||
StartupTimer.Interval := 800; // can be changed to improve startup speed in later releases
|
||||
end;
|
||||
|
||||
procedure TSplashForm.FormShow(Sender: TObject);
|
||||
begin
|
||||
StartupTimer.Enabled:=not FInitialized;
|
||||
end;
|
||||
|
||||
procedure TSplashForm.LoadMainForm;
|
||||
var
|
||||
form: TForm;
|
||||
begin
|
||||
form := TfrmMain.Create(Application);
|
||||
form.Show;
|
||||
Application.MainForm := form;
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TSplashForm.StartupTimerTimer(Sender: TObject);
|
||||
begin
|
||||
StartupTimer.Enabled := false;
|
||||
if not FInitialized then begin
|
||||
FInitialized := true;
|
||||
LoadMainForm;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user