Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread How to create Splash form?
Sun, May 20 2012 4:38 AMPermanent Link

Leslie

Hi,

How to create  Splash form to show while the main form is loading?

Cheers,
Leslie
Sun, May 20 2012 8:45 AMPermanent Link

Rick

<Leslie> wrote in message
news:C10FD8CE-ACB2-4F38-9D33-F4A770BA51E9@news.elevatesoft.com...
>
> How to create  Splash form to show while the main form is loading?
>
>

Hi Leslie.

So far my experience shows that it's best to dynamically load data only when
you need it. This staggers most initialization processing to minimize
startup delay which keeps the user relatively happy. However, I have had
some success utilizing a TTimer control to allow the application to start
and a splash form to display whilst initial processing is performed. I did
the following:

Create a splash form and set it to not auto-create in project options. Also
set its position to desktop center or as appropriate.

Drop a TTimer control on the main form and set its Enabled property to
False.

Include the main form OnCreate event and double click the TTimer to define
the OnTimer event.

Add this code to the main unit:

implementation

uses UnitSplash;

procedure TForm1.Form1Create(Sender: TObject);
begin
FormSplash:=TFormSplash.Create(nil);
FormSplash.ShowModal;
Timer1.Enabled:=True;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
i: integer;
begin
Timer1.Enabled:=False;
//
// Perform initialization processing here
//
FormSplash.Close;
FormSplash.Free;
end;

end.

This seems to work but shows the following interesting anomolies:

1. Even though ShowModal is specified by the splash form it appears that the
actual display shows the opposite - the splash form is dimmed and the main
form is shown as though it is active.

2. Sometimes the cursor changes to an hour glass and sometimes it doesn't.

3. If the splash form is not closed before it is freed then the modal
setting appears to remain active.

There is probably a better way to do this.

--
Rick

Sun, May 20 2012 5:42 PMPermanent Link

Leslie

Rick,

I have tried a few ways with a Delphi mindset. Your idea is more EWB like and migth just work here. Smile Though I am trying to avoid the need for splash with fast enough loading.

Thanks,
Leslie

Cheers,
Leslie
Sun, May 20 2012 5:44 PMPermanent Link

Leslie

This is just a test for unchecking "Attach signature".

Cheers,
Leslie
Sun, May 20 2012 5:45 PMPermanent Link

Leslie

Yep. Tim, it is attached anyway.

Cheers,
Leslie
Mon, May 21 2012 8:50 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

<< Yep. Tim, it is attached anyway. >>

Testing....
------------

Tim Young
Elevate Software
www.elevatesoft.com
Mon, May 21 2012 8:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Fixed ?
Mon, May 21 2012 8:55 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Leslie,

It's fixed now.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, May 21 2012 10:38 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Rick,

<< So far my experience shows that it's best to dynamically load data only
when you need it. This staggers most initialization processing to minimize
startup delay which keeps the user relatively happy. However, I have had
some success utilizing a TTimer control to allow the application to start
and a splash form to display whilst initial processing is performed. I did
the following: >>

There were two issues here:

1) The main form in a project is automatically set as Visible:=True when the
application is run.  This obscures the splash form since it is sent to back
when the main form is shown.  By default, when a form is shown, it is
automatically brought to front.  I'm not sure how I'm going to fix this one.
What is really needed is a "stay on top", but I might be able to do
something with respect to just observing the modality of the top-most form.

2) The issue with the form free needing a close before it is now fixed.
This was broken when the form code was moved into the panels a while ago.

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, May 21 2012 10:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Rick,

This is now fixed - what I did was simply not issue a BringToFront if the
current form being shown is the main form.  Probably at some point I'll need
to add a "StayOnTop" property, but for now this will work without affecting
any other functionality (the main form is the only form that is
"auto-shown").

Tim Young
Elevate Software
www.elevatesoft.com
Image