unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, dwsLocalizer;
type
TForm1 =
class(TForm)
Name: TLabel;
Edit1: TEdit;
Label2: TLabel;
Button1: TButton;
ListBox1: TListBox;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
procedure ListBox1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
resourcestring
StrProgrammWirklichBeenden = '
Programm wirklich beenden?';
StrProgrammNichtZuBeenden = '
Sie wollen also weiter machen.';
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Label2.Caption:= '
Hallo ' + Edit1.Text;
end;
procedure TForm1.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
if MessageDlg(StrProgrammWirklichBeenden, mtConfirmation, mbYesNo, 0, mbNo) = mrYes
then
canClose:= TRUE
else begin
canClose:= False;
//Nur zu Testzwecken; ohne irgendeinen Sinn ausser den die Buttons alle zu sehen/testen
if MessageDlg(StrProgrammNichtZuBeenden, mtConfirmation, [mbYes, mbNo, mbCancel, mbOK, mbHelp], 0, mbOk) = mrYes
then {};
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
GetLocalizer.ResourceFolder:= IncludeTrailingPathDelimiter(ExtractFilePath(Application.ExeName)) + '
Languages';
GetLocalizer.GetLanguages(ListBox1.Items);
GetLocalizer.LoadSystemLanguage(LANG_ENGLISH);
end;
procedure TForm1.ListBox1Click(Sender: TObject);
begin
if Listbox1.Items.Count >0
then
begin
GetLocalizer.InitializeLanguage(integer(Listbox1.Items.Objects[Listbox1.ItemIndex]));
end;
end;
end.