Fórum Tela de apresentação (Form Splash) #208134

21/01/2004

0

CONCLUI UM SISTEMA QUE APENAS FAZ CÁLCULOS CONTABEIS . POR SER UM PROGRAMA LEVE. SEM ARMAZENAR DADOS , MINHA TELA DE APRESENTAÇAO SE MOSTRA DE FORMA MUITO RAPIDA. GOSTARIA DE SABER O CÓDIGO P CONTROLAR O TEMPO DE APRESENTAÇAO DESTE FORM (SPLASH) .OBRIGADO.

[color=green:8a5aca53ec][b:8a5aca53ec]Título editado conforme preevisto nas Regras de conduta - regra 2[/b:8a5aca53ec][/color:8a5aca53ec]


Fernandopastore

Fernandopastore

Responder

Posts

21/01/2004

Nigro

Uma saída muito legal é colocar um gauge de progesso... veja
Splash Screen Com Progresso
program Granja;
// Programador - José Jornando de Carvalho Júnior <- Lloyd Dickinson ->
// lloydsoft@uol.com.br
uses
Forms,
Principalf in ´Principalf.pas´ ,
Areaf in ´Areaf.pas´ ,
Galpaof in ´Galpaof.pas´ ,
Clientef in ´Clientef.pas´ ,
Saidaf in ´Saidaf.pas´ ,
Relatoriof in ´Relatoriof.pas´ ,
baixaf in ´baixaf.pas´ ,
Mortalidadef in ´Mortalidadef.pas´ ,
manubaixaf in ´manubaixaf.pas´ ,
ConsEstoquef in ´ConsEstoquef.pas´ ,
sobref in ´sobref.pas´ ,
ImpRelatoriof in ´ImpRelatoriof.pas´ ,
Consultasf in ´Consultasf.pas´ ,
ImpEntradaf in ´ImpEntradaf.pas´ ,
PassWord in ´PassWord.pas´ ,
ImpMortalidadef in ´ImpMortalidadef.pas´ ,
ImpSaidaf in ´ImpSaidaf.pas´ ,
ImpClientesf in ´ImpClientesf.pas´ ,
Apres2f in ´Apres2f.pas´ ,
Entradaf in ´Entradaf.pas´ ;

{$R *.RES}

var
i:shortint;
maximo:shortint=0;
divisor:shortint=19;
begin
Application.Initialize;
Application.Title := ´GSJ2 - LloydSoft´;
with TApres.Create(nil) do
try
Gauge1.MaxValue:=100;
Show;
Update;
Panel1.caption:=´Criando Tela: Principal´;
Panel1.Repaint;
Application.CreateForm(TPrincipal, Principal);
for i:=1 to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Cadastro de Entradas´;
Panel1.Repaint;
Application.CreateForm(TEntrada, Entrada);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Cadastro de Mortalidade´;
Panel1.Repaint;
Application.CreateForm(TImpMortalidade, ImpMortalidade);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Impressão de Saida´;
Panel1.Repaint;
Application.CreateForm(TImpSaida, ImpSaida);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Impressão de Clientes´;
Panel1.Repaint;
Application.CreateForm(TImpClientes, ImpClientes);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Password´;
Panel1.Repaint;
Application.CreateForm(TPasswordDlg, PasswordDlg);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Consultas´;
Panel1.Repaint;
Application.CreateForm(TConsultas, Consultas);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Impressão de Entradas´;
Panel1.Repaint;
Application.CreateForm(TImpEntrada, ImpEntrada);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Impressão de Relatório´;
Panel1.Repaint;
Application.CreateForm(TImpRelatorio, ImpRelatorio);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Estoque´;
Panel1.Repaint;
Application.CreateForm(TConsEstoque, ConsEstoque);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Sobre´;
Panel1.Repaint;
Application.CreateForm(TSobre, Sobre);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Cadastro de Entradas´;
Panel1.Repaint;
Application.CreateForm(TArea, Area);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Cadastro de Galpão´;
Panel1.Repaint;
Application.CreateForm(TGalpao, Galpao);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Cadastro de Clientes´;
Panel1.Repaint;
Application.CreateForm(TCliente, Cliente);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Cadastro de Saídas´;
Panel1.Repaint;
Application.CreateForm(TSaida, Saida);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Relatório´;
Panel1.Repaint;
Application.CreateForm(TRelatorio, Relatorio);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Baixa´;
Panel1.Repaint;
Application.CreateForm(TBaixa, Baixa);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Mortalidade´;
Panel1.Repaint;
Application.CreateForm(TMortalidade, Mortalidade);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Criando Tela: Manutenção´;
Panel1.Repaint;
Application.CreateForm(TManubaixa, Manubaixa);
for i:=maximo to (maximo+(100 div divisor)) do
begin
gauge1.progress:=i;
maximo:=i;
end;
Panel1.caption:=´Finalizando´;
Panel1.Repaint;
finally
Free;
end;
Application.Run;
end.


Responder

Gostei + 0

22/01/2004

Fernandopastore

DECLAREI NA: USES GAUGES IMPLEMENTEI O CODIGO , MAS O DELPHI DA COMO INDECLERED IDENTIFIER :´GAUGE1´ , COMO SE FOSSE UM COMPONENTE OU UMA VARIAVEL ?


Responder

Gostei + 0

22/01/2004

Nigro

remova a dedclaração e coloque o componente


Responder

Gostei + 0

22/01/2004

Danielclubedelphi

Pq vc naum dá um Delay ? as velhas funções do pascal prestam sim!
Olha só:

program ProjetoSEU;

uses
Forms,
Principal in ´Principal.pas´ ,
DataModule in ´DataModule.pas´ {dtmAPL: TDataModule},
VCLUtils,
Splash in ´Splash.pas´ ,
{$R *.res}

begin

frmSplash := TfrmSplash.Create(Application);
frmSplash.Show;
frmSplash.Refresh;

Application.Initialize;
Application.CreateForm(TfrmPrincipal, frmPrincipal);
Application.CreateForm(TdtmAPL, dtmAPL);

try
Delay(100);
finally
StopWait;
end;

frmSplash.Free;
Application.Run;

End.


Responder

Gostei + 0

22/01/2004

Fernandopastore

OBRIGADO , MEU PRIMEIRO PROJETO EM DELPHI ESTA TERMINADO E APROVADO


Responder

Gostei + 0

22/01/2004

Paulo_amorim

Olá

A primeira vez que testei o Splash foi em um programinha bobo, que eu fiz soh pra teste emsmo...

eu usei
while Application.ProcessMessages

ele ficou por uns segundos...isso eh bom?ruim?
Obrigado

Até+


Responder

Gostei + 0

24/01/2004

Bilatto

8) Aqui mesmo no Clube Delphi, tem uma matéria sobre isso
Um abraço.


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar