home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / DIROUTX.CPP < prev    next >
C/C++ Source or Header  |  1997-01-16  |  2KB  |  49 lines

  1. //----------------------------------------------------------------------------
  2. //Borland C++ Builder
  3. //Copyright (c) 1987 Borland International Inc. All Rights Reserved.
  4. //----------------------------------------------------------------------------
  5. //---------------------------------------------------------------------------
  6. #include <vcl\vcl.h>
  7. #pragma hdrstop
  8.  
  9. #include "diroutx.h"
  10. //---------------------------------------------------------------------------
  11. #pragma resource "*.dfm"
  12. TForm1 *Form1;
  13. //---------------------------------------------------------------------------
  14. __fastcall TForm1::TForm1(TComponent* Owner)
  15.   : TForm(Owner)
  16. {
  17. }
  18. //---------------------------------------------------------------------------
  19. void __fastcall TForm1::DirectoryOutline1Change(TObject *Sender)
  20. {
  21.     FileListBox1->Directory=DirectoryOutline1->Directory;  
  22. }
  23. //---------------------------------------------------------------------
  24. void __fastcall TForm1::DriveComboBox1Change(TObject *Sender)
  25. {
  26.     DirectoryOutline1->Drive=DriveComboBox1->Drive;  
  27. }
  28. //---------------------------------------------------------------------
  29. void __fastcall TForm1::Edit1Change(TObject *Sender)
  30. {
  31.     FileListBox1->Mask=Edit1->Text;  
  32. }
  33. //---------------------------------------------------------------------
  34. void __fastcall TForm1::FileListBox1Change(TObject *Sender)
  35. {
  36.     // put some data in the memo
  37.     const int size=1024;
  38.     char buffer[size];
  39.     memset(buffer,0,size);
  40.     HFILE file=_lopen(FileListBox1->FileName.c_str(),OF_READ);
  41.     if (file!=NULL) _lread(file,buffer,size);
  42.     // nulls will terminate this too soon, so we will
  43.     // replace them with '.'
  44.     for (int i=0;i<1023;i++) if (buffer[i]==0) buffer[i]='.';
  45.     Memo1->Text=AnsiString(buffer);
  46.     _lclose(file);
  47. }
  48. //---------------------------------------------------------------------
  49.