Changeset 26 for trunk


Ignore:
Timestamp:
May 9, 2016, 3:34:24 PM (9 years ago)
Author:
chronos
Message:
  • Added: Open file name given by command line parameter.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r22 r26  
    8686    procedure CheckBoxExactMathChange(Sender: TObject);
    8787    procedure EditSearchChange(Sender: TObject);
     88    procedure FormShow(Sender: TObject);
    8889    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    8990    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
    9091    procedure FormCreate(Sender: TObject);
    9192    procedure FormDestroy(Sender: TObject);
    92     procedure FormShow(Sender: TObject);
    9393    procedure LastOpenedList1Change(Sender: TObject);
    9494    procedure ListViewAcronymsData(Sender: TObject; Item: TListItem);
     
    318318  PersistentForm1.Load(Self);
    319319
    320   if (LastOpenedList1.Items.Count > 0) and  FileExists(LastOpenedList1.Items[0]) then
     320  if ParamCount > 0 then begin
     321    AcronymDB.LoadFromFile(ParamStr(1));
     322    LastOpenedList1.AddItem(OpenDialog1.FileName);
     323  end else
     324  if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then
    321325    AcronymDB.LoadFromFile(LastOpenedList1.Items[0]);
    322326  UpdateAcronymsList;
Note: See TracChangeset for help on using the changeset viewer.