![]() |
Re: Tutorial: Splash Screens
Seltsam...
Ich habe folgenden Code:
Delphi-Quellcode:
Splash:
begin
FSplash := TFSplash.Create(Application); try FSplash.Show; FSplash.Refresh; Application.Initialize; Application.Title := 'TrackMania IPC'; Application.CreateForm(TFForm, FForm); Application.CreateForm(TForm1, Form1); finally FSplash.InitializationDone := True; end; Application.Run; FForm.Visible := false; end.
Delphi-Quellcode:
Ich habe außer dort beim Fade KEIN Sleep.
procedure TFSplash.Show;
var i : Integer; begin inherited; for i := 0 to 255 do begin AlphaBlendValue := i; Application.ProcessMessages; Sleep(2); end; end; procedure TFSplash.FormClose(Sender: TObject; var Action: TCloseAction); var i : Integer; begin for i := 255 downto 0 do begin AlphaBlendValue := i; Application.ProcessMessages; Sleep(2); end; Action := caFree; UIPC.FForm.Enabled := true; FSplash := nil; end; procedure TFSplash.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin CanClose := (not Timer.Enabled) and FInitializationDone; end; procedure TFSplash.SetInitializationDone(const Value: Boolean); begin FInitializationDone := Value; Close; end; procedure TFSplash.TimerTimer(Sender: TObject); begin Timer.Enabled := False; Close; end; end. |
Re: Tutorial: Splash Screens
Moin Jungs !
Wollte nur mal eben sagen ... Vielen Dank für diesen Fred! Hat mich sehr geholft :hello: :witch: |
Re: Tutorial: Splash Screens
Ach sorry!
Vergesst den Post! Hab übersehn, dass der Splash noch im Hintergrund offen ist! Kann man das nicht so ändern, dass das Main-Window hinter dem Splash erscheint? |
Re: Tutorial: Splash Screens
Zitat:
...:cat:... |
Re: Tutorial: Splash Screens
Zitat:
Edit: Da war ich wohl zu langsam ... |
Re: Tutorial: Splash Screens
Dankeschön!
Jetzt kommt mir nur grad eins etwas seltsam vor.... Ich kann den SplashScreen nicht schließen. oO Weder über das 'X', noch über nen Close-Button. oO Es passiert einfach nix, wenn ich draufklicke... Und autom. tut sich auch nix. Der OnClose-Befehl wird ausgeführt, hab ich grad mal gemerkt. Es wird einfach nix geclosed. Hier mal noch der Code des Splash-Forms:
Delphi-Quellcode:
unit Unit4;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, jpeg; type TSplash = class(TForm) Timer1: TTimer; Image1: TImage; Label1: TLabel; Button1: TButton; procedure Timer1Timer(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure Button1Click(Sender: TObject); private { Private declarations } FInitializationDone: Boolean; procedure SetInitializationDone(const Value: Boolean); public { Public declarations } property InitializationDone: Boolean read FInitializationDone write SetInitializationDone; end; var Splash: TSplash; implementation uses Unit1; {$R *.dfm} procedure TSplash.Timer1Timer(Sender: TObject); begin Timer1.Enabled := False; close; end; procedure TSplash.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin CanClose := (not Timer1.Enabled) and FInitializationDone; end; procedure TSplash.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; Splash := nil; Form1.Enabled := True; end; procedure TSplash.SetInitializationDone(const Value: Boolean); begin FInitializationDone := Value; close; end; procedure TSplash.Button1Click(Sender: TObject); begin close; end; end. |
Re: Tutorial: Splash Screens
Du hast den Code gezeigt, welcher den Splash-Screen automatisch schließt (wenn das Hauptformular die "fertig"-Meldung gesandt hat) - lade Dir alle Beispiele herunter, dann siehst Du die verschiedenen Möglichkeiten.
...:cat:... |
Re: Tutorial: Splash Screens
Hi,
kann es vielleicht auch sein, dass Du den Code in der Projektdatei vergessen hast? |
Re: Tutorial: Splash Screens
@ Die Muhkuh: Jap, ist auch alles drin.
Delphi-Quellcode:
@ sakura: Das komische ist ja, dass ich keinen Unterschied in der Hinsicht finden kann. Entweder bin ich total blind, oder es kann sich nu um ne Kleinigkeit handeln...
begin
Splash := TSplash.Create(Application); try Splash.Show; Splash.Refresh; Application.Initialize; Application.Title := 'SPlan'; Application.CreateForm(TForm1, Form1); Application.CreateForm(TFaecherBox, FaecherBox); Application.CreateForm(TSettings_Standard, Settings_Standard); Application.CreateForm(TAboutBox, AboutBox); Application.CreateForm(THTMLFarben, HTMLFarben); Application.CreateForm(TSettings_FTP, Settings_FTP); Application.CreateForm(TSchullogo, Schullogo); Application.CreateForm(TeMail, eMail); Application.CreateForm(TReadme, Readme); Application.CreateForm(TSplash, Splash); finally Splash.InitializationDone := True; end; Application.Run; |
Re: Tutorial: Splash Screens
Was hat der Timer für ein Intervall?
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:47 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz