-
Notifications
You must be signed in to change notification settings - Fork 0
/
LADUJ.CPP
75 lines (59 loc) · 1.67 KB
/
LADUJ.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
69
70
71
72
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "wspolne.h"
#include "laduj.h"
#include <Filectrl.hpp>
//#include <sysutils.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm3 *Form3;
AnsiString Filename="domyslny";
//---------------------------------------------------------------------------
__fastcall TForm3::TForm3(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm3::BitBtn2Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void init()
{
if (!DirectoryExists(KATALOG))
CreateDir(KATALOG);
Form3->ListBox1->Items->Clear();
TSearchRec sr;
ChDir(KATALOG);
if (FindFirst("*.puz", faAnyFile, sr) == 0)
{
do
{
if ((sr.Attr & faDirectory) != sr.Attr)
Form3->ListBox1->Items->Add(ExtractFileName(sr.Name));
} while (FindNext(sr) == 0);
FindClose(sr);
}
ChDir("..");
}
void __fastcall TForm3::FormActivate(TObject *Sender)
{
init();
Filename = "";
Edit1->Text="";
}
//---------------------------------------------------------------------------
void __fastcall TForm3::BitBtn1Click(TObject *Sender)
{
Filename = Edit1->Text;
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm3::ListBox1Click(TObject *Sender)
{
Edit1->Text = ListBox1->Items->Strings[ListBox1->ItemIndex];
}
//---------------------------------------------------------------------------