-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSelectStorage.pas
70 lines (59 loc) · 1.71 KB
/
SelectStorage.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
64
65
66
67
68
69
70
unit SelectStorage;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, SBCustomCertStorage, SBWinCertStorage, ComCtrls;
type
TStorageSelectForm = class(TForm)
lblSelectStorage: TLabel;
btnOk: TButton;
treeStorage: TTreeView;
btnCancel: TButton;
procedure btnOkClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
StorageSelectForm: TStorageSelectForm;
implementation
uses frmMain;
{$R *.DFM}
procedure TStorageSelectForm.btnOkClick(Sender: TObject);
begin
if (treeStorage.Selected <> nil) and (treeStorage.Selected.Data <> nil) then
begin
ModalResult := mrOk;
end
else
ShowMessage('Storage is not selected');
end;
procedure TStorageSelectForm.FormActivate(Sender: TObject);
var I, J : integer;
begin
with treeStorage do
begin
Items.Clear;
Items.Add(nil, 'Storages');
Items.AddChild(Items[0], 'Windows Storages');
Items.AddChild(Items[0], 'File Storages');
Items.AddChild(Items[0], 'Memory Storages');
for I := 0 to 2 do
for J := 0 to SertX509.treeCert.Items[0].Item[I].Count - 1 do
Items.AddChildObject(Items[0].Item[I],
SertX509.treeCert.Items[0].Item[I].Item[J].Text,
SertX509.treeCert.Items[0].Item[I].Item[J].Data);
end;
end;
procedure TStorageSelectForm.btnCancelClick(Sender: TObject);
begin
if MessageDlg('Are you sure you want to cancel operation?',
mtConfirmation, [mbYes, mbNo], 0) = mrYes then
begin
ModalResult := mrCancel;
end;
end;
end.