Changeset 57 for trunk


Ignore:
Timestamp:
Mar 4, 2013, 11:15:36 PM (12 years ago)
Author:
chronos
Message:
  • Added: Remember last opened file name.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r53 r57  
    150150    procedure LastOpenedListChange(Sender: TObject);
    151151  public
     152    LastFileName: string;
    152153    procedure LoadFromRegistry(Root: HKEY; Key: string);
    153154    procedure SaveToRegistry(Root: HKEY; Key: string);
     
    302303    OpenKey(Key, True);
    303304    TargetName := ReadStringWithDefault('TargetName', 'Interpretter');
     305    LastFileName := ReadStringWithDefault('LastFileName',
     306      ExtractFileDir(Application.ExeName) + DirectorySeparator + 'Examples');
    304307    CurrentTarget := Core.Targets.FindByName(TargetName);
    305308    if not Assigned(CurrentTarget) then CurrentTarget := TTarget(Core.Targets[0]);
     
    316319    OpenKey(Key, True);
    317320    WriteString('TargetName', CurrentTarget.Name);
     321    WriteString('LastFileName', LastFileName);
    318322  finally
    319323    Free;
     
    565569begin
    566570  AProjectClose.Execute;
    567   OpenDialog1.FileName := Core.ProjectFileName;
     571  OpenDialog1.FileName := LastFileName;
     572  OpenDialog1.InitialDir := ExtractFileDir(LastFileName);
    568573  if OpenDialog1.Execute then begin
     574    LastFileName := OpenDialog1.FileName;
    569575    ProjectOpen(OpenDialog1.FileName);
    570576  end;
Note: See TracChangeset for help on using the changeset viewer.