Last change
on this file since 1591 was 459, checked in by Kevin Toppenberg, 16 years ago |
Adding foia-cprs branch
|
File size:
1.6 KB
|
Rev | Line | |
---|
[459] | 1 | unit fSignItem;
|
---|
| 2 |
|
---|
| 3 | interface
|
---|
| 4 |
|
---|
| 5 | uses
|
---|
| 6 | Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
---|
| 7 | StdCtrls, ORFn, rCore, Hash, ORCtrls;
|
---|
| 8 |
|
---|
| 9 | type
|
---|
| 10 | TfrmSignItem = class(TForm)
|
---|
| 11 | txtESCode: TCaptionEdit;
|
---|
| 12 | lblESCode: TLabel;
|
---|
| 13 | cmdOK: TButton;
|
---|
| 14 | cmdCancel: TButton;
|
---|
| 15 | lblText: TMemo;
|
---|
| 16 | procedure cmdOKClick(Sender: TObject);
|
---|
| 17 | procedure cmdCancelClick(Sender: TObject);
|
---|
| 18 | private
|
---|
| 19 | FESCode: string;
|
---|
| 20 | public
|
---|
| 21 | { Public declarations }
|
---|
| 22 | end;
|
---|
| 23 |
|
---|
| 24 | procedure SignatureForItem(FontSize: Integer; const AText, ACaption: string; var ESCode: string);
|
---|
| 25 |
|
---|
| 26 | implementation
|
---|
| 27 |
|
---|
| 28 | {$R *.DFM}
|
---|
| 29 |
|
---|
| 30 | const
|
---|
| 31 | TX_INVAL_MSG = 'Not a valid electronic signature code. Enter a valid code or press Cancel.';
|
---|
| 32 | TX_INVAL_CAP = 'Unrecognized Signature Code';
|
---|
| 33 |
|
---|
| 34 | procedure SignatureForItem(FontSize: Integer; const AText, ACaption: string; var ESCode: string);
|
---|
| 35 | var
|
---|
| 36 | frmSignItem: TfrmSignItem;
|
---|
| 37 | begin
|
---|
| 38 | frmSignItem := TfrmSignItem.Create(Application);
|
---|
| 39 | try
|
---|
| 40 | ResizeAnchoredFormToFont(frmSignItem);
|
---|
| 41 | with frmSignItem do
|
---|
| 42 | begin
|
---|
| 43 | FESCode := '';
|
---|
| 44 | Caption := ACaption;
|
---|
| 45 | lblText.Text := AText;
|
---|
| 46 | ShowModal;
|
---|
| 47 | ESCode := FESCode;
|
---|
| 48 | end;
|
---|
| 49 | finally
|
---|
| 50 | frmSignItem.Release;
|
---|
| 51 | end;
|
---|
| 52 | end;
|
---|
| 53 |
|
---|
| 54 | procedure TfrmSignItem.cmdOKClick(Sender: TObject);
|
---|
| 55 | begin
|
---|
| 56 | if not ValidESCode(txtESCode.Text) then
|
---|
| 57 | begin
|
---|
| 58 | InfoBox(TX_INVAL_MSG, TX_INVAL_CAP, MB_OK);
|
---|
| 59 | txtESCode.SetFocus;
|
---|
| 60 | txtESCode.SelectAll;
|
---|
| 61 | Exit;
|
---|
| 62 | end;
|
---|
| 63 | FESCode := Encrypt(txtESCode.Text);
|
---|
| 64 | Close;
|
---|
| 65 | end;
|
---|
| 66 |
|
---|
| 67 | procedure TfrmSignItem.cmdCancelClick(Sender: TObject);
|
---|
| 68 | begin
|
---|
| 69 | FESCode := '';
|
---|
| 70 | Close;
|
---|
| 71 | end;
|
---|
| 72 |
|
---|
| 73 | end.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.