source: cprs/branches/tmg-cprs/CPRS-Chart/fSignItem.pas@ 568

Last change on this file since 568 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 2.3 KB
Line 
1//kt -- Modified with SourceScanner on 8/7/2007
2unit fSignItem;
3
4interface
5
6uses
7 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
8 StdCtrls, ORFn, rCore, Hash, ORCtrls, DKLang;
9
10type
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
31procedure SignatureForItem(FontSize: Integer; const AText, ACaption: string; var ESCode: string);
32
33implementation
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
41procedure TfrmSignItem.SetupVars;
42//kt Added entire function to replace constant declarations 8/7/2007
43begin
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');
46end;
47
48procedure SignatureForItem(FontSize: Integer; const AText, ACaption: string; var ESCode: string);
49var
50 frmSignItem: TfrmSignItem;
51begin
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;
66end;
67
68procedure TfrmSignItem.cmdOKClick(Sender: TObject);
69begin
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;
80end;
81
82procedure TfrmSignItem.cmdCancelClick(Sender: TObject);
83begin
84 FESCode := '';
85 Close;
86end;
87
88end.
Note: See TracBrowser for help on using the repository browser.