Файловый менеджер — страница 9

  • Просмотров 5773
  • Скачиваний 369
  • Размер файла 963
    Кб

Form1->LabelCurrentPathRight->Color=0x00C4C4C4; Form1->ListDevicesRight->Color=0x00C4C4C4; Form1->FileListRight->Color=0x00C4C4C4; } //--------------------------------------------------------------------------- void __fastcall TForm1::ListDevicesRightEnter(TObject *Sender) { Form1->LabelCurrentPathRight->Color=0x00E9E9E9; Form1->ListDevicesRight->Color=0x00E9E9E9; Form1->FileListRight->Color=clGradientInactiveCaption; Form1->LabelCurrentPathLeft->Color=0x00C4C4C4; Form1->ListDevicesLeft->Color=0x00C4C4C4; Form1->FileListLeft->Color=0x00C4C4C4; } //--------------------------------------------------------------------------- void __fastcall TForm1::bCreateDirClick(TObject *Sender) { FormDialogCreateDir->Show(); }

//--------------------------------------------------------------------------- void __fastcall TForm1::bDeleteClick(TObject *Sender) { FormDialogDelete->Show(); FormDialogDelete->bRecycler->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TForm1::bCopyClick(TObject *Sender) { CopyOrRemove(Panel,FO_COPY); } //--------------------------------------------------------------------------- void __fastcall TForm1::bRemoveClick(TObject *Sender) { CopyOrRemove(Panel,FO_MOVE); } //--------------------------------------------------------------------------- void __fastcall TForm1::FileListLeftKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { switch (Key) { case 13: DirSel=0;

CurrentPathLeft=HandlerOfOpen(RootDirLeft, LEFT, DirSel); break; case 116: CopyOrRemove(Panel,FO_COPY); break; case 117: CopyOrRemove(Panel,FO_MOVE); break; case 118: FormDialogCreateDir->Show(); break; case 119: FormDialogDelete->Show(); FormDialogDelete->bRecycler->SetFocus(); break; } } //--------------------------------------------------------------------------- void __fastcall TForm1::FileListRightKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { switch (Key) { case 13: DirSel=0; CurrentPathRight=HandlerOfOpen(RootDirRight, RIGHT, DirSel); break; case 116: CopyOrRemove(Panel,FO_COPY); break; case 117: CopyOrRemove(Panel,FO_MOVE); break; case 118: FormDialogCreateDir->Show(); break; case 119: FormDialogDelete->Show();

FormDialogDelete->bRecycler->SetFocus(); break; } } //--------------------------------------------------------------------------- void __fastcall TForm1::bCurrentRootDirLeftClick(TObject *Sender) { DirSel=2; CurrentPathLeft=HandlerOfOpen(RootDirLeft, LEFT, DirSel); Form1->FileListLeft->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TForm1::bCurrentRootDirRightClick(TObject *Sender) { DirSel=2; CurrentPathRight=HandlerOfOpen(RootDirRight, RIGHT, DirSel); Form1->FileListRight->SetFocus(); } //--------------------------------------------------------------------------- Unit2.h //--------------------------------------------------------------------------- #ifndef Unit2H #define Unit2H

//--------------------------------------------------------------------------- #endif #define LEFT 1 #define RIGHT 0 #define FO_DELETER 5 extern int DirSel; extern AnsiString RootDirLeft,RootDirRight; extern AnsiString CurrentPathLeft,CurrentPathRight; extern int Panel; void CreateDirAttribSet(); AnsiString HandlerOfOpen(AnsiString RootDir, int Panel, int DirSel); void CreateListOfDevices(); bool CreateFolder(int Panel); void Deleting(int Panel, int Operation); void CopyOrRemove(int Panel, int Operation); Unit2.c //--------------------------------------------------------------------------- #pragma hdrstop #include "Unit1.h" #include "Unit3.h" #include <winbase.h> #include <_str.h> #include <stdlib.h> #include <system.hpp> #include

<shellapi.h> #include <winnt.h> #include <deque.h> #include <set.h> //--------------------------------------------------------------------------- #pragma package(smart_init) //--------------------------------------------------------------------------- int DirSel=0;// Признак совершения выбора в ListDevices AnsiString RootDirLeft,RootDirRight;// Текущая корневая директория AnsiString CurrentPathLeft,CurrentPathRight;// Текущий путь int Panel=LEFT; struct _FileProperty //Структура вывода { char FileAttrib[12]; // атрибуты файла char CreateTime[25]; // время создания файла char AccessTime[25]; // время доступа char WriteTime[25]; // время