Ignore:
Timestamp:
May 6, 2015, 11:19:49 AM (10 years ago)
Author:
chronos
Message:
  • Added: Now opened projects are remembered between application restarts.
  • Added: Show basic list of files in selected project.
  • Added: Packages Common and TemplateGenerics.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormBrowse.pas

    r3 r6  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ExtCtrls;
     9  ExtCtrls, UFindFile;
    1010
    1111type
     
    1717    Splitter1: TSplitter;
    1818    TreeView1: TTreeView;
     19    procedure ListView1Data(Sender: TObject; Item: TListItem);
    1920  private
    20     { private declarations }
     21    FileList: TStringList;
    2122  public
     23    Directory: string;
    2224    procedure ReloadList;
    2325  end;
     
    3234{ TFormBrowse }
    3335
     36procedure TFormBrowse.ListView1Data(Sender: TObject; Item: TListItem);
     37begin
     38  if (Item.Index >= 0) and (Item.Index < FileList.Count) then begin
     39    Item.Caption := ExtractFileName(FileList[Item.Index]);
     40  end;
     41end;
     42
    3443procedure TFormBrowse.ReloadList;
     44var
     45  FindFile: TFindFile;
     46  I: Integer;
    3547begin
    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;
    3757end;
    3858
Note: See TracChangeset for help on using the changeset viewer.