Compila, mas não funciona!
19/04/2013
0
Gostaria de saber o que mudar.
procurei no google e achei um pessoal falando pra usar Tpicture no lugar de TImage...
Já testei e continuou na mesma.
desde já agradeço as idéias que surgirem.
Obrigado!
****************************************************************************************
unit Uconexao;
interface
uses
Variants, Classes, Graphics, Controls, ExtCtrls, Windows, Messages, SysUtils, IniFiles, DB, IBCustomDataSet, Dialogs, IBQuery, IBDatabase,
DBClient, Provider, Usplashs, IBScript, forms;
type Tconexao = class
protected
public
constructor conectar(ib:TIBDataBase; T:TIBTransaction);
destructor fim;
procedure splash(); virtual;
end;
implementation
destructor tconexao.fim;
begin
end;
constructor tconexao.conectar (ib:TIBDataBase; T:TIBTransaction);
var ArquivoINI : TIniFile;
str_server,str_path,str_filename,str_protocol :string;
begin
splash();
try
ib.Connected:=false;
ArquivoINI := TIniFile.Create(ExtractFilePath(Application.ExeName)+ '\Config.ini');
str_server := ArquivoINI.ReadString('NET','SERVER','');
str_protocol := ArquivoINI.ReadString('NET','CONNECTION_PROTOCOL','');
str_path := ArquivoINI.ReadString('FIREBIRD','SERVER_PATH','');
str_filename := ArquivoINI.ReadString('FIREBIRD','FILE_NAME','');
if str_protocol = 'TCP/IP' then
ib.DatabaseName := str_server+':'+str_path+str_filename;
if str_protocol = 'NETBEUI' then
ib.DatabaseName := '\\'+str_server+'\'+str_path+str_filename;
if str_protocol = 'SPX' then
ib.DatabaseName := str_server+'@'+str_path+str_filename;
if str_protocol = 'LOCAL' then
ib.DatabaseName := str_path+str_filename;
ib.Connected:=true;
t.StartTransaction;
except
ShowMessage('Erro de conexão com o banco: ' + str_path + str_filename);
end;
end;
procedure tconexao.splash();
var
janela_splash : TForm;
imagem: TImage;
begin
inherited Create;
janela_splash := tform.create(nil);
imagem:= TImage.create(janela_splash);
janela_splash.Position:= poScreenCenter;
imagem.Stretch:=true;
imagem.Width:=300;
imagem.Height:=200;
imagem.picture.LoadFromFile(ExtractFilePath(Application.ExeName)+'\img\processandoinformacoes.bmp' );
imagem.Top:= 100;
imagem.Left:=100;
imagem.AutoSize:= true;
imagem.BringToFront;
imagem.Visible:=true;
janela_splash.Show;
sleep(1200);
end;
end.
Adib Valentim
Posts
19/04/2013
Rafael Cunha
janela_splash.Update
19/04/2013
Adib Valentim
22/04/2013
Joel Rodrigues
imagem.Parent := janela_splash;
Depois do Create.
Veja no que da.
22/04/2013
Adib Valentim
coloquei o seu parent, vi uma vídeo-aula no youtube que me abriu a cabeça pra umas coisas.
e por final trabalhei tudo de uma forma total com ---> with
ficou assim:
inherited Create;
janela_splash := tform.create(nil);
janela_splash.Position:= poScreenCenter;
imagem:= TImage.create(janela_splash);
janela_splash.Update;
janela_splash.Caption:= 'Futtura Softwares';
janela_splash.Show;
with imagem do begin
parent:= janela_splash;
Width:=300;
Height:=200;
Top:= 10;
Left:=10;
Picture.Bitmap.LoadFromFile(ExtractFilePath(Application.ExeName)+'img\processandoinformacoes.bmp' );
Update;
Stretch:=true;
AutoSize:= true;
BringToFront;
Visible:=true;
end;
imagem.Show;
sleep(1200);
----- e o vídeo que vi e falei : http://www.youtube.com/watch?v=UyDqH5wrhxg ------
22/04/2013
Adib Valentim
unit Uconexao;
interface
uses
Variants, Classes, Graphics, Controls, ExtCtrls, Windows, Messages, SysUtils, IniFiles, DB, IBCustomDataSet, Dialogs, IBQuery, IBDatabase,
DBClient, Provider, Usplashs, IBScript, forms;
type Tconexao = class
protected
public
constructor conectar(ib:TIBDataBase; T:TIBTransaction);
destructor fim;
procedure splash(); virtual;
end;
implementation
destructor tconexao.fim;
begin
end;
constructor tconexao.conectar (ib:TIBDataBase; T:TIBTransaction);
var ArquivoINI : TIniFile;
str_server,str_path,str_filename,str_protocol :string;
begin
splash();
try
ib.Connected:=false;
ArquivoINI := TIniFile.Create(ExtractFilePath(Application.ExeName)+ '\Config.ini');
str_server := ArquivoINI.ReadString('NET','SERVER','');
str_protocol := ArquivoINI.ReadString('NET','CONNECTION_PROTOCOL','');
str_path := ArquivoINI.ReadString('FIREBIRD','SERVER_PATH','');
str_filename := ArquivoINI.ReadString('FIREBIRD','FILE_NAME','');
if str_protocol = 'TCP/IP' then
ib.DatabaseName := str_server+':'+str_path+str_filename;
if str_protocol = 'NETBEUI' then
ib.DatabaseName := '\\'+str_server+'\'+str_path+str_filename;
if str_protocol = 'SPX' then
ib.DatabaseName := str_server+'@'+str_path+str_filename;
if str_protocol = 'LOCAL' then
ib.DatabaseName := str_path+str_filename;
ib.Connected:=true;
t.StartTransaction;
except
ShowMessage('Erro de conexão com o banco: ' + str_path + str_filename);
end;
end;
procedure tconexao.splash();
var
janela_splash : TForm;
imagem: TImage;
begin
inherited Create;
janela_splash := tform.create(nil);
janela_splash.Position:= poScreenCenter;
imagem:= TImage.create(janela_splash);
janela_splash.Update;
janela_splash.Caption:= 'Futtura Softwares';
janela_splash.Show;
with imagem do begin
parent:= janela_splash;
Width:=300;
Height:=200;
Top:= 10;
Left:=10;
Picture.LoadFromFile(ExtractFilePath(Application.ExeName)+'img\processandoinformacoes.bmp' );
Update;
Stretch:=true;
AutoSize:= true;
BringToFront;
Visible:=true;
end;
sleep(1200);
end;
end.
22/04/2013
Joel Rodrigues
Então estou marcando este tópico como Concluído
Clique aqui para fazer login e interagir na Comunidade :)