2022-03-08 12:25:51 -05:00
|
|
|
unit SplashForm;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
Dialogs, StdCtrls, ExtCtrls, Global, Vcl.Imaging.jpeg;
|
|
|
|
|
|
|
|
type
|
|
|
|
TSplashWindow = class(TForm)
|
|
|
|
|
|
|
|
BackgroundImage: TImage;
|
|
|
|
lblVersion: TLabel;
|
|
|
|
lblInfo: TLabel;
|
|
|
|
procedure FormCreate(Sender: TObject);
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
procedure FormHide(Sender: TObject);
|
|
|
|
private
|
|
|
|
{ Private declarations }
|
|
|
|
public
|
|
|
|
procedure SetInfo(info:string);
|
|
|
|
end;
|
2022-06-23 06:22:32 -04:00
|
|
|
|
2022-03-08 12:25:51 -05:00
|
|
|
var
|
|
|
|
SplashWindow: TSplashWindow;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
2022-06-23 06:22:32 -04:00
|
|
|
const
|
|
|
|
DURATION = 900;
|
|
|
|
|
2022-03-08 12:25:51 -05:00
|
|
|
procedure TSplashWindow.FormCreate(Sender: TObject);
|
|
|
|
begin
|
|
|
|
lblVersion.Caption := APP_VERSION + APP_BUILD;
|
|
|
|
// AV: for compatibility with different UI color styles:
|
|
|
|
with lblVersion do Canvas.Font := Font;
|
|
|
|
Left := (Screen.Width - Width) div 2;
|
|
|
|
Top := (Screen.Height - Height) div 2;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TSplashWindow.FormHide(Sender: TObject);
|
|
|
|
begin
|
|
|
|
repeat
|
|
|
|
Application.ProcessMessages;
|
|
|
|
until CloseQuery;
|
|
|
|
AnimateWindow(Handle, DURATION, {AW_BLEND} AW_CENTER or AW_HIDE)
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TSplashWindow.FormShow(Sender: TObject);
|
|
|
|
begin
|
|
|
|
AnimateWindow(Handle, DURATION, {AW_BLEND} AW_CENTER);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TSplashWindow.SetInfo(info: string);
|
|
|
|
begin
|
|
|
|
// AV: for compatibility with different UI color styles:
|
|
|
|
lblInfo.Repaint;
|
|
|
|
lblInfo.Canvas.TextOut(0, 0, info);
|
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|