From 4ffb33a0bca1d9f1cf33cf4a6b8082ddbdce2b36 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 6 Sep 2023 16:45:26 +0200 Subject: [PATCH] ide: splasform use CreateForm --- ide/lazarus.pp | 7 ++----- ide/splash.pp | 11 +++++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ide/lazarus.pp b/ide/lazarus.pp index a996c73dbe..f60546e74a 100644 --- a/ide/lazarus.pp +++ b/ide/lazarus.pp @@ -137,11 +137,8 @@ begin if Application.Terminated then exit; // Show splashform - if ShowSplashScreen then begin - SplashForm := TSplashForm.Create(nil); - SplashForm.Show; - Application.ProcessMessages; // process splash paint message - end; + if ShowSplashScreen then + Application.CreateForm(TSplashForm,SplashForm); TMainIDE.Create(Application); if not Application.Terminated then diff --git a/ide/splash.pp b/ide/splash.pp index 039dcaa2a0..0ba201db2c 100644 --- a/ide/splash.pp +++ b/ide/splash.pp @@ -51,6 +51,8 @@ type procedure ImagePaint(Sender: TObject); private procedure LoadSplash; + protected + procedure DoFirstShow; override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -103,6 +105,11 @@ begin SplashForm := nil; end; +procedure TSplashForm.Show; +begin + +end; + procedure TSplashForm.ApplicationOnIdle(Sender: TObject; var Done: boolean); begin Hide; @@ -127,9 +134,9 @@ begin Image.Picture.LoadFromResourceName(hInstance, 'splash_logo', TPortableNetworkGraphic); end; -procedure TSplashForm.Show; +procedure TSplashForm.DoFirstShow; begin - inherited; + inherited DoFirstShow; LoadSplash; ScaleImg(Image.Picture.Bitmap, Width, Height);