[lazarus] splash screen idea
LeVA
leva at az.isten.hu
Thu Dec 18 10:51:15 EST 2003
Mattias Gaertner írta:
> On Thu, 18 Dec 2003 14:06:40 +0100 Vincent Snijders
> <vslist at mail.cwazy.co.uk> wrote:
>
>
>>On Thu, 18 Dec 2003 14:01:26 +0100
>>LeVA <leva at az.isten.hu> 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
More information about the Lazarus
mailing list