| Line | |
|---|
| 1 | unit UMainForm;
|
|---|
| 2 |
|
|---|
| 3 | {$mode objfpc}{$H+}
|
|---|
| 4 |
|
|---|
| 5 | interface
|
|---|
| 6 |
|
|---|
| 7 | uses
|
|---|
| 8 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
|---|
| 9 | UCoolTranslator, ULanguages;
|
|---|
| 10 |
|
|---|
| 11 | type
|
|---|
| 12 |
|
|---|
| 13 | { TMainForm }
|
|---|
| 14 |
|
|---|
| 15 | TMainForm = class(TForm)
|
|---|
| 16 | Button1: TButton;
|
|---|
| 17 | CoolTranslator1: TCoolTranslator;
|
|---|
| 18 | Label1: TLabel;
|
|---|
| 19 | Label2: TLabel;
|
|---|
| 20 | Label3: TLabel;
|
|---|
| 21 | Label4: TLabel;
|
|---|
| 22 | ListBox1: TListBox;
|
|---|
| 23 | ListBox2: TListBox;
|
|---|
| 24 | procedure Button1Click(Sender: TObject);
|
|---|
| 25 | procedure FormCreate(Sender: TObject);
|
|---|
| 26 | procedure ListBox1SelectionChange(Sender: TObject; User: boolean);
|
|---|
| 27 | private
|
|---|
| 28 | { private declarations }
|
|---|
| 29 | public
|
|---|
| 30 | { public declarations }
|
|---|
| 31 | end;
|
|---|
| 32 |
|
|---|
| 33 | var
|
|---|
| 34 | MainForm: TMainForm;
|
|---|
| 35 |
|
|---|
| 36 | implementation
|
|---|
| 37 |
|
|---|
| 38 | resourcestring
|
|---|
| 39 | STranslatedText = 'Text stored in resourcestring';
|
|---|
| 40 |
|
|---|
| 41 | {$R *.lfm}
|
|---|
| 42 |
|
|---|
| 43 | { TMainForm }
|
|---|
| 44 |
|
|---|
| 45 | procedure TMainForm.FormCreate(Sender: TObject);
|
|---|
| 46 | begin
|
|---|
| 47 | CoolTranslator1.LanguageListToStrings(ListBox1.Items);
|
|---|
| 48 | CoolTranslator1.ComponentExcludes.DumpToStrings(ListBox2.Items);
|
|---|
| 49 | end;
|
|---|
| 50 |
|
|---|
| 51 | procedure TMainForm.Button1Click(Sender: TObject);
|
|---|
| 52 | begin
|
|---|
| 53 | ShowMessage(MainForm.Name);
|
|---|
| 54 | end;
|
|---|
| 55 |
|
|---|
| 56 | procedure TMainForm.ListBox1SelectionChange(Sender: TObject; User: boolean);
|
|---|
| 57 | begin
|
|---|
| 58 | if ListBox1.ItemIndex <> - 1 then
|
|---|
| 59 | with CoolTranslator1 do
|
|---|
| 60 | Language := TLanguage(ListBox1.Items.Objects[ListBox1.ItemIndex]);
|
|---|
| 61 | end;
|
|---|
| 62 |
|
|---|
| 63 | end.
|
|---|
| 64 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.