Changeset 7 for trunk/Forms


Ignore:
Timestamp:
May 17, 2015, 10:51:50 PM (10 years ago)
Author:
chronos
Message:
  • Added: Commit form.
Location:
trunk/Forms
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormBrowse.lfm

    r6 r7  
    1414    Width = 241
    1515    Align = alLeft
    16     DefaultItemHeight = 24
     16    DefaultItemHeight = 28
    1717    TabOrder = 0
    1818  end
     
    5151      end>
    5252    OwnerData = True
     53    PopupMenu = PopupMenu1
    5354    ReadOnly = True
    5455    RowSelect = True
     56    SmallImages = Core.ImageList1
    5557    TabOrder = 2
    5658    ViewStyle = vsReport
    5759    OnData = ListView1Data
     60    OnDblClick = AOpenExecute
     61  end
     62  object PopupMenu1: TPopupMenu
     63    Images = Core.ImageList1
     64    left = 353
     65    top = 131
     66    object MenuItem1: TMenuItem
     67      Action = AAdd
     68    end
     69    object MenuItem2: TMenuItem
     70      Action = ADelete
     71    end
     72    object MenuItem3: TMenuItem
     73      Action = ARename
     74    end
     75    object MenuItem4: TMenuItem
     76      Action = AUpdate
     77    end
     78    object MenuItem5: TMenuItem
     79      Action = AProperties
     80    end
     81    object MenuItem6: TMenuItem
     82      Action = AOpen
     83    end
     84  end
     85  object ActionList1: TActionList
     86    Images = Core.ImageList1
     87    left = 352
     88    top = 208
     89    object AAdd: TAction
     90      Caption = 'Add'
     91    end
     92    object ADelete: TAction
     93      Caption = 'Delete'
     94      OnExecute = ADeleteExecute
     95    end
     96    object ARename: TAction
     97      Caption = 'Rename'
     98    end
     99    object AUpdate: TAction
     100      Caption = 'Update'
     101    end
     102    object AProperties: TAction
     103      Caption = 'Properties'
     104    end
     105    object AOpen: TAction
     106      Caption = 'Open'
     107      OnExecute = AOpenExecute
     108    end
    58109  end
    59110end
  • 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;
  • trunk/Forms/UFormSettings.lfm

    r3 r7  
    77  ClientHeight = 497
    88  ClientWidth = 686
    9   LCLVersion = '1.1'
    10   object Button1: TButton
     9  LCLVersion = '1.5'
     10  object ButtonCancel: TButton
    1111    Left = 592
    1212    Height = 25
    1313    Top = 464
    1414    Width = 75
    15     Caption = 'Button1'
     15    Caption = 'Cancel'
     16    ModalResult = 2
    1617    TabOrder = 0
    1718  end
    18   object Button2: TButton
     19  object ButtonOk: TButton
    1920    Left = 496
    2021    Height = 25
    2122    Top = 464
    2223    Width = 75
    23     Caption = 'Button2'
     24    Caption = 'Ok'
     25    ModalResult = 1
    2426    TabOrder = 1
    2527  end
  • trunk/Forms/UFormSettings.pas

    r3 r7  
    1313
    1414  TFormSettings = class(TForm)
    15     Button1: TButton;
    16     Button2: TButton;
     15    ButtonCancel: TButton;
     16    ButtonOk: TButton;
    1717  private
    1818    { private declarations }
Note: See TracChangeset for help on using the changeset viewer.