//--------------------------------------------------------------------------- #include #include #include #include #include #include #include // 2001.4.11 By GreenFish #include // 2001.4.11 By GreenFish #include "Common.h" #pragma hdrstop #include "Main.h" #include "FileManager_F.h" #include "Exception.h" #include "MainImage.h" //2001.4.11. lhskys »õ·Î¿î MainMenu »ý¼º #if defined(TEXTILE) #include "Jacquard.h" //2001.7.26 lhskys Jacquard ¿¡¼­ ¹«Á¶°ÇÀúÀå ¹æÁö #endif #if defined(KNIT) //dog #include "FileSize_F.h" #endif //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" #pragma resource "FileIcon.res" #pragma resource "FileIcon2.res" //--------------------------------------------------------------------------- #define IDS_MFOLDER StringTable[0] #define IDS_FILETYPE StringTable[1] #define IDS_DIRECTORY StringTable[2] #define IDS_SEARCH StringTable[3] #define IDS_FILENAME StringTable[4] #define IDS_FOLDERNAME StringTable[5] #define IDS_LARGE StringTable[6] #define IDS_SMALL StringTable[7] #define IDS_LIST StringTable[8] #define IDS_REPORT StringTable[9] #define IDS_REPORT_NAME StringTable[10] #define IDS_REPORT_LAST StringTable[11] #define IDS_MAKE StringTable[12] #define IDS_FCAPTION StringTable[13] #define IDS_COMPRESSION StringTable[14] #define IDS_MESSAGE StringTable[15] #define IDS_PREVIEW StringTable[16] #define IDS_IMAGEPREVIEW StringTable[17] #define IDS_FLOAD StringTable[18] #define IDS_FLOADFULL StringTable[19] #define IDS_FCOPY StringTable[20] #define IDS_FCUT StringTable[21] #define IDS_FPASTE StringTable[22] #define IDS_FSAVE StringTable[23] #define IDS_FDELETE StringTable[24] #define IDS_FRENAME StringTable[25] #define IDS_FPREFERENCE StringTable[26] //--------------------------------------------------------------------------- __fastcall TFileManagerForm::TFileManagerForm(TComponent* Owner) : TForm(Owner) { //======================== 2001.3.27 lhskys FormCreate(TObject *Sender)³»¿ë ¿Å±è TIniFile *IniFile; int type; //=================================================================== StringTable.Create(DirectoryBin, Language, "FileManager"); SetSmallFont(Font); SetSmallFont(ListView->Font); SetSmallFont(DirectoryListBox->Font); FDrive = DriveComboBox->Drive; FDirectory = DirectoryListBox->Directory; FFilter = FilterComboBox->Filter; // FFilterIndex = FilterComboBox->ItemIndex; Caption = IDS_FCAPTION; SpeedButtonRead->Caption = IDS_COMMON_READ; SpeedButtonMerge->Caption = IDS_COMMON_MERGE; SpeedButtonSave->Caption = IDS_COMMON_SAVE; SpeedButtonSaveAs->Caption = IDS_COMMON_SAVEAS; SpeedButtonDelete->Caption = IDS_COMMON_DELETE; SpeedButtonMakeFolder->Caption = IDS_MFOLDER; SpeedButtonRename->Caption = IDS_COMMON_RENAME; SpeedButtonExit->Caption = IDS_COMMON_EXIT; Label1->Caption = IDS_COMMON_DRIVE; Label2->Caption = IDS_FILETYPE; Label3->Caption = IDS_DIRECTORY; ComboBoxView->Items->Clear(); ComboBoxView->Items->Add(IDS_LARGE); ComboBoxView->Items->Add(IDS_SMALL); ComboBoxView->Items->Add(IDS_LIST); ComboBoxView->Items->Add(IDS_REPORT); CompressCheckBox->Caption = IDS_COMPRESSION; //=================================================================== IniFile = new TIniFile(DirectoryItem + "\\Main.ini"); if (IniFile) { #ifdef TEXTILE //============================================ 2001.4.11. by lhskys congi¿¡¼­ Open ³Ö±â if(MainForm->FILEOPEN){ IniDirName = DirectoryTextileOpen; if(IniDirName == "")IniDirName = IniFile->ReadString("FileManager", "DirectoryName", "C:\\"); MainForm->FILEOPEN = false; }else IniDirName = IniFile->ReadString("FileManager", "DirectoryName", "C:\\"); // IniDirName = IniFile->ReadString("FileManager", "DirectoryName", "C:\\"); //=========================================== #else #ifndef WEAVE IniDirName = IniFile->ReadString("FileManager", "DirectoryName", "C:\\"); #endif #endif DirectoryIndex = IniFile->ReadInteger("FileManager", "DirectoryIndex", 0); Left = IniFile->ReadInteger("FileManager", "FormLeft", (Screen->Width-Width)>>1); Top = IniFile->ReadInteger("FileManager", "FormTop", (Screen->Height-Height)>>1); Width = IniFile->ReadInteger("FileManager", "FormWidth", Width); Height = IniFile->ReadInteger("FileManager", "FormHeight", Height); FFilterIndex = IniFile->ReadInteger("FileManager", "Filter", FilterComboBox->ItemIndex); type = IniFile->ReadInteger("FileManager", "ViewType", 0); delete IniFile; } FilterComboBox->ItemIndex = FFilterIndex; InitExt = FFilterIndex + 1; ExtIndex = TGraphicFileFormat(FilterComboBox->ItemIndex+1); StatusBar->Panels->Items[0]->Width = Splitter1->Left + 12; StatusBar->Panels->Items[2]->Width = 120; StatusBar->Panels->Items[1]->Width = StatusBar->Width - StatusBar->Panels->Items[0]->Width - StatusBar->Panels->Items[2]->Width; // InitItem(0); TListColumn *pColumn; pColumn = ListView->Columns->Add(); pColumn->Caption = IDS_REPORT_NAME; pColumn->Width = 300; pColumn = ListView->Columns->Add(); pColumn->Caption = IDS_COMMON_SIZE; pColumn->Width = 100; pColumn = ListView->Columns->Add(); pColumn->Caption = IDS_REPORT_LAST; pColumn->Width = 200; InitItem(0); ComboBoxView->ItemIndex = type; ComboBoxViewChange(this); switch (type) { case 0: ListView->ViewStyle = vsIcon; break; case 1: ListView->ViewStyle = vsSmallIcon; break; case 2: ListView->ViewStyle = vsList; break; case 3: ListView->ViewStyle = vsReport; } reading = false; Ascend[0] = false; Ascend[1] = false; Ascend[2] = false; #ifdef TEXTILE ListView->PopupMenu = PopupMenuTexFile; #else ListView->PopupMenu = PopupMenuFile; #endif if (SetCurrentDir(IniDirName) == false) { DirectoryListBox->Directory = "C:\\"; } //========================= #ifdef TEXTILE //============================= 2001.4.11. by lhskys congi¿¡¼­ Down °áÁ¤ if(Select == "MERGE" && MainForm->MDIChildCount > 0){ SpeedButtonMerge->Down = true; SpeedButtonMergeClick(this); }else if(Select == "READ"){ SpeedButtonRead->Down = true; SpeedButtonReadClick(this); }else if(MainForm->MDIChildCount == 0){ SpeedButtonRead->Down = true; SpeedButtonReadClick(this); } //============================= #endif } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::FormActivate(TObject *Sender) { TIniFile *IniFile; if (SetCurrentDir(IniDirName) == false) { DirectoryListBox->Directory = "C:\\"; } else { if (reading == false) { DirectoryListBox->Directory = IniDirName; DirectoryListBox->ItemIndex = DirectoryIndex; } } ChangeFunction(); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::FormCreate(TObject *Sender) { // } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::InitExtension() { switch (InitExt) { #if defined(TEXTILE) case gffTEX: FileListBox->Mask = "*.tex"; break; case gffBMP: FileListBox->Mask = "*.bmp"; break; case gffTIF: FileListBox->Mask = "*.tif"; break; #ifdef ACADEMY #else case gffTFC: FileListBox->Mask = "*.tfc"; break; case gffT3D: FileListBox->Mask = "*.t3d"; break; case gffN3D: FileListBox->Mask = "*.n3d"; break; case gffWEA: FileListBox->Mask = "*.wea"; break; case gffWAV: FileListBox->Mask = "*.wav"; break; case gffKNT: FileListBox->Mask = "*.knt"; break; case gffPCT: FileListBox->Mask = "*.pct"; break; case gffPCX: FileListBox->Mask = "*.pcx"; break; case gffPNG: FileListBox->Mask = "*.png"; break; case gffPSD: FileListBox->Mask = "*.psd"; break; case gffRAS: FileListBox->Mask = "*.ras"; break; case gffTGA: FileListBox->Mask = "*.tga"; break; #if defined(CARPET) case gffCPT: FileListBox->Mask = "*.cpt"; break; #else case gffJPG: FileListBox->Mask = "*.jpg"; break; case gffEPS: FileListBox->Mask = "*.eps"; break; // case gffGIF: FileListBox->Mask = "*.gif"; break; // by mecbong #endif #endif #elif defined(WEAVE) case gffWEA: FileListBox->Mask = "*.wea"; break; case gffWAV: FileListBox->Mask = "*.wav"; break; #elif defined(KNIT) case gffKNT: FileListBox->Mask = "*.knt"; break; case gffTEX: FileListBox->Mask = "*.tex"; break; #elif defined(PILE) case gffPIL: FileListBox->Mask = "*.pil"; break; #endif } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::FormDestroy(TObject *Sender) { TIniFile *IniFile; TTexVersion *ver; SmallImageList->Clear(); ExitData(); if (Version){ while(Version->Count > 0){ ver = (TTexVersion*)(Version->Last()); Version->Remove(ver); delete ver; } delete Version; Version = NULL; } IniFile = new TIniFile(DirectoryItem + "\\Main.ini"); if (IniFile) { #ifndef WEAVE IniFile->WriteString("FileManager", "DirectoryName", DirectoryListBox->Directory); #endif IniFile->WriteInteger("FileManager", "DirectoryIndex", DirectoryListBox->ItemIndex); IniFile->WriteInteger("FileManager", "FormLeft", Left); IniFile->WriteInteger("FileManager", "FormTop", Top); IniFile->WriteInteger("FileManager", "FormWidth", Width); IniFile->WriteInteger("FileManager", "FormHeight", Height); IniFile->WriteInteger("FileManager", "Filter", FilterComboBox->ItemIndex); IniFile->WriteInteger("FileManager", "ViewType", ComboBoxView->ItemIndex); delete IniFile; } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::FormResize(TObject *Sender) { int w = Panel1->Width / 8; SpeedButtonRead->Width = w; SpeedButtonMerge->Left = SpeedButtonRead->Left+w; SpeedButtonMerge->Width = w; SpeedButtonSave->Left = SpeedButtonMerge->Left+w; SpeedButtonSave->Width = w; SpeedButtonSaveAs->Left = SpeedButtonSave->Left+w; SpeedButtonSaveAs->Width = w; SpeedButtonDelete->Left = SpeedButtonSaveAs->Left+w; SpeedButtonDelete->Width = w; SpeedButtonRename->Left = SpeedButtonDelete->Left+w; SpeedButtonRename->Width = w; SpeedButtonMakeFolder->Left = SpeedButtonRename->Left+w; SpeedButtonMakeFolder->Width = w; SpeedButtonExit->Left = SpeedButtonMakeFolder->Left+w; SpeedButtonExit->Width = w; w = (Panel2->Width - (Label1->Width + Label2->Width + 20)) / 2; DriveComboBox->Width = w; FilterComboBox->Width = w; Label2->Left = DriveComboBox->Left + w; FilterComboBox->Left = Label2->Left + Label2->Width; LabelDirectory->Width = Panel3->Width-(LabelDirectory->Left+ComboBoxView->Width+16); ComboBoxView->Left = LabelDirectory->Left + LabelDirectory->Width; Edit4->Width = Panel4->Width - (Edit4->Left+SpeedButton4->Width+ProgressBar->Width+ CompressCheckBox->Width+16); ProgressBar->Left = Edit4->Left + Edit4->Width; SpeedButton4->Left = ProgressBar->Left + ProgressBar->Width; CompressCheckBox->Left = SpeedButton4->Left + SpeedButton4->Width; } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::FormShow(TObject *Sender) { Graphics::TBitmap *Bitmap; Bitmap = new Graphics::TBitmap; #if defined(TEXTILE) switch (FExtension) { case 0: Bitmap->Handle = LoadImage(HInstance,"iconcmb",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = 0; FileListBox->Mask = "*.cmb"; break; case 1: Bitmap->Handle = LoadImage(HInstance,"iconjqd",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = 0; FileListBox->Mask = "*.jqd"; break; case 2: Bitmap->Handle = LoadImage(HInstance,"iconstp",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = 0; FileListBox->Mask = "*.stp"; break; case 3: Bitmap->Handle = LoadImage(HInstance,"icont3d",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = 2; FileListBox->Mask = "*.t3d"; break; #if defined(CARPET) case 4: Bitmap->Handle = LoadImage(HInstance,"iconcpt",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = 0; FileListBox->Mask = "*.cpt"; break; default: Bitmap->Handle = LoadImage(HInstance,"icontex",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"icontfc",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"icont3d",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconwav",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconknt",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconvst",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconcpt",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconbmp",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconpct",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconpcx",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconpng",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconpsd",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconras",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"icontga",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"icontif",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = InitExt - 1; InitExtension(); #else case 5: Bitmap->Handle = LoadImage(HInstance,"iconn3d",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = 3; FileListBox->Mask = "*.n3d"; break; default: Bitmap->Handle = LoadImage(HInstance,"icontex",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"icontfc",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"icont3d",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconn3d",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconwav",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconknt",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconbmp",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconjpg",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconpct",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconpcx",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconpng",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconpsd",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconras",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"icontga",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"icontif",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"iconeps",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = InitExt - 1; InitExtension(); #endif } ExtIndex = TGraphicFileFormat(FilterComboBox->ItemIndex+1); #elif defined(WEAVE) if (FExtension){ Bitmap->Handle = LoadImage(HInstance,"iconwav",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); //SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = InitExt - 1; InitExtension(); } else { //»ö»çÀü°³ ÆÄÀÏ Bitmap->Handle = LoadImage(HInstance,"iconwav",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = 0; FileListBox->Mask = "*.wec"; } #elif defined(KNIT) switch (FExtension) { case 0: Bitmap->Handle = LoadImage(HInstance,"iconknt",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); Bitmap->Handle = LoadImage(HInstance,"icontex",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = InitExt - 1; InitExtension(); break; case 2: Bitmap->Handle = LoadImage(HInstance,"iconstp",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = 0; FileListBox->Mask = "*.stp"; break; } #elif defined(PILE) Bitmap->Handle = LoadImage(HInstance,"iconpil",IMAGE_BITMAP,16,16,LR_DEFAULTSIZE); SmallImageList->Add(Bitmap,NULL); FilterComboBox->ItemIndex = 0; FileListBox->Mask = "*.pil"; #endif delete Bitmap; InitData(true); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::SpeedButtonReadClick(TObject *Sender) { InitItem(0); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::SpeedButtonMergeClick(TObject *Sender) { InitItem(1); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::SpeedButtonSaveClick(TObject *Sender) { InitItem(2); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::SpeedButtonSaveAsClick(TObject *Sender) { Edit4->SetFocus(); InitItem(3); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::SpeedButtonDeleteClick(TObject *Sender) { InitItem(4); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::SpeedButtonMakeFolderClick(TObject *Sender) { Edit4->SetFocus(); InitItem(5); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::SpeedButtonRenameClick(TObject *Sender) { Edit4->SetFocus(); InitItem(6); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::SpeedButtonExitClick(TObject *Sender) { ModalResult = mrCancel; } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::FilterComboBoxChange(TObject *Sender) { ChangeFunction(); InitData(true); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ChangeFunction() { if (FOnRead) SpeedButtonRead->Enabled = true; else SpeedButtonRead->Enabled = false; if (FOnMerge) SpeedButtonMerge->Enabled = true; else SpeedButtonMerge->Enabled = false; if (FOnFileName) { if (FOnSave) SpeedButtonSave->Enabled = true; else SpeedButtonSave->Enabled = false; } else { SpeedButtonSave->Enabled = false; } #ifdef TEXTILE #ifndef CARPET if(!MainForm->T3D_Item){ if(FilterComboBox->ItemIndex==2){ // ShowMessage("Not Use 3D File !!"); FilterComboBox->ItemIndex = 0; Close(); } } #endif #endif ExtIndex = TGraphicFileFormat(FilterComboBox->ItemIndex+1); FileListBox->Update(); #ifdef TEXTILE #ifndef ACADEMY if (ExtIndex == gffT3D || ExtIndex == gffWEA || ExtIndex == gffWAV || ExtIndex == gffKNT) { if (FilterComboBox->Enabled ==true) { //k3dogs 20010103ÀÏÀÚ¿Í ºñ±³Çغ¼ °Í. SpeedButtonMerge->Enabled = false; //TMenu3DForm::sbMainClick ¸¦ ¼öÁ¤Çϸ鼭 ¹Ù²Û °Í. SpeedButtonSave->Enabled = false; //Layer ¿¡¼­ 3d¸¦ ÀÐÀ» ¶§ ¹®Á¦°¡ À־ ¹Ù²Ù°Ô µÈ °Í. SpeedButtonSaveAs->Enabled = false; } // } else { if (FOnMerge) SpeedButtonMerge->Enabled = true; if (FOnSave) { SpeedButtonSave->Enabled = true; SpeedButtonSaveAs->Enabled = true; } else SpeedButtonSaveAs->Enabled = false; } #ifndef CARPET if (ExtIndex == gffJPG) { if (FExtension == 8) { SpeedButtonSave->Enabled = false; SpeedButtonSaveAs->Enabled = false; } else { SpeedButtonSave->Enabled = true; SpeedButtonSaveAs->Enabled = true; } } /* if (ExtIndex == gffGIF) { // by mecbong if (FExtension == 17) { SpeedButtonSave->Enabled = false; SpeedButtonSaveAs->Enabled = false; } else { SpeedButtonSave->Enabled = true; SpeedButtonSaveAs->Enabled = true; } } */ #endif #endif #endif #if defined(KNIT) if (ExtIndex == gffTEX) { ReadStitchSize1->Visible = true; ReadKnitSize1->Visible = true; } else { ReadStitchSize1->Visible = false; ReadKnitSize1->Visible = false; } #endif StartLargeImage = true; #if defined(TEXTILE) if(JacquardForm){ //2001.7.26 lhskys Jacquard ¿¡¼­ if(!JacquardForm->j_use){ //¹«Á¶°Ç ÀúÀå ¹æÁö...... SpeedButtonSaveAs->Enabled = false; SpeedButtonSave->Enabled = false; } } #endif #if defined(TEXTILE) if(ExtIndex==gffN3D){ // n3d¸¦ À§ÇØ Æ¯º°È÷ Ãß°¡ SpeedButtonMerge->Enabled = false; if(MainImageForm){ if(MainImageForm->new3d){ /* if (FOnRead) SpeedButtonRead->Enabled = true; else SpeedButtonRead->Enabled = false; if (FOnMerge) SpeedButtonMerge->Enabled = true; else SpeedButtonMerge->Enabled = false; if (FOnFileName) { if (FOnSave) SpeedButtonSave->Enabled = true; else SpeedButtonSave->Enabled = false; } else { SpeedButtonSave->Enabled = false; }*/ } else { SpeedButtonSave->Enabled = false; SpeedButtonSaveAs->Enabled = false; } } else { SpeedButtonSave->Enabled = false; SpeedButtonSaveAs->Enabled = false; } } #endif } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ComboBoxViewChange(TObject *Sender) { isPreview->Visible = true; isPreview->Caption = IDS_PREVIEW; if (isPreview->Checked) PreviewBox->BringToFront(); else PreviewBox->SendToBack(); if (ComboBoxView->ItemIndex == 0) { int i ; if(StartLargeImage){ InitData(false); StartLargeImage = false; } for(i = 0 ; i < ListView->Items->Count ; i++) { ListView->Items->Item[i]->ImageIndex = i; } ListView->ViewStyle = vsIcon; isPreview->Visible = false; PreviewBox->SendToBack(); } else if (ComboBoxView->ItemIndex == 1) { IconSet(FilterComboBox->ItemIndex); ListView->ViewStyle = vsSmallIcon; } else if (ComboBoxView->ItemIndex == 2) { IconSet(FilterComboBox->ItemIndex); ListView->ViewStyle = vsList; } else { IconSet(FilterComboBox->ItemIndex); ListView->ViewStyle = vsReport; } ImagePreview(-1); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Edit4Change(TObject *Sender) { if (StrLen(Edit4->Text.c_str())>0) SpeedButton4->Enabled = true; else SpeedButton4->Enabled = false; } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Edit4KeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key==VK_RETURN) SpeedButton4Click(Edit4); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::SpeedButton4Click(TObject *Sender) { AnsiString fn, cmfn, cmfn2; TCursor cur; switch (Item) { case 3: if (FOnFileName) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; fn = FOnFileName(Edit4->Text, ExtIndex); for (int i=0; iItems->Count; i++) { cmfn = FileListBox->Items->Strings[i].LowerCase(); cmfn2 = fn.LowerCase(); if (cmfn == cmfn2) { int btn = EXCEPTION_MESSAGE2_OKCANCEL(EC_FILE_EXIST_ALREADY, (IDS_MESSAGE_REALLYFILESAVE).c_str()); if (btn == mrOk) { if (FOnSave) SaveOnTexpiaFile(fn); goto next; } else { goto next; } } } if (FOnSave) SaveOnTexpiaFile(fn); next: Screen->Cursor = cur; } //next: FileListBox->Update(); InitData(false); SpeedButtonRead->Down = true; InitItem(0); break; case 5: CreateDirectory(Edit4->Text.c_str(), NULL); DirectoryListBox->Update(); SpeedButtonRead->Down = true; InitItem(0); break; case 6: if (FOnFileName) { if (ListView->Selected && Edit4->Text!="") { if (RenameFile(FileName, FOnFileName(Edit4->Text, ExtIndex)) == false) EXCEPTION_MESSAGE_OK(EC_FILE_EXIST_ALREADY); } else { EXCEPTION_MESSAGE_OK(EC_CHOOSEFILE); } } FileListBox->Update(); InitData(false); SpeedButtonRead->Down = true; InitItem(0); break; } if(Rename && SpeedButtonRename->Down && StrLen(Edit4->Text.c_str())>0){ //2001.7.2 by lhskys Rename F2 ±â´É Ãß°¡ if (FOnFileName) { if (ListView->Selected) { if (RenameFile(FileName, FOnFileName(Edit4->Text, ExtIndex)) == false) EXCEPTION_MESSAGE_OK(EC_FILE_EXIST_ALREADY); } else { EXCEPTION_MESSAGE_OK(EC_CHOOSEFILE); } } FileListBox->Update(); InitData(false); SpeedButtonRead->Down = true; InitItem(0); Rename = false; } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::DirectoryListBoxChange(TObject *Sender) { InitData(true); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ListViewDblClick(TObject *Sender) { int n; bool run = true; TCursor cur; TFMReadParameter rp; TPException ec = EC_NONE; if (ListView->Selected) { n = ListView->Selected->Index; FileName = ListView->Items->Item[n]->Caption; if (Item==0) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (FOnRead) { rp.DirName = FileListBox->Directory; rp.FileName = FileName; rp.ExtIndex = ExtIndex; #if defined(TEXTILE) #ifdef ACADEMY rp.bpp = 8; ec = FOnRead(rp); #else if (ExtIndex == gffTEX || ExtIndex == gffKNT) { rp.bpp = 8; ec = FOnRead(rp); } else { rp.bpp = 24; ec = FOnRead(rp); } #endif #else reading = true; #if defined(KNIT) rp.Method = 0; rp.DPI = 160; rp.WPI = 12; rp.CPI = 10; #endif rp.bpp = 8; ec = FOnRead(rp); reading = false; #endif } Screen->Cursor = cur; if (ec != EC_NONE) EXCEPTION_MESSAGE_OK(ec); ModalResult = mrOk; } else if (Item==1) { cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (FOnMerge) { if (FOnMerge(FileName, ExtIndex)) { ModalResult = mrOk; } else { SpeedButtonRead->Down = true; InitItem(0); } } Screen->Cursor = cur; } else { switch (Item) { case 2: cur = Screen->Cursor; Screen->Cursor = crHourGlass; if (FOnSave) SaveOnTexpiaFile(FileName); Screen->Cursor = cur; break; case 4: Delete_File(FileName); break; case 6: Edit4->Text = RenameFileName; //±âÁ¸ÀÇ Rename ¹æ½Ä º¸Á¸ SpeedButton4Click(NULL); run = false; break; } if (run) { FileListBox->Update(); InitData(false); SpeedButtonRead->Down = true; InitItem(0); } } #if defined(TEXTILE) MainImageForm->AutoRepUpdateMenu(true); //2001.4.11. lhskys »õ·Î¿î MainMenu »ý¼º #endif } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ListViewMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { if (ListView->Selected) { int n = ListView->Selected->Index; FileName = ListView->Items->Item[n]->Caption; Rename = true; //2001.7.2 by lhskys Rename F2 ±â´É Ãß°¡ if(Edit4->Visible && SpeedButtonMakeFolder->Down == false){ RenameFileName = Edit4->Text; Edit4->Text = FileName;} else if(Edit4->Visible)Edit4->Text =""; if(SpeedButtonRename->Down || SpeedButtonSaveAs->Down)Edit4->SetFocus(); if (ComboBoxView->ItemIndex != 0 && isPreview->Checked) ImagePreview(n); } else FileName = ""; } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ListViewColumnClick(TObject *Sender, TListColumn *Column) { Ascend[Column->Index] = !Ascend[Column->Index]; ListView->CustomSort(NULL, Column->Index); ListView->Repaint(); } //--------------------------------------------------------------------------- double __fastcall ExtractSize(AnsiString str) { int pos = Sysutils::AnsiPos('K', str); return StrToFloat(str.SubString(1, pos - 1)); } //--------------------------------------------------------------------------- int __fastcall ExtractDate(AnsiString str) { int i, pos; const char p[4] = { '-', '-', ' ', ':' }; AnsiString value; for (i = 0; i < 4; i++) { pos = Sysutils::AnsiPos(p[i], str); if (pos == 2) { value += ("0"+ str.SubString(1, pos - 1)); } else { value += str.SubString(1, pos - 1); } if (i == 2) { str = str.SubString(pos+2, str.Length()); } else { str = str.SubString(pos+1, str.Length()); } } if (str.Length() > 1) { value += str; } else { value += (str + "0"); } return StrToFloat(value); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ListViewCompare(TObject *Sender, TListItem *Item1, TListItem *Item2, int Data, int &Compare) { double size1, size2; switch (Data) { case 0: if (Ascend[0]) { Compare = CompareStr(Item1->Caption, Item2->Caption); } else { Compare = CompareStr(Item2->Caption, Item1->Caption); } break; case 1: size1 = ExtractSize(Item1->SubItems->Strings[0]); size2 = ExtractSize(Item2->SubItems->Strings[0]); if (Ascend[1]) { Compare = size1 - size2; } else { Compare = size2 - size1; } break; case 2: size1 = ExtractDate(Item1->SubItems->Strings[1]); size2 = ExtractDate(Item2->SubItems->Strings[1]); if (Ascend[2]) { Compare = size1 - size2; } else { Compare = size2 - size1; } break; } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ListViewEdited(TObject *Sender, TListItem *Item, AnsiString &S) { if (FOnFileName) { AnsiString newname = FOnFileName(S, ExtIndex); if (RenameFile(FileName, newname) == false) { EXCEPTION_MESSAGE_OK(EC_FILE_EXIST_ALREADY); return; } Item->Caption = newname; FileListBox->Update(); } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Splitter1Moved(TObject *Sender) { StatusBar->Panels->Items[0]->Width = Splitter1->Left + 12; StatusBar->Panels->Items[1]->Width = StatusBar->Width - StatusBar->Panels->Items[0]->Width; } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Load256Colors1Click(TObject *Sender) { TCursor cur = Screen->Cursor; TFMReadParameter rp; TPException ec; if (!ListView->Selected) return; TListItem *ItemM = ListView->Selected; // By GreenFish ¿©·¯°³ File Open °¡´É TItemStates selected = TItemStates() << isSelected; // ItemM(ulti) ¿¡ Çϳª¾¿ ÀúÀå while (ItemM) { // ItemM ¿¡ °Ô¼Ó Áý¾î³Ö°í, NULLÀÌ ³ª¿Ã‹š ±îÁö int n; TPException ec = EC_NONE; n = ItemM->Index; FileName = ListView->Items->Item[n]->Caption; Screen->Cursor = crHourGlass; if (FOnRead) { rp.DirName = FileListBox->Directory; rp.FileName = FileName; rp.ExtIndex = ExtIndex; rp.bpp = 8; if ((ec = FOnRead(rp)) != EC_NONE) EXCEPTION_MESSAGE_OK(ec); } ItemM = ListView->GetNextItem(ItemM, sdAll, selected ); // ´ÙÀ½ ÆÄÀÏ ¹Þ±â } Screen->Cursor = cur; ModalResult = mrOk; #if defined(TEXTILE) MainImageForm->AutoRepUpdateMenu(true); #endif } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::LoadFullColors1Click(TObject *Sender) { TCursor cur = Screen->Cursor; TFMReadParameter rp; TPException ec; if (!ListView->Selected) return; TListItem *ItemM = ListView->Selected; TItemStates selected = TItemStates() << isSelected; while (ItemM) { // ItemM ¿¡ °Ô¼Ó Áý¾î³Ö°í, NULLÀÌ ³ª¿Ã‹š ±îÁö int n; TPException ec = EC_NONE; n = ItemM->Index; FileName = ListView->Items->Item[n]->Caption; Screen->Cursor = crHourGlass; if (FOnRead) { rp.DirName = FileListBox->Directory; rp.FileName = FileName; rp.ExtIndex = ExtIndex; rp.bpp = 24; if ((ec = FOnRead(rp)) != EC_NONE) EXCEPTION_MESSAGE_OK(ec); } ItemM = ListView->GetNextItem(ItemM, sdAll, selected ); // ´ÙÀ½ ÆÄÀÏ ¹Þ±â } Screen->Cursor = cur; ModalResult = mrOk; #if defined(TEXTILE) MainImageForm->AutoRepUpdateMenu(true); #endif } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::PopupSaveClick(TObject *Sender) { if (FOnSave) SaveOnTexpiaFile(FileName); FileListBox->Update(); InitData(false); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::PopupDeleteClick(TObject *Sender) { if (!ListView->Selected) return; TListItem *ItemM = ListView->Selected; // ¿©·¯°³ÆÄÀÏ Áö¿ì±â By GreenFish TItemStates selected = TItemStates() << isSelected; while (ItemM) { int n; if (ItemM) { n = ItemM->Index; FileName = ListView->Items->Item[n]->Caption; } Delete_File(FileName); ItemM = ListView->GetNextItem(ItemM, sdAll, selected ); } FileListBox->Update(); InitData(false); } //-------------------------------------------------------------------------- void __fastcall TFileManagerForm::PopupMenuTexFilePopup(TObject *Sender) { Load256Colors1->Caption = IDS_FLOAD; LoadFullColors1->Caption = IDS_FLOADFULL; Copy1->Caption = IDS_FCOPY; Cut1->Caption = IDS_FCUT; Paste1->Caption = IDS_FPASTE; Save1->Caption = IDS_FSAVE; Delete1->Caption = IDS_FDELETE; Rename1->Caption = IDS_FRENAME; Preference1->Caption = IDS_FPREFERENCE; //======= 2001.3.27 lhskys C++Builder 5 ¿¡¼­ ¸¶¿ì½º ¿ìÃø Ŭ¸¯ÀÌ ¾ÈµÇ´Â°Í ¼öÁ¤... if (ListView->Selected) { // GreenFish ¼öÁ¤ 2001.4.10 int n = ListView->Selected->Index; FileName = ListView->Items->Item[n]->Caption; } //============================= if (FileName=="") { Load256Colors1->Enabled = false; LoadFullColors1->Enabled = false; Save1->Enabled = false; Delete1->Enabled = false; Rename1->Enabled = false; // By GreenFish } else { if (FileListBox->Mask == "*.t3d") { Load256Colors1->Enabled = false; LoadFullColors1->Enabled = false; if (FExtension != 3) Save1->Enabled = false; else Save1->Enabled = true; } else if (FileListBox->Mask == "*.n3d") { Load256Colors1->Enabled = false; LoadFullColors1->Enabled = false; if (FExtension != 5) Save1->Enabled = false; else Save1->Enabled = true; } else if (FileListBox->Mask == "*.wea" || FileListBox->Mask == "*.wav" || FileListBox->Mask == "*.knt"){ Load256Colors1->Enabled = true; LoadFullColors1->Enabled = true; Save1->Enabled = false; Delete1->Enabled = true; } else { Load256Colors1->Enabled = true; #ifdef ACADEMY LoadFullColors1->Enabled = false; #else LoadFullColors1->Enabled = true; #endif Save1->Enabled = true; Delete1->Enabled = true; } } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::DirectoryDeleteClick(TObject *Sender) { int i; char *str; AnsiString Astr1, Astr2; for (i=0; iItems->Count; i++) { if (DirectoryListBox->Selected[i]) { Astr1 = DirectoryListBox->Directory; Astr2 = DirectoryListBox->Items->Strings[i]; str = StrPos(Astr1.c_str(), Astr2.c_str()); if (str==NULL) Delete_Folder(Astr2); else Delete_Folder(Astr1); break; } } DirectoryListBox->Update(); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::DirectoryRenameClick(TObject *Sender) { int i, same, length; char *str; AnsiString Astr1, Astr2, dn, s; if (Edit4->Text == "") ShowMessage(IDS_MESSAGE_INPUTFILE); for (i = 0; i < DirectoryListBox->Items->Count; i++) { if (DirectoryListBox->Selected[i]) { Astr1 = DirectoryListBox->Directory; Astr2 = DirectoryListBox->GetItemPath(i); same = StrComp(Astr1.c_str(), Astr2.c_str()); if (same == 0) dn = Astr1; else dn = Astr2; length = dn.Length(); str = dn.c_str(); while(length) { if (AnsiString(str[length-1]) == "\\") { Astr1 = dn.SubString(1, length); break; } else { length--; } } Astr1 += Edit4->Text; if (MoveFile(dn.c_str(), Astr1.c_str())) { DirectoryListBox->Directory = Astr1; } break; } } DirectoryListBox->Update(); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::DirectoryListBoxDblClick(TObject *Sender) { int i, same, length; char *str; AnsiString Astr1, Astr2, dn, s; if (Item == 4 || Item == 6) { i = DirectoryListBox->ItemIndex; if (i != -1) { Astr1 = DirectoryListBox->Directory; Astr2 = DirectoryListBox->GetItemPath(i); same = StrComp(Astr1.c_str(), Astr2.c_str()); if (same == 0) dn = Astr1; else dn = Astr2; if (Item == 4) Delete_Folder(dn); else if (Item == 6) { length = dn.Length(); str = dn.c_str(); while(length) { if (AnsiString(str[length-1]) == "\\") { Astr1 = dn.SubString(1, length); break; } else { length--; } } Astr1 += Edit4->Text; if (MoveFile(dn.c_str(), Astr1.c_str())) { DirectoryListBox->Directory = Astr1; } } } DirectoryListBox->Update(); SpeedButtonRead->Down = true; InitItem(0); } } //--------------------------------------------------------------------------- // Private Method //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::SaveOnTexpiaFile(AnsiString FileName) { TPException ec = EC_NONE; #if defined(TEXTILE) if (FExtension > 8) { if (ExtIndex != gffTEX) { if (CompressCheckBox->Checked) ec = FOnSave(FileListBox->Directory, FileName, ExtIndex, cmZLib); else ec = FOnSave(FileListBox->Directory, FileName, ExtIndex, cmNone); } else ec = EC_CANNOT_SAVE256; } else { if (CompressCheckBox->Checked) ec = FOnSave(FileListBox->Directory, FileName, ExtIndex, cmZLib); else ec = FOnSave(FileListBox->Directory, FileName, ExtIndex, cmNone); } #else if (CompressCheckBox->Checked) ec = FOnSave(FileListBox->Directory, FileName, ExtIndex, cmZLib); else ec = FOnSave(FileListBox->Directory, FileName, ExtIndex, cmNone); #endif if (ec != EC_NONE) EXCEPTION_MESSAGE_OK(ec); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::InitItem(int i) { Item = i; switch (Item) { case 0: Label4->Caption = IDS_SEARCH; SpeedButton4->Caption = IDS_SEARCH; if (StrLen(Edit4->Text.c_str())>0) SpeedButton4->Enabled = true; else SpeedButton4->Enabled = false; Panel->Height = Panel1->Height + Panel2->Height + Panel3->Height + Panel4->Height; break; case 1: Panel->Height = Panel1->Height + Panel2->Height + Panel3->Height; break; case 2: case 3: Label4->Caption = IDS_FILENAME; if (Item == 2) SpeedButton4->Caption = IDS_COMMON_SAVE; if (Item == 3) SpeedButton4->Caption = IDS_COMMON_SAVEAS; if (StrLen(Edit4->Text.c_str())>0) SpeedButton4->Enabled = true; else SpeedButton4->Enabled = false; Panel->Height = Panel1->Height + Panel2->Height + Panel3->Height + Panel4->Height; break; case 5: Label4->Caption = IDS_FOLDERNAME; SpeedButton4->Caption = IDS_MAKE; if (StrLen(Edit4->Text.c_str())>0) SpeedButton4->Enabled = true; else SpeedButton4->Enabled = false; Panel->Height = Panel1->Height + Panel2->Height + Panel3->Height + Panel4->Height; break; case 6: Label4->Caption = IDS_FILENAME; SpeedButton4->Caption = IDS_COMMON_RENAME; if (StrLen(Edit4->Text.c_str())>0) SpeedButton4->Enabled = true; else SpeedButton4->Enabled = false; Panel->Height = Panel1->Height + Panel2->Height + Panel3->Height + Panel4->Height; break; } if(Edit4->Visible)Edit4->Text =""; if (isPreview->Checked && isPreview->Visible) { if (ListView->Selected) { int n = ListView->Selected->Index; if (ComboBoxView->ItemIndex != 0 && isPreview->Checked) ImagePreview(n); } else ImagePreview(-1); } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::InitData(bool isCheck) { TFileInfor *fi = NULL; TTexpiaBitmap *TexBitmap = NULL; int i, imgindex; TTexVersion *ver; TListItem *pItem; AnsiString fn, time; //-- Graphics::TBitmap *icon = NULL; RGBQUAD rgb[256]; HANDLE hFile = INVALID_HANDLE_VALUE; DWORD size; FILETIME fTime, fLocTime; SYSTEMTIME SysTime; HDC dcSrc = NULL; TPException ec = EC_NONE; #ifdef TEXTILE #ifndef CARPET if(!MainForm->T3D_Item){ if(FilterComboBox->ItemIndex==2){ FilterComboBox->ItemIndex = 0; Close(); } } #endif #endif #ifndef CARPET if (isCheck && FDrive==DriveComboBox->Drive && FDirectory==DirectoryListBox->Directory && FFilter==FilterComboBox->Filter && FFilterIndex==FilterComboBox->ItemIndex) return; #endif ExitData(); int count = FileListBox->Items->Count; if(ComboBoxView->ItemIndex == 0){ if ((fi = new TFileInfor)==NULL) { ec = EC_MEMORY_LACK; goto fail; } if ((fi->Bitmap = new Graphics::TBitmap)==NULL) { ec = EC_MEMORY_LACK; goto fail; } } if (Version){ while(Version->Count > 0){ ver = (TTexVersion*)(Version->Last()); Version->Remove(ver); delete ver; } delete Version; Version = NULL; } Version = new TList; for (i = 0, imgindex = 0; i < count; i++) { fn = FileListBox->Items->Strings[i]; if(ComboBoxView->ItemIndex == 0) { #if defined(TEXTILE) #ifdef ACADEMY if (FilterComboBox->ItemIndex+1 == gffTEX) { #else if (FilterComboBox->ItemIndex+1 == gffTEX || FilterComboBox->ItemIndex+1 == gffTFC || FilterComboBox->ItemIndex+1 == gffT3D || FilterComboBox->ItemIndex+1 == gffWEA || FilterComboBox->ItemIndex+1 == gffWAV || FilterComboBox->ItemIndex+1 == gffKNT || FilterComboBox->ItemIndex+1 == gffN3D) { #endif if ((hFile = CreateFile(fn.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto next; ver = new TTexVersion; if (!LoadFromTexpiaTag(hFile, fi, ver)) goto next; Version->Add(ver); } else { if ((TexBitmap = new TTexpiaBitmap) == NULL) goto next; if (!TexBitmap->LoadFromFile(fn)) goto next; fi->Bitmap->PixelFormat = pf24bit; fi->Bitmap->Width = 80; fi->Bitmap->Height = 100; if (fi->Bitmap->Empty) goto next; fi->Bitmap->Canvas->Brush->Color = clWhite; fi->Bitmap->Canvas->FillRect(Rect(0, 0, 80, 100)); if ((dcSrc = TexBitmap->CreateDC())==NULL) goto next; SetStretchBltMode(fi->Bitmap->Canvas->Handle, COLORONCOLOR); StretchBlt(fi->Bitmap->Canvas->Handle, 0, 0, 80, 100, dcSrc, 0, 0, TexBitmap->Width, TexBitmap->Height, SRCCOPY); TexBitmap->DeleteDC(dcSrc); dcSrc = NULL; delete TexBitmap; TexBitmap = NULL; if ((hFile = CreateFile(fn.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto next; } #else if ((hFile = CreateFile(fn.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto next; ver = new TTexVersion; if (!LoadFromTexpiaTag(hFile, fi, ver)) goto next; Version->Add(ver); #endif LargeImageList->Add(fi->Bitmap, NULL); } pItem = ListView->Items->Add(); if (hFile == INVALID_HANDLE_VALUE) { if ((hFile = CreateFile(fn.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto next; } size = GetFileSize(hFile, NULL); pItem->Caption = fn; if(ListView->ViewStyle == vsIcon){ pItem->ImageIndex = imgindex; imgindex++; } else { pItem->ImageIndex = FilterComboBox->ItemIndex; } pItem->SubItems->Add(FloatToStr(size / 1000.0) + "KB"); if (SetFilePointer(hFile, 0, NULL, FILE_BEGIN) == 0xFFFFFFFF) goto next; if (GetFileTime(hFile, NULL, NULL, &fTime)) { FileTimeToLocalFileTime(&fTime, &fLocTime); if (FileTimeToSystemTime(&fLocTime, &SysTime)) { time = Format("%d-%d-%d %d:%d", OPENARRAY(TVarRec, (SysTime.wYear, SysTime.wMonth, SysTime.wDay, SysTime.wHour, SysTime.wMinute))); pItem->SubItems->Add(time); } } CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; ProgressBar->Position = (100.0 / count) * (i+1); continue; next: if (hFile != INVALID_HANDLE_VALUE) { CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; } if (TexBitmap) { if (dcSrc) { TexBitmap->DeleteDC(dcSrc); dcSrc = NULL; } delete TexBitmap; TexBitmap = NULL; } } GetDiskInfor(); if(fi) delete fi; ProgressBar->Position = 0; FDrive = DriveComboBox->Drive; FDirectory = DirectoryListBox->Directory; FFilter = FilterComboBox->Filter; FFilterIndex = FilterComboBox->ItemIndex; StartLargeImage = true; return; fail: if (fi) delete fi; EXCEPTION_MESSAGE_OK(ec); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ExitData() { if (ListView->Items->Count) ListView->Items->Clear(); if (LargeImageList->Count) LargeImageList->Clear(); //-- if (SmallImageList->Count) SmallImageList->Clear(); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Delete_File(AnsiString FileName) { SHFILEOPSTRUCT shfile; AnsiString asFrom; char *ucFrom = NULL, *ch = NULL, *ph; memset(&shfile, 0, sizeof(SHFILEOPSTRUCT)); shfile.hwnd = Handle; shfile.wFunc = FO_DELETE; int len = DirectoryListBox->Directory.Length(); if ((ch = (char *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len + 2)) == NULL) goto fail; strcpy(ch, DirectoryListBox->Directory.c_str()); ph = ch + (len-1); if (*ph == '\\') asFrom = DirectoryListBox->Directory+FileName; else asFrom = DirectoryListBox->Directory+"\\"+FileName; if ((ucFrom = (char *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, asFrom.Length()+2)) == NULL) goto fail; strcpy(ucFrom, asFrom.c_str()); shfile.pFrom = ucFrom; shfile.fFlags = FOF_ALLOWUNDO ; SHFileOperation(&shfile); HeapFree(GetProcessHeap(), 0, ucFrom); HeapFree(GetProcessHeap(), 0, ch); return; fail: if (ch) HeapFree(GetProcessHeap(), 0, ch); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Delete_Folder(AnsiString FolderName) { SHFILEOPSTRUCT shfile; char *ucFrom = NULL; memset(&shfile, 0, sizeof(SHFILEOPSTRUCT)); shfile.hwnd = Handle; shfile.wFunc = FO_DELETE; ucFrom = (char *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, FolderName.Length()+2); if (ucFrom) { strcpy(ucFrom, FolderName.c_str()); shfile.pFrom = ucFrom; shfile.fFlags = FOF_ALLOWUNDO ; SHFileOperation(&shfile); HeapFree(GetProcessHeap(), 0, ucFrom); } else { EXCEPTION_MESSAGE_OK(EC_MEMORY_LACK); } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::GetDiskInfor() { ULARGE_INTEGER FreeBytesAvailableToCaller; ULARGE_INTEGER TotalNumberOfBytes; ULARGE_INTEGER TotalNumberOfFreeBytes; int FreeSpace, TotalSpace; char *szDrive = DirectoryListBox->Directory.c_str(); char szBuffer[4]; StrLCopy(szBuffer, szDrive, 1); strcat(szBuffer, ":\\"); ::GetDiskFreeSpaceEx(szBuffer, &FreeBytesAvailableToCaller, &TotalNumberOfBytes, &TotalNumberOfFreeBytes); FreeSpace = (FreeBytesAvailableToCaller.HighPart << 12) | (FreeBytesAvailableToCaller.LowPart >> 20); TotalSpace = (TotalNumberOfBytes.HighPart << 12) | (TotalNumberOfBytes.LowPart >> 20); StatusBar->Panels->Items[1]->Text = Format("Current Free Spaces : %d M Bytes, Total Disk Spaces : %d M Bytes", OPENARRAY (TVarRec,(FreeSpace, TotalSpace))); #ifndef CARPET StatusBar->Panels->Items[0]->Text = " " +AnsiString(ListView->Items->Count) + " Patterns"; #endif } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::DriveComboBoxChange(TObject *Sender) { DriveChange(); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::DriveChange() { char drive = DriveComboBox->Drive; AnsiString root, dn; int status; bool success, find = false; TSearchRec sr; if (UpperCase(AnsiString(drive)) != "C") return; root = Format("%s:\\", OPENARRAY(TVarRec, (drive))); dn = "pattern"; status = FindFirst(root + "*.*", faDirectory, sr); while (status == 0) { if (LowerCase(sr.Name) == dn) { find = true; break; } status = FindNext(sr); } FindClose(sr); if (find) { DirectoryListBox->Directory = root + dn; } else { dn = root + dn; success = CreateDirectory(dn.c_str(), NULL); if (success == false) { DirectoryListBox->Directory = root; ShowMessage(IDS_MESSAGE); } else { DirectoryListBox->Directory = dn; } } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ReadKnitSize1Click(TObject *Sender) { #if defined(KNIT) /*dog TFileSizeForm *Form; TFMReadParameter rp; bool run = false; TPException ec; Form = new TFileSizeForm(NULL); if (Form->ShowModal()==mrOk) { if (ExtIndex == gffTEX) run = true; rp.DPI = Form->seResol->Value; rp.WPI = Form->seWPI->Value; rp.CPI = Form->seCPI->Value; } delete Form; if (run) { if (FOnRead) { rp.DirName = FileListBox->Directory; rp.FileName = FileName; rp.ExtIndex = ExtIndex; rp.Method = 1; if ((ec = FOnRead(rp)) != EC_NONE) EXCEPTION_MESSAGE_OK(ec); ModalResult = mrOk; } } */ #endif } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ReadStitchSize1Click(TObject *Sender) { #if defined(KNIT) /*dog TFileSizeForm *Form; TFMReadParameter rp; bool run = false; TPException ec; Form = new TFileSizeForm(NULL); if (Form->ShowModal()==mrOk) { if (ExtIndex == gffTEX) run = true; rp.DPI = Form->seResol->Value; rp.WPI = Form->seWPI->Value; rp.CPI = Form->seCPI->Value; } delete Form; if (run) { if (FOnRead) { rp.DirName = FileListBox->Directory; rp.FileName = FileName; rp.ExtIndex = ExtIndex; rp.Method = 0; if ((ec = FOnRead(rp)) != EC_NONE) EXCEPTION_MESSAGE_OK(ec); ModalResult = mrOk; } } */ #endif } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::IconSet(int k) { int i ; for(i = 0 ; i < ListView->Items->Count ; i++) { ListView->Items->Item[i]->ImageIndex = k; } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ListViewMouseMove(TObject *Sender, TShiftState Shift, int X, int Y) { int n; // statusbar ¿¡ È­ÀÏ ¹öÀü Ç¥½Ã TTexVersion *ver; TListItem *pItem; AnsiString VerNumber; if(ComboBoxView->ItemIndex) goto next; if(Version->Count) { pItem = ListView->GetItemAt(X,Y); if(!pItem) goto next; n = pItem->Index; if(Version->Count < n) goto next; ver = (TTexVersion *)Version->Items[n]; VerNumber += (" Version " + FloatToStr(ver->Number/100.0)); StatusBar->Panels->Items[2]->Text = VerNumber; } return; next: StatusBar->Panels->Items[2]->Text = ""; } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ListViewChange(TObject *Sender, TListItem *Item, TItemChange Change) { if (ListView->SelCount == 1 ){ // ¼±ÅÃÇÑ ¾ÆÀÌÅÛÀÇ °¹¼ö°¡ 1°³À϶§¸¸ Rename1->Enabled = true; // ´ÙÀ½ÀÇ °ÍµéÀÌ °¡´É By GreenFish Rename2->Enabled = true; // (FileÀÇ ´ÙÁß¼±ÅÃÀÌ °¡´ÉÇØÁö¸é¼­ ºÎ°¡) Preference1->Enabled = true; Preference2->Enabled = true; Save1->Enabled = true; Save2->Enabled = true; }else { Rename1->Enabled = false; Rename2->Enabled = false; Preference1->Enabled = false; Preference2->Enabled = false; Save1->Enabled = false; Save2->Enabled = false; } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Rename1Click(TObject *Sender) //2001.7.2 by lhskys Rename F2 ±â´É Ãß°¡ { int n = ListView->Selected->Index; SpeedButtonRename->Down = true; FileName = ListView->Items->Item[n]->Caption; Label4->Caption = IDS_FILENAME; SpeedButton4->Caption = IDS_COMMON_RENAME; Edit4->Text = FileName; SpeedButton4->Enabled = true; Panel->Height = Panel1->Height + Panel2->Height + Panel3->Height + Panel4->Height; Edit4->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Preference1Click(TObject *Sender) { if (ListView->SelCount != 1) return; // By GreenFish ÆÄÀÏ µî·ÏÁ¤º¸ Ç¥½ÃÇϱâ TFMReadParameter rp; int n; n = ListView->Selected->Index; FileName = ListView->Items->Item[n]->Caption; HANDLE hFile; FILETIME fLocTime; typedef struct { // ³¯Â¥, ½Ã°£ ±¸Á¶Ã¼ WORD Day:5; WORD Month:4; WORD Year:7; } DOSDATE; typedef struct { WORD Second:5; WORD Minute:6; WORD Hour:5; } DOSTIME; DOSDATE Date, Date2, Date3; DOSTIME Time, Time2, Time3; BY_HANDLE_FILE_INFORMATION info; // info ¿¡ ÆÄÀÏ Á¤º¸µéÀÌ ÀÔ·Â FilePreferBox->BringToFront(); hFile = CreateFile (FileName.c_str() , GENERIC_READ | GENERIC_WRITE , 0 , NULL, OPEN_ALWAYS , FILE_ATTRIBUTE_NORMAL , NULL); // File ¹Þ±â GetFileInformationByHandle (hFile , &info); FileTimeToLocalFileTime ( &info.ftCreationTime , &fLocTime); // Áö¿ª ½Ã°£À¸·Î º¯È¯ FileTimeToDosDateTime (&fLocTime , (WORD*)&Date , (WORD*)&Time); // Dos TimeÀ¸·Î º¯È¯ FileTimeToLocalFileTime ( &info.ftLastWriteTime , &fLocTime); FileTimeToDosDateTime (&fLocTime , (WORD*)&Date2 , (WORD*)&Time2); FileTimeToLocalFileTime ( &info.ftLastAccessTime , &fLocTime); FileTimeToDosDateTime (&fLocTime , (WORD*)&Date3 , (WORD*)&Time3); FileNameLabel->Caption = FileName; LocationLabel->Caption = FileListBox->Directory; SizeLabel->Caption = FormatFloat ("#,##0",info.nFileSizeLow) + " Bytes"; if (Date.Month == 0) { CreateLabel->Caption = "(Unknown)"; } else { CreateLabel->Caption = Format ( "%2d-%2d-%d %2d : %2d : %2d",OPENARRAY(TVarRec, (Date.Month, Date.Day, (Date.Year+1980), Time.Hour, Time.Minute, Time.Second))) ; } ChangeLabel->Caption = Format ( "%2d-%2d-%d %2d : %2d : %2d",OPENARRAY(TVarRec, (Date2.Month, Date2.Day, (Date2.Year+1980), Time2.Hour, Time2.Minute, Time2.Second))) ; LastLabel->Caption = Format ( "%2d-%2d-%d" ,OPENARRAY(TVarRec, (Date3.Month, Date3.Day, (Date3.Year+1980)))) ; CloseHandle (hFile) ; } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ExitPreferButtonClick(TObject *Sender) { FilePreferBox->SendToBack(); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Copy1Click(TObject *Sender) { if (!ListView->SelCount || ListView->SelCount > 10) return; // 10°³ ±îÁö¸¸ int i=0; while (i<20) { CopyFullName[i] = "";MoveFullName[i++] = "";} TListItem *ItemM = ListView->Selected; // ¿©·¯°³ÆÄÀÏ Copy By GreenFish TItemStates selected = TItemStates() << isSelected; int Idx = 0; while (ItemM) { int n; if (ItemM) { n = ItemM->Index; CopyFullName[Idx] = FullPathName (FileListBox->Directory, ListView->Items->Item[n]->Caption); CopyFileName[Idx] = ListView->Items->Item[n]->Caption; Idx++; } ItemM = ListView->GetNextItem(ItemM, sdAll, selected ); } Paste1->Enabled = true; Paste2->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Paste1Click(TObject *Sender) { int i=0 , j=0; while (CopyFullName[i]!="") { AnsiString CopyDestination = FullPathName(FileListBox->Directory,CopyFileName[i]); if (!CopyFile (CopyFullName[i].c_str() , CopyDestination.c_str(), true)) { if (Application->MessageBox("Do you want to overwrite?","File already exists", MB_YESNO | MB_ICONQUESTION) == IDYES) CopyFile (CopyFullName[i].c_str() , CopyDestination.c_str(), false); } i++; } while (MoveFullName[j]!="") { AnsiString MoveDestination = FullPathName(FileListBox->Directory,MoveFileName[j]); if (!CopyFile (MoveFullName[j].c_str() , MoveDestination.c_str(), true)) { if (Application->MessageBox("Do you want to overwrite?","File already exists",MB_YESNO | MB_ICONQUESTION) == IDYES){ CopyFile (MoveFullName[j].c_str() , MoveDestination.c_str(), false); DeleteFile(MoveFullName[j].c_str()); } }else { DeleteFile(MoveFullName[j].c_str()); } j++; } FileListBox->Update(); InitData(false); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::Cut1Click(TObject *Sender) { if (!ListView->SelCount || ListView->SelCount > 10) return; int i=0; while (i<20) { CopyFullName[i] = "";MoveFullName[i++] = "";} TListItem *ItemM = ListView->Selected; // ¿©·¯°³ÆÄÀÏ Move By GreenFish TItemStates selected = TItemStates() << isSelected; int Idx = 0; while (ItemM) { int n; if (ItemM) { n = ItemM->Index; MoveFullName[Idx] = FullPathName (FileListBox->Directory, ListView->Items->Item[n]->Caption); MoveFileName[Idx] = ListView->Items->Item[n]->Caption; Idx++; } ItemM = ListView->GetNextItem(ItemM, sdAll, selected ); } Paste1->Enabled = true; Paste2->Enabled = true; } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ListViewKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == 46) PopupDeleteClick(this); // Delete Key·Î »èÁ¦ By GreenFish if (Key == VK_F2) { //2001.6.30 by lhskys Rename F2 ´ÜÃàŰ........ if(Rename){ int n = ListView->Selected->Index; SpeedButtonRename->Down = true; FileName = ListView->Items->Item[n]->Caption; Label4->Caption = IDS_FILENAME; SpeedButton4->Caption = IDS_COMMON_RENAME; Edit4->Text = FileName; SpeedButton4->Enabled = true; Panel->Height = Panel1->Height + Panel2->Height + Panel3->Height + Panel4->Height; Edit4->SetFocus(); } } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ListViewKeyPress(TObject *Sender, char &Key) { int KeyVal = Key; // File ManagerÀÇ ´ÜÃàŰ By GreenFish switch (KeyVal) { case 3 : Copy1Click (this); break; // Ctrl + C case 22: Paste1Click(this); break; // Ctrl + V case 24: Cut1Click(this); break; // Ctrl + X } } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift) { if (Key == 27) SpeedButtonExitClick(this); // Esc Key·Î Exit } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ImagePreview(int index) { if (index == -1) {PreviewImage->Visible = false; return;} else PreviewImage->Visible = true; AnsiString fn = FileListBox->Items->Strings[index]; HANDLE hFile = INVALID_HANDLE_VALUE; TTexVersion *ver = NULL; TTexpiaBitmap *TexBitmap = NULL; TFileInfor *fi = NULL; HDC dcSrc = NULL; TPException ec = EC_NONE; if ((fi = new TFileInfor)==NULL) { ec = EC_MEMORY_LACK; goto fail; } if ((fi->Bitmap = new Graphics::TBitmap)==NULL) { ec = EC_MEMORY_LACK; goto fail; } #if defined(TEXTILE) #ifdef ACADEMY if (FilterComboBox->ItemIndex+1 == gffTEX) { #else if (FilterComboBox->ItemIndex+1 == gffTEX || FilterComboBox->ItemIndex+1 == gffTFC || FilterComboBox->ItemIndex+1 == gffT3D || FilterComboBox->ItemIndex+1 == gffWEA || FilterComboBox->ItemIndex+1 == gffWAV || FilterComboBox->ItemIndex+1 == gffKNT || FilterComboBox->ItemIndex+1 == gffN3D) { #endif if ((hFile = CreateFile(fn.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto next; ver = new TTexVersion; if (!LoadFromTexpiaTag(hFile, fi, ver)) goto next; // Version->Add(ver); } else { if ((TexBitmap = new TTexpiaBitmap) == NULL) goto next; if (!TexBitmap->LoadFromFile(fn)) goto next; fi->Bitmap->PixelFormat = pf24bit; fi->Bitmap->Width = 80; fi->Bitmap->Height = 100; if (fi->Bitmap->Empty) goto next; fi->Bitmap->Canvas->Brush->Color = clWhite; fi->Bitmap->Canvas->FillRect(Rect(0, 0, 80, 100)); if ((dcSrc = TexBitmap->CreateDC())==NULL) goto next; SetStretchBltMode(fi->Bitmap->Canvas->Handle, COLORONCOLOR); StretchBlt(fi->Bitmap->Canvas->Handle, 0, 0, 80, 100, dcSrc, 0, 0, TexBitmap->Width, TexBitmap->Height, SRCCOPY); TexBitmap->DeleteDC(dcSrc); dcSrc = NULL; delete TexBitmap; TexBitmap = NULL; if ((hFile = CreateFile(fn.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto next; } #else if ((hFile = CreateFile(fn.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) == INVALID_HANDLE_VALUE) goto next; ver = new TTexVersion; if (!LoadFromTexpiaTag(hFile, fi, ver)) goto next; // Version->Add(ver); #endif StretchBlt(PreviewImage->Canvas->Handle,0,0,120,140,fi->Bitmap->Canvas->Handle,0,0,80,100,SRCCOPY); PreviewImage->Invalidate(); CloseHandle(hFile); hFile = INVALID_HANDLE_VALUE; next: if(fi) delete fi; if(ver) delete ver; return; fail: if (fi) delete fi; EXCEPTION_MESSAGE_OK(ec); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::isPreviewClick(TObject *Sender) { if (isPreview->Checked){ PreviewBox->BringToFront(); Label5->Caption = IDS_IMAGEPREVIEW; }else PreviewBox->SendToBack(); } //--------------------------------------------------------------------------- void __fastcall TFileManagerForm::ListViewKeyUp(TObject *Sender, WORD &Key, TShiftState Shift) { if (ListView->Selected) { int n = ListView->Selected->Index; FileName = ListView->Items->Item[n]->Caption; Rename = true; //2001.7.2 by lhskys Rename F2 ±â´É Ãß°¡ if(Edit4->Visible && SpeedButtonMakeFolder->Down == false)Edit4->Text = FileName; else if(Edit4->Visible)Edit4->Text =""; if(SpeedButtonRename->Down || SpeedButtonSaveAs->Down)Edit4->SetFocus(); if (ComboBoxView->ItemIndex != 0 && isPreview->Checked) ImagePreview(n); } else {FileName = ""; ImagePreview(-1);} } //---------------------------------------------------------------------------