-
Notifications
You must be signed in to change notification settings - Fork 1
/
frm_selectsets.pas
57 lines (48 loc) · 1.06 KB
/
frm_selectsets.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
unit frm_selectsets;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, CheckLst;
type
TSelectSetsForm = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Button1: TButton;
Button2: TButton;
Panel3: TPanel;
CheckListBox1: TCheckListBox;
private
{ Private declarations }
public
{ Public declarations }
end;
function SelectSets(const lst: TStringList): boolean;
implementation
{$R *.dfm}
function SelectSets(const lst: TStringList): boolean;
var
f: TSelectSetsForm;
i,j: integer;
begin
result := false;
f := TSelectSetsForm.Create(nil);
try
f.CheckListBox1.Items.Clear;
f.CheckListBox1.Items.AddStrings(lst);
f.ShowModal;
if f.ModalResult = mrOK then
begin
lst.Clear;
j:= 0;
for i := 0 to f.CheckListBox1.Items.Count - 1 do
if f.CheckListBox1.Checked[i] then begin
lst.Add(f.CheckListBox1.Items.Strings[i]);
j:= j 1;
end;
result := j > 0;
end;
finally
f.Free;
end;
end;
end.