-
Notifications
You must be signed in to change notification settings - Fork 0
/
UnitDirectory.pas
54 lines (43 loc) · 1.12 KB
/
UnitDirectory.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
unit UnitDirectory;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, FileCtrl, Buttons, inifiles;
type
TForm2 = class(TForm)
DriveComboBox1: TDriveComboBox;
DirectoryListBox1: TDirectoryListBox;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
//cfg: TIniFIle;
implementation
uses UnitMain;
{$R *.dfm}
procedure TForm2.BitBtn2Click(Sender: TObject);
begin
Close;
end;
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
cfg.WriteString('system', 'diretory', DirectoryListBox1.Directory+'\');
Form1.Label1.Caption:=DirectoryListBox1.Directory+'\';
close;
end;
procedure TForm2.FormCreate(Sender: TObject);
begin
if DirectoryExists(cfg.ReadString('system', 'diretory', 'c:')) then
DirectoryListBox1.Directory:=cfg.ReadString('system', 'diretory', 'c:')
else
DirectoryListBox1.Directory:='c:';
end;
end.