-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZAPISZ.CPP
71 lines (57 loc) · 1.62 KB
/
ZAPISZ.CPP
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
//---------------------------------------------------------------------------
#include <vcl.h>
#include "wspolne.h"
#pragma hdrstop
#include "zapisz.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
AnsiString FileName;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::BitBtn2Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void init2()
{
if (!DirectoryExists(KATALOG))
CreateDir(KATALOG);
Form2->ListBox1->Items->Clear();
TSearchRec sr;
ChDir(KATALOG);
if (FindFirst("*.puz", faAnyFile, sr) == 0)
{
do
{
if ((sr.Attr & faDirectory) != sr.Attr)
Form2->ListBox1->Items->Add(ExtractFileName(sr.Name));
} while (FindNext(sr) == 0);
FindClose(sr);
}
ChDir("..");
}
void __fastcall TForm2::FormActivate(TObject *Sender)
{
init2();
FileName = "";
Edit1->Text="";
}
//---------------------------------------------------------------------------
void __fastcall TForm2::BitBtn1Click(TObject *Sender)
{
FileName = Edit1->Text;
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::ListBox1Click(TObject *Sender)
{
Edit1->Text = ListBox1->Items->Strings[ListBox1->ItemIndex];
}
//---------------------------------------------------------------------------