Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-12

splash screen idea

6 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

LeVA
to LeVA: Hello! I want to create a nice splash screen for my project. Anybody have an idea how to…

Mattias Gaertner �rta:

Show quoted text 32 lines
On Thu, 18 Dec 2003 14:06:40 +0100 Vincent Snijders wrote: >On Thu, 18 Dec 2003 14:01:26 +0100 >LeVA wrote: > > >>Hello! >> >>I want to create a nice splash screen for my project. Anybody have an >>idea how to do this in lazarus? I'm thinking about displaying a big >>image when starting the app, with the BorderStyle set to "bsnone". But >>I don't know how to delay a form's closing. I mean I want to display >>the form with the big image for 2 seconds, and after that I want to >>close it. How could I do this? Or is there any simpler idea of making >>splash screens? > >You might want to check the lazarus source code, because lazarus has a >splash screen it self (didn't you notice?). > >Start in lazarus.pp. The lazarus splash screen hides as soon as lazarus becomes idle (= ready for input). If you have a program, that starts very fast and you want the splash screen to stay 2 seconds more, then create a TTimer in the Application.OnIdle event. Mattias

Thanks but I can not understand what the lazarus.pp does with the splash unit. I can not understand the splash unit either. I was thinking about some easy howto for newbies about creating a splash screen. I am currently reading Kylix's help about creating splash screens. It tells me to create two forms. Set Form1's FormActivate event to do this:

if Startup then
   begin
     Startup := False;
     SplashScreen.Show;
   end;

It says that, that startup is a constant, and it's declared in Form1's interface part. But in lazarus there is no such constant, thus I can not check if startup is true or false. I tried to create that variable myself, like this:
var

    startup : boolean = true;

I need to give this variable a starting value, or else the 'if' won't work. But lazarus complains about that declaration. It says, that I can not use the '= true'. Why? In delphi and kylix this works fine, and this is (I think) a very useful feature. But if lazarus doesn't support that kind of declaration, then I must use something else. But I don't know what. Is it possible that someone would be that nice, and write me an example, how to do a splash screen in lazarus? That would some kind of christmas gift for me :)

Thanks!

Daniel

LeVA

Reply by email

LeVA

Hello!

I want to create a nice splash screen for my project. Anybody have an idea how to do this in lazarus? I'm thinking about displaying a big image when starting the app, with the BorderStyle set to "bsnone". But I don't know how to delay a form's closing. I mean I want to display the form with the big image for 2 seconds, and after that I want to close it. How could I do this? Or is there any simpler idea of making splash screens?

Thanks a lot.

LeVA

Reply by email

Mattias Gaertner
to LeVA
Show quoted text 16 lines
On Thu, 18 Dec 2003 14:01:26 +0100 LeVA wrote: > Hello! > > I want to create a nice splash screen for my project. Anybody have an > idea how to do this in lazarus? I'm thinking about displaying a big > image when starting the app, with the BorderStyle set to "bsnone". But > I don't know how to delay a form's closing. I mean I want to display > the form with the big image for 2 seconds, and after that I want to > close it. How could I do this? Or is there any simpler idea of making > splash screens? You might want to check the lazarus source code, because lazarus has a splash screen it self (didn't you notice?). Start in lazarus.pp.

The lazarus splash screen hides as soon as lazarus becomes idle (= ready for input).
If you have a program, that starts very fast and you want the splash screen to stay 2 seconds more, then create a TTimer in the Application.OnIdle event.

Mattias

Reply by email

Vincent Snijders
to LeVA: Hello! I want to create a nice splash screen for my project. Anybody have an idea how to…
Show quoted text 9 lines
Hello! I want to create a nice splash screen for my project. Anybody have an idea how to do this in lazarus? I'm thinking about displaying a big image when starting the app, with the BorderStyle set to "bsnone". But I don't know how to delay a form's closing. I mean I want to display the form with the big image for 2 seconds, and after that I want to close it. How could I do this? Or is there any simpler idea of making splash screens?

You might want to check the lazarus source code, because lazarus has a splash screen it self (didn't you notice?).

Start in lazarus.pp.

HTH,
Vincent.

Reply by email

Anders Jensen
You might want to check the lazarus source code, because lazarus has a splash screen it self (didn't you notice?).

Or why not use a timer?

Interval:="your desired splash-delay";
OnTimer_event(close splash-form and show mainform);

could work, right?

oh, btw, would not do any cut`n paste on that code :)

Reply by email

Tony Maro
to LeVA: Mattias Gaertner �rta: Thanks but I can not understand what the lazarus.pp does with…
Thanks but I can not understand what the lazarus.pp does with the splash

CheckBook Tracker has one as well. It's implemented the same way as in Delphi.

http://tony.maro.net/mod.php?mod=downloads&op=showcat&id=1&level=1

Make sure you tell it to NOT auto-create the splash form or you'll get two copies.

Then do something like this in the .lpr file:

Application.Initialize;
FrmSplash := TFrmSplash.Create(Application);
FrmSplash.Show;
FrmSplash.Refresh;
Application.Processmessages; // won't paint content otherwise...
// next is the apps MAIN form... When closed, the app closes
// this is determined by it being the first called with CreateForm.
// so you DO NOT want to call the splash that way.
Application.CreateForm(TFrmMain, FrmMain);
Application.CreateForm(TFrmBalance, FrmBalance); // another form
Application.Run;

In the FrmMain.OnShow event, make sure you call FrmSplash.Close

-Tony Maro

Reply by email