WWW.DISSERS.RU


...
    !

Pages:     | 1 |   ...   | 6 | 7 ||

} //--------------------------------------------------------------------------- void fastcall TForm1::Button1Click(TObject *Sender) { OKBottomDlg=new TOKBottomDlg(Application,Edit1-Text.c_str(),file);

OKBottomDlg-ShowModal();

delete OKBottomDlg;

} //--------------------------------------------------------------------------- void fastcall TForm1::DriveComboBox1Change(TObject *Sender) { DirectoryListBox1-Drive = DriveComboBox1-Drive;

FileListBox1-Drive = DriveComboBox1-Drive;

FileListBox1-Directory = DirectoryListBox1-Directory;

Edit1-Text=DirectoryListBox1-Directory;

file=false;

} //--------------------------------------------------------------------------- void fastcall TForm1::DirectoryListBox1Change(TObject *Sender) { DirectoryListBox1-Drive = DriveComboBox1-Drive;

FileListBox1-Drive = DriveComboBox1-Drive;

FileListBox1-Directory = DirectoryListBox1-Directory;

Edit1-Text=DirectoryListBox1-Directory;

file=false;

} //--------------------------------------------------------------------------- void fastcall TForm1::FileListBox1Change(TObject *Sender) { DirectoryListBox1-Drive = DriveComboBox1-Drive;

FileListBox1-Drive = DriveComboBox1-Drive;

FileListBox1-Directory = DirectoryListBox1-Directory;

Edit1-Text=FileListBox1-FileName;

file=true;

} //--------------------------------------------------------------------------- result.h - //---------------------------------------------------------------------------- #ifndef OCBH #define OCBH //---------------------------------------------------------------------------- #include

TButton *CancelBtn;

TListBox *ListBox1;

TLabel *Label1;

private:

char path[256];

TStringList *dirItem;

void scanDir(char *,TStringList *);

public:

virtual fastcall TOKBottomDlg(TComponent*,char *,bool);

};

//---------------------------------------------------------------------------- extern PACKAGE TOKBottomDlg *OKBottomDlg;

//---------------------------------------------------------------------------- #endif result.cpp - " " //--------------------------------------------------------------------- #include

//--------------------------------------------------------------------- fastcall TOKBottomDlg::TOKBottomDlg(TComponent* AOwner,char *ptr,bool file) : TForm(AOwner) { strcpy(path,ptr);

ListBox1-Items-BeginUpdate();

try { ListBox1-Items-Clear();

if(!file) { dirItem=new TStringList();

dirItem-Clear();

dirItem-Sorted = true;

scanDir(path,dirItem);

for(int i=0; i

} else /*********************************************************************** :

path, , . path -.

***********************************************************************/ ListBox1-Items-Add(path);

ListBox1-Items-EndUpdate();

} catch(...) { ListBox1-Items-EndUpdate();

throw;

} } //--------------------------------------------------------------------- void TOKBottomDlg::scanDir(char *path,TStringList *dirItem) { int err,count;

ffblk fileInfo;

char buf[1024];

if(path[strlen(path)-1]!='\\') strcat(path,"\\");

strcpy(buf,path);

count=strlen(buf);

strcat(path,"*");

err = findfirst(path,&fileInfo,FA_DIREC);

while (!err) { if(strcmp(fileInfo.ff_name,".") && strcmp(fileInfo.ff_name,"..")) { strcat(buf,fileInfo.ff_name);

if(fileInfo.ff_attrib==FA_DIREC) scanDir(buf,dirItem);

else /*********************************************************************** :

buf, , . buf -.

***********************************************************************/ dirItem-Add(buf);

buf[count]='\0';

} err = findnext(&fileInfo);

} findclose(&fileInfo);

} //------------------------------------------------------------------------------------------------------------ ...................................................................................................................................................... 1 .................................................................................................................. 1.1 1.2 - ................................................................. 1.3 ................................................................................. 1.4 .................................................................................................................................................... 2 ..................................... 2.1 ...................................................................... 2.2 () ............. 2.3 ........................................... 2.4 ........................................ 2.5 () ......................................................................... 2.6 .............................................................................................. 2.7 ................................................................................................ 3 .................................................. 3.1 3.2 4 ...................................................................................................................................................... 5 .................................................................................................................................... 1.................................................................................................................................................. 2..................................................................................................................................................

Pages:     | 1 |   ...   | 6 | 7 ||



2011 www.dissers.ru -

, .
, , , , 1-2 .