Recent

Author Topic: splash screen  (Read 20270 times)

thebigdax

  • New Member
  • *
  • Posts: 13
splash screen
« on: November 19, 2005, 07:01:57 pm »
how can i create a splash screen such when i open lazarus

thank you

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2674
RE: splash screen
« Reply #1 on: November 21, 2005, 11:20:36 am »
set to formtype to splashform
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

thebigdax

  • New Member
  • *
  • Posts: 13
RE: splash screen
« Reply #2 on: November 22, 2005, 08:00:35 pm »
all work, thank you

Anonymous

  • Guest
RE: splash screen
« Reply #3 on: January 08, 2006, 07:24:07 am »
I also want to create a splashscreen. I created a new form and set FormStyle to splashform.
but I'm stuck there. The Delphi code I'm trying to translate goes like that :
var  SplashScreen: TfrmSplash;  

An error is all I get saying there's no TfrmSplash.

Could you please tell me how to procede?

matthijs

  • Hero Member
  • *****
  • Posts: 537
RE: splash screen
« Reply #4 on: January 08, 2006, 09:01:19 am »
Post your code where you are using th Splash form. It looks like you have not added the unit containing your splash screen to the uses section.
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

christophe_D

  • New Member
  • *
  • Posts: 20
splash screen
« Reply #5 on: June 07, 2006, 11:24:06 pm »
here is a small example to do a splash screen

At first time create add a second form to your project

give it the name at the form : Splash
save it with the name : splScreen.pas

in your project.lpr add the follow line

Code: [Select]

program project;

{$MODE Delphi}


uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  //cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms
  { add your units here } splScreen;

begin
  Application.Title:='name of your project';
  Application.Initialize;
  Splash:=Tsplash.create(application);
  Splash.show;
  Splash.Update;
  application.ProcessMessages; // to be sure to show the splash
// the other unit of your project
// remove the line Application.CreateForm(Tsplash, Splash);
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.CreateForm(TForm3, Form3);
  Splash.close;
  Splash.Release;
  Application.Run;
end.


finally if the loading is fast your can add a sleep(1000) in the Tsplash.create

is it that can help you ?

CCRDude

  • Hero Member
  • *****
  • Posts: 615
splash screen
« Reply #6 on: June 15, 2006, 06:36:33 pm »
Sleep ??? That causes the app to appear to hang during the specified time period if I'm not mistaken. Sleep is a left-over from non-multitasking times ;)

MSDN on Sleep:
Quote
Therefore, if you have a thread that creates windows, use MsgWaitForMultipleObjects or MsgWaitForMultipleObjectsEx, rather than Sleep.

christophe_D

  • New Member
  • *
  • Posts: 20
splash screen
« Reply #7 on: June 15, 2006, 07:04:14 pm »
Quote from: "CCRDude"
Sleep ??? That causes the app to appear to hang during the specified time period if I'm not mistaken. Sleep is a left-over from non-multitasking times ;)

MSDN on Sleep:
Quote
Therefore, if you have a thread that creates windows, use MsgWaitForMultipleObjects or MsgWaitForMultipleObjectsEx, rather than Sleep.


i use the sleep only , if the longer of loading is < 20 sec only for have time to see the splash ...
if the loading is > 20 sec don't used the sleep ... only the application.processmessage will dislpay correctly the splashScreen , and continu the loading

 

TinyPortal © 2005-2018