Ignore:
Timestamp:
May 17, 2015, 10:51:50 PM (10 years ago)
Author:
chronos
Message:
  • Added: Commit form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormBrowse.pas

    r6 r7  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ExtCtrls, UFindFile;
     9  ExtCtrls, Menus, ActnList, UFindFile;
    1010
    1111type
     
    1414
    1515  TFormBrowse = class(TForm)
     16    AAdd: TAction;
     17    AOpen: TAction;
     18    AProperties: TAction;
     19    AUpdate: TAction;
     20    ARename: TAction;
     21    ADelete: TAction;
     22    ActionList1: TActionList;
    1623    ListView1: TListView;
     24    MenuItem1: TMenuItem;
     25    MenuItem2: TMenuItem;
     26    MenuItem3: TMenuItem;
     27    MenuItem4: TMenuItem;
     28    MenuItem5: TMenuItem;
     29    MenuItem6: TMenuItem;
     30    PopupMenu1: TPopupMenu;
    1731    Splitter1: TSplitter;
    1832    TreeView1: TTreeView;
     33    procedure ADeleteExecute(Sender: TObject);
     34    procedure AOpenExecute(Sender: TObject);
    1935    procedure ListView1Data(Sender: TObject; Item: TListItem);
     36    procedure ListView1DblClick(Sender: TObject);
    2037  private
    2138    FileList: TStringList;
     
    4158end;
    4259
     60procedure TFormBrowse.ListView1DblClick(Sender: TObject);
     61begin
     62
     63end;
     64
     65procedure TFormBrowse.ADeleteExecute(Sender: TObject);
     66begin
     67
     68end;
     69
     70procedure TFormBrowse.AOpenExecute(Sender: TObject);
     71begin
     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;
     83end;
     84
    4385procedure TFormBrowse.ReloadList;
    4486var
     
    4890  FindFile := TFindFile.Create(nil);
    4991  FindFile.Path := Directory;
    50   FindFile.FileMask := '*.*';
     92  FindFile.FileMask := AllFilesMask;
    5193  FindFile.InSubFolders := False;
    5294  FileList := FindFile.SearchForFiles;
    5395  for I := FileList.Count - 1 downto 0 do
    5496    if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I);
     97  FileList.Sort;
    5598  ListView1.Items.Count := FileList.Count;
    5699  ListView1.Refresh;
Note: See TracChangeset for help on using the changeset viewer.