home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / FMXWIN.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-17  |  2.2 KB  |  64 lines

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4.  
  5. #include "fmxwin.h"
  6. //---------------------------------------------------------------------------
  7. #pragma resource "*.dfm"
  8. TFMForm *FMForm;
  9. //---------------------------------------------------------------------------
  10. __fastcall TFMForm::TFMForm(TComponent* Owner)
  11.   : TForm(Owner)
  12. {
  13. }
  14. //---------------------------------------------------------------------------
  15. void __fastcall TFMForm::DirectoryPanelClick(TObject *Sender)
  16. {
  17.   
  18. }
  19. //---------------------------------------------------------------------
  20. void __fastcall TFMForm::FilePanelClick(TObject *Sender)
  21. {
  22.   
  23. }
  24. //---------------------------------------------------------------------
  25. void __fastcall TFMForm::DirectoryOutlineChange(TObject *Sender)
  26. {
  27.   FileList->Directory = DirectoryOutline->Directory;
  28.   DirectoryPanel->Caption = DirectoryOutline->Directory;
  29. }
  30. //---------------------------------------------------------------------
  31. void __fastcall TFMForm::DirectoryOutlineDragDrop(TObject *Sender,
  32.       TObject *Source, Integer X, Integer Y)
  33. {
  34.            ConfirmChange("Move", FileList->FileName, DirectoryOutline->Items[DirectoryOutline->GetItem(X, Y)]->FullPath);
  35. }
  36. //---------------------------------------------------------------------
  37. void __fastcall TFMForm::DirectoryOutlineDragOver(TObject *Sender,
  38.       TObject *Source, Integer X, Integer Y, TDragState State,
  39.       Boolean &Accept)
  40. {
  41.     Accept = True;
  42. }
  43. //---------------------------------------------------------------------
  44. void __fastcall TFMForm::ConfirmChange(const AnsiString ACaption, AnsiString FromFile, AnsiString ToFile)
  45. {
  46.     char temp[255];
  47.         sprintf(temp, "%s %s to %s?", ACaption, FromFile, ToFile);
  48.     //Format("%s %s to %s?", ACaption, FromFile, ToFile);
  49.  
  50.     Set<TMsgDlgBtn, 0, 8> temp_set;
  51.         temp_set << mbNo << mbYes;
  52.  
  53.   if (MessageDlg(temp, mtConfirmation, temp_set, 0) == mrYes)
  54.   {
  55.     if (ACaption == "Move")
  56.         MoveFile(FromFile.c_str(), ToFile.c_str());
  57.     else if (ACaption == "Copy")
  58.         CopyFile(FromFile.c_str(), ToFile.c_str(),False);
  59.     else if (ACaption == "Rename")
  60.         RenameFile(FromFile.c_str(), ToFile.c_str());
  61.     FileList->Update();
  62.   }
  63. }
  64.