-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfrmLocalizePluginForm.pas
63 lines (54 loc) · 1.49 KB
/
frmLocalizePluginForm.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
unit frmLocalizePluginForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, CheckLst;
type
TfrmLocalizePlugin = class(TForm)
gbTranslation: TGroupBox;
cbTranslation: TCheckBox;
Label1: TLabel;
clbFrom: TCheckListBox;
Label2: TLabel;
Label3: TLabel;
clbTo: TCheckListBox;
btnOK: TButton;
btnCancel: TButton;
procedure cbTranslationClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmLocalizePlugin: TfrmLocalizePlugin;
implementation
{$R *.dfm}
procedure TfrmLocalizePlugin.cbTranslationClick(Sender: TObject);
begin
gbTranslation.Enabled := cbTranslation.Checked;
end;
procedure TfrmLocalizePlugin.FormClose(Sender: TObject;
var Action: TCloseAction);
var
i, j: integer;
begin
if cbTranslation.Checked then begin
j := 0;
for i := 0 to Pred(clbFrom.Count) do begin
if clbFrom.Checked[i] and clbTo.Checked[i] then begin
MessageBox(0, PChar('Translation files should not match'), 'Error', 0);
Action := caNone;
Exit;
end;
if clbFrom.Checked[i] then Inc(j);
if clbTo.Checked[i] then Dec(j);
end;
if j <> 0 then begin
MessageBox(0, PChar('Translation files should come in pairs'), 'Error', 0);
Action := caNone;
end;
end;
end;
end.