1 | //kt -- Modified with SourceScanner on 8/7/2007
|
---|
2 | unit fSignItem;
|
---|
3 |
|
---|
4 | interface
|
---|
5 |
|
---|
6 | uses
|
---|
7 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
8 | StdCtrls, ORFn, rCore, Hash, ORCtrls, DKLang;
|
---|
9 |
|
---|
10 | type
|
---|
11 | TfrmSignItem = class(TForm)
|
---|
12 | txtESCode: TCaptionEdit;
|
---|
13 | lblESCode: TLabel;
|
---|
14 | cmdOK: TButton;
|
---|
15 | cmdCancel: TButton;
|
---|
16 | lblText: TMemo;
|
---|
17 | DKLanguageController1: TDKLanguageController;
|
---|
18 | procedure cmdOKClick(Sender: TObject);
|
---|
19 | procedure cmdCancelClick(Sender: TObject);
|
---|
20 | private
|
---|
21 | //kt Begin Mod (change Consts to Vars) 8/7/2007
|
---|
22 | TX_INVAL_MSG : string; //kt
|
---|
23 | TX_INVAL_CAP : string; //kt
|
---|
24 | //kt End Mod -------------------
|
---|
25 | FESCode: string;
|
---|
26 | procedure SetupVars; //kt
|
---|
27 | public
|
---|
28 | { Public declarations }
|
---|
29 | end;
|
---|
30 |
|
---|
31 | procedure SignatureForItem(FontSize: Integer; const AText, ACaption: string; var ESCode: string);
|
---|
32 |
|
---|
33 | implementation
|
---|
34 |
|
---|
35 | {$R *.DFM}
|
---|
36 |
|
---|
37 | //const
|
---|
38 | //TX_INVAL_MSG = 'Not a valid electronic signature code. Enter a valid code or press Cancel.'; <-- original line. //kt 8/7/2007
|
---|
39 | //TX_INVAL_CAP = 'Unrecognized Signature Code'; <-- original line. //kt 8/7/2007
|
---|
40 |
|
---|
41 | procedure TfrmSignItem.SetupVars;
|
---|
42 | //kt Added entire function to replace constant declarations 8/7/2007
|
---|
43 | begin
|
---|
44 | TX_INVAL_MSG := DKLangConstW('fSignItem_Not_a_valid_electronic_signature_codex__Enter_a_valid_code_or_press_Cancelx');
|
---|
45 | TX_INVAL_CAP := DKLangConstW('fSignItem_Unrecognized_Signature_Code');
|
---|
46 | end;
|
---|
47 |
|
---|
48 | procedure SignatureForItem(FontSize: Integer; const AText, ACaption: string; var ESCode: string);
|
---|
49 | var
|
---|
50 | frmSignItem: TfrmSignItem;
|
---|
51 | begin
|
---|
52 | frmSignItem := TfrmSignItem.Create(Application);
|
---|
53 | try
|
---|
54 | ResizeAnchoredFormToFont(frmSignItem);
|
---|
55 | with frmSignItem do
|
---|
56 | begin
|
---|
57 | FESCode := '';
|
---|
58 | Caption := ACaption;
|
---|
59 | lblText.Text := AText;
|
---|
60 | ShowModal;
|
---|
61 | ESCode := FESCode;
|
---|
62 | end;
|
---|
63 | finally
|
---|
64 | frmSignItem.Release;
|
---|
65 | end;
|
---|
66 | end;
|
---|
67 |
|
---|
68 | procedure TfrmSignItem.cmdOKClick(Sender: TObject);
|
---|
69 | begin
|
---|
70 | SetupVars; //kt added 8/7/2007 to replace constants with vars.
|
---|
71 | if not ValidESCode(txtESCode.Text) then
|
---|
72 | begin
|
---|
73 | InfoBox(TX_INVAL_MSG, TX_INVAL_CAP, MB_OK);
|
---|
74 | txtESCode.SetFocus;
|
---|
75 | txtESCode.SelectAll;
|
---|
76 | Exit;
|
---|
77 | end;
|
---|
78 | FESCode := Encrypt(txtESCode.Text);
|
---|
79 | Close;
|
---|
80 | end;
|
---|
81 |
|
---|
82 | procedure TfrmSignItem.cmdCancelClick(Sender: TObject);
|
---|
83 | begin
|
---|
84 | FESCode := '';
|
---|
85 | Close;
|
---|
86 | end;
|
---|
87 |
|
---|
88 | end.
|
---|