Tradução de Softwere por um ComBobox?

20/01/2013

0

Olá a todos da DevMedia eu to com um problema na minha aplicação que é a seguinte:
eu tenho uma form que se chama "UnitIdiomas"
e nela que tem um list box que no evento do Oncreat ele pega todos os INIs que esta na pasta "Idiomas" do meu programa , ai ele joga eles no listbox ai com o DbClick eu carrego a tradução , mas eu não quero mais assim na form principal (UnitPrincipal) eu coloquei um TComboBox para Fazer a tradução , mas como eu faço isso?

Minha UnitIdiomas Ela e assim :


[img]http://img811.imageshack.us/img811/866/imagemhhe.png[/img]

Codigo:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

unit UnitIdiomas;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TFormIdiomas = class(TForm)
ListBox1: TListBox;
procedure FormShow(Sender: TObject);
procedure ListBox1DblClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
FormIdiomas: TFormIdiomas;

implementation

{$R *.dfm}

Uses
UnitPrincipal,
UnitStrings,
UnitConexao;

function FileSearch(const PathName, FileName : string; const InDir : boolean): string;
var
Rec: TSearchRec;
Path, Tempdir: string;
tamanho: int64;
Tipo, FileDate: string;
begin
path := PathName;

if copy(path, 1, pos(''?'', path) - 1) = ''ALL'' then
begin
Tempdir := path;
delete(tempdir, 1, pos(''?'', Tempdir));
while pos(''?'', Tempdir) > 0 do
begin
sleep(50);
try
FileSearch(copy(Tempdir, 1, pos(''?'', Tempdir) - 1), FileName, TRUE);
except
end;
delete(tempdir, 1, pos(''?'', Tempdir));
end;
exit;
end;

if path[length(path)] <then> 3 then // porque c:\ tem tamanho 3 hehe
Result := Result + Path + Rec.Name + ''|'';

until FindNext(Rec) <> 0;
finally
SysUtils.FindClose(Rec);
end;

If not InDir then Exit;

if FindFirst(Path + ''*.*'', faDirectory, Rec) = 0 then
try
repeat
if ((Rec.Attr and faDirectory) <> 0) and (Rec.Name <> ''.'') and (Rec.Name <> ''..'') then
result := result + FileSearch(Path + Rec.Name, FileName, True);
until FindNext(Rec) <> 0;
finally
SysUtils.FindClose(Rec);
end;
end;

procedure TFormIdiomas.FormShow(Sender: TObject);
var
TempStr: string;
begin
ListBox1.Clear;
Caption := traduzidos[398];
TempStr := FileSearch(extractfilepath(paramstr(0)) + ''language'', ''*.ini'', false);
if TempStr = '''' then exit;
while TempStr <> '''' do
begin
ListBox1.Items.Add(extractfilename(copy(Tempstr, 1, pos(''|'', tempstr) - 1)));
delete(tempstr, 1, pos(''|'', tempstr));
end;
end;

procedure TFormIdiomas.ListBox1DblClick(Sender: TObject);
var
TempStr, TempPorts: string;
i: integer;
begin
if listbox1.ItemIndex < 0 then exit;
TempStr := extractfilepath(paramstr(0)) + ''language\'' + listbox1.Items.Strings[listbox1.ItemIndex];
if fileexists(TempStr) = true then
begin
languagefile := TempStr;
LerStrings(languagefile);

FormPrincipal.AtualizarStringsTraduzidas;

for i := 1 to 65535 do
if PortasAtivas[i] <> 0 then TempPorts := TempPorts + ''('' + inttostr(i) + '')'' + '' '';
FormPrincipal.Statusbar1.Panels.Items[1].Text := traduzidos[19] + '': '' + TempPorts;

close;
end;
end;

end.
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------

Será que tinha como??
Foxxer Fullz

Foxxer Fullz

Responder

Posts

21/01/2013

Foxxer Fullz

UP,!
Responder

23/01/2013

Foxxer Fullz

Up.!
Responder

25/01/2013

Foxxer Fullz

UP...!
Responder

Assista grátis a nossa aula inaugural

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

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

Aceitar