Registriert seit: 31. Aug 2007
Ort: 99974 MHL
695 Beiträge
Delphi 10.1 Berlin Starter
|
Re: Ladebalken in Splash
27. Sep 2007, 20:17
Hallo, ich mache sowas gleich in der dpr-Datei.
Das Form SplashScreen hat eine public-Procedure (StepForward), die den Vortschrittsbalken weiterschiebt bzw. neu setzt. Hier der Code einer dpr-Datei von mir. Hab aber einiges rausgenommen. Soll ja nur das Prinzip verdeutlichen.
Delphi-Quellcode:
program irgendwas;
uses
Forms,
Windows,
SysUtils,
Controls,
ph2_Tools in '..\4AllUnits\ph2_Tools.pas',
ph2_Main in '..\4AllUnits\ph2_Main.pas' {frmMain},
ph2_Splash in '..\4AllUnits\ph2_Splash.pas' {SplashScr},
ph2_HauptMenu in '..\4AllUnits\ph2_HauptMenu.pas' {HauptMenu},
ph2_ShowUebung in 'Units\ph2_ShowUebung.pas',
ph2_Sound in '..\4AllUnits\ph2_Sound.pas',
ph2_frm301 in 'Units\ph2_frm301.pas' {frm301},
ph2_afrm301 in 'Units\ph2_afrm301.pas' {auf301},
ph2_frm302 in 'Units\ph2_frm302.pas' {frm302},
ph2_frm303 in 'Units\ph2_frm303.pas' {frm303},
ph2_afrm303 in 'Units\ph2_afrm303.pas' {auf303},
ph2_frm304 in 'Units\ph2_frm304.pas' {frm304},
ph2_afrm304 in 'Units\ph2_afrm304.pas' {auf304},
ph2_frm305 in 'Units\ph2_frm305.pas' {frm305},
ph2_frm306 in 'Units\ph2_frm306.pas' {frm306};
{$R *.res}
begin
ProgrammIndex:=3;
Application.Initialize;
Application.Title := 'Elektronik';
Application.CreateForm(TfrmMain, frmMain);
Application.CreateForm(TLoginScreen, LoginScreen);
if ((LoginScreen.ShowModal=mrOK) and AppData.appLoginOK) then begin
Application.CreateForm(TSplashScr, SplashScr);
SplashScr.ProgressBar.Max:=10;
SplashScr.show;
SplashScr.repaint;
LoginScreen.Free;
//alle anderen Windows laden
SplashScr.StepForward; //Position 1
if FileExists(AppData.ResPath+'HG.bmp') then
frmMain.BackGround.LoadFromFile(AppData.ResPath+'HG.bmp');
SplashScr.StepForward; //Position 2
if FileExists(AppData.ResPath+'crDefault.cur') then
Screen.Cursors[myDefault]:=LoadCursorFromFile(PChar(AppData.ResPath+'crDefault.cur'));
Screen.Cursor:=myDefault;
SplashScr.StepForward; //Position 3
Application.CreateForm(THauptMenu, HauptMenu);
SplashScr.StepForward; //Position 4
//Übung 1
Application.CreateForm(Tfrm301, frm301);
Application.CreateForm(Tauf301, auf301);
SplashScr.StepForward; //Position 5
//Übung 2
Application.CreateForm(Tfrm302, frm302);
SplashScr.StepForward; //Position 6
//Übung 3
Application.CreateForm(Tfrm303, frm303);
Application.CreateForm(Tauf303, auf303);
SplashScr.StepForward; //Position 7
//Übung 4
Application.CreateForm(Tfrm304, frm304);
Application.CreateForm(Tauf304, auf304);
SplashScr.StepForward; //Position 8
//Übung 5
Application.CreateForm(Tfrm305, frm305);
SplashScr.StepForward; //Position 9
//Übung 6
Application.CreateForm(Tfrm306, frm306);
SplashScr.StepForward; //Position 10
SplashScr.Free;
Application.Run;
end else begin
Application.Terminate;
end;
end.
Karl-Heinz
|
|
Zitat
|