Changeset 6 for trunk/Forms/UFormBrowse.pas
- Timestamp:
- May 6, 2015, 11:19:49 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormBrowse.pas
r3 r6 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ExtCtrls ;9 ExtCtrls, UFindFile; 10 10 11 11 type … … 17 17 Splitter1: TSplitter; 18 18 TreeView1: TTreeView; 19 procedure ListView1Data(Sender: TObject; Item: TListItem); 19 20 private 20 { private declarations }21 FileList: TStringList; 21 22 public 23 Directory: string; 22 24 procedure ReloadList; 23 25 end; … … 32 34 { TFormBrowse } 33 35 36 procedure TFormBrowse.ListView1Data(Sender: TObject; Item: TListItem); 37 begin 38 if (Item.Index >= 0) and (Item.Index < FileList.Count) then begin 39 Item.Caption := ExtractFileName(FileList[Item.Index]); 40 end; 41 end; 42 34 43 procedure TFormBrowse.ReloadList; 44 var 45 FindFile: TFindFile; 46 I: Integer; 35 47 begin 36 48 FindFile := TFindFile.Create(nil); 49 FindFile.Path := Directory; 50 FindFile.FileMask := '*.*'; 51 FindFile.InSubFolders := False; 52 FileList := FindFile.SearchForFiles; 53 for I := FileList.Count - 1 downto 0 do 54 if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I); 55 ListView1.Items.Count := FileList.Count; 56 ListView1.Refresh; 37 57 end; 38 58
Note:
See TracChangeset
for help on using the changeset viewer.