Changeset 7 for trunk/Forms/UFormBrowse.pas
- Timestamp:
- May 17, 2015, 10:51:50 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormBrowse.pas
r6 r7 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ExtCtrls, UFindFile;9 ExtCtrls, Menus, ActnList, UFindFile; 10 10 11 11 type … … 14 14 15 15 TFormBrowse = class(TForm) 16 AAdd: TAction; 17 AOpen: TAction; 18 AProperties: TAction; 19 AUpdate: TAction; 20 ARename: TAction; 21 ADelete: TAction; 22 ActionList1: TActionList; 16 23 ListView1: TListView; 24 MenuItem1: TMenuItem; 25 MenuItem2: TMenuItem; 26 MenuItem3: TMenuItem; 27 MenuItem4: TMenuItem; 28 MenuItem5: TMenuItem; 29 MenuItem6: TMenuItem; 30 PopupMenu1: TPopupMenu; 17 31 Splitter1: TSplitter; 18 32 TreeView1: TTreeView; 33 procedure ADeleteExecute(Sender: TObject); 34 procedure AOpenExecute(Sender: TObject); 19 35 procedure ListView1Data(Sender: TObject; Item: TListItem); 36 procedure ListView1DblClick(Sender: TObject); 20 37 private 21 38 FileList: TStringList; … … 41 58 end; 42 59 60 procedure TFormBrowse.ListView1DblClick(Sender: TObject); 61 begin 62 63 end; 64 65 procedure TFormBrowse.ADeleteExecute(Sender: TObject); 66 begin 67 68 end; 69 70 procedure TFormBrowse.AOpenExecute(Sender: TObject); 71 begin 72 if Assigned(ListView1.Selected) then 73 with ListView1.Selected do begin 74 if Caption = '..' then begin 75 Directory := ExtractFileDir(Directory); 76 ReloadList; 77 end else 78 if DirectoryExistsUTF8(Directory + DirectorySeparator + Caption) then begin 79 Directory := Directory + DirectorySeparator + ListView1.Selected.Caption; 80 ReloadList; 81 end; 82 end; 83 end; 84 43 85 procedure TFormBrowse.ReloadList; 44 86 var … … 48 90 FindFile := TFindFile.Create(nil); 49 91 FindFile.Path := Directory; 50 FindFile.FileMask := '*.*';92 FindFile.FileMask := AllFilesMask; 51 93 FindFile.InSubFolders := False; 52 94 FileList := FindFile.SearchForFiles; 53 95 for I := FileList.Count - 1 downto 0 do 54 96 if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I); 97 FileList.Sort; 55 98 ListView1.Items.Count := FileList.Count; 56 99 ListView1.Refresh;
Note:
See TracChangeset
for help on using the changeset viewer.