home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
-
- #include "fmxwin.h"
- //---------------------------------------------------------------------------
- #pragma resource "*.dfm"
- TFMForm *FMForm;
- //---------------------------------------------------------------------------
- __fastcall TFMForm::TFMForm(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TFMForm::DirectoryPanelClick(TObject *Sender)
- {
-
- }
- //---------------------------------------------------------------------
- void __fastcall TFMForm::FilePanelClick(TObject *Sender)
- {
-
- }
- //---------------------------------------------------------------------
- void __fastcall TFMForm::DirectoryOutlineChange(TObject *Sender)
- {
- FileList->Directory = DirectoryOutline->Directory;
- DirectoryPanel->Caption = DirectoryOutline->Directory;
- }
- //---------------------------------------------------------------------
- void __fastcall TFMForm::DirectoryOutlineDragDrop(TObject *Sender,
- TObject *Source, Integer X, Integer Y)
- {
- ConfirmChange("Move", FileList->FileName, DirectoryOutline->Items[DirectoryOutline->GetItem(X, Y)]->FullPath);
- }
- //---------------------------------------------------------------------
- void __fastcall TFMForm::DirectoryOutlineDragOver(TObject *Sender,
- TObject *Source, Integer X, Integer Y, TDragState State,
- Boolean &Accept)
- {
- Accept = True;
- }
- //---------------------------------------------------------------------
- void __fastcall TFMForm::ConfirmChange(const AnsiString ACaption, AnsiString FromFile, AnsiString ToFile)
- {
- char temp[255];
- sprintf(temp, "%s %s to %s?", ACaption, FromFile, ToFile);
- //Format("%s %s to %s?", ACaption, FromFile, ToFile);
-
- Set<TMsgDlgBtn, 0, 8> temp_set;
- temp_set << mbNo << mbYes;
-
- if (MessageDlg(temp, mtConfirmation, temp_set, 0) == mrYes)
- {
- if (ACaption == "Move")
- MoveFile(FromFile.c_str(), ToFile.c_str());
- else if (ACaption == "Copy")
- CopyFile(FromFile.c_str(), ToFile.c_str(),False);
- else if (ACaption == "Rename")
- RenameFile(FromFile.c_str(), ToFile.c_str());
- FileList->Update();
- }
- }
-