Changeset 136 for trunk/UCore.pas


Ignore:
Timestamp:
Mar 5, 2022, 4:14:27 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Update recent files list in registry immediately.
  • Fixed: Regresion in debugging step in and step out.
  • Fixed: Of by one index in loop start command interpretation.
  • Fixed: Correctly load directory and file name into open and save dialogs.
  • Modified: Faster interval for program output refresh.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r135 r136  
    2929    FCurrentTarget: TTarget;
    3030    StoredDimension: TControlDimension;
     31    RecentFileRegistryContext: TRegistryContext;
    3132    procedure InitTargets;
    3233    procedure SetCurrentTarget(AValue: TTarget);
     
    4647    Optimizations: TOptimizations;
    4748    procedure Init;
     49    procedure AddItemToLastOpenedList(FileName: string);
    4850    procedure LoadFromRegistry(Context: TRegistryContext);
    4951    procedure SaveToRegistry(Context: TRegistryContext);
     
    6971
    7072{ TCore }
     73
     74procedure TCore.AddItemToLastOpenedList(FileName: string);
     75begin
     76  with LastOpenedList do begin
     77    LoadFromRegistry(RecentFileRegistryContext);
     78    AddItem(FileName);
     79    SaveToRegistry(RecentFileRegistryContext);
     80  end;
     81end;
    7182
    7283procedure TCore.DataModuleCreate(Sender: TObject);
     
    91102  StoredDimension := TControlDimension.Create;
    92103  InitTargets;
     104  RecentFileRegistryContext := TRegistryContext.Create(ApplicationInfo.RegistryRoot,
     105    ApplicationInfo.RegistryKey + '\' + RecentFilesRegKey);
    93106  LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext);
    94107end;
     
    149162    Free;
    150163  end;
    151   LastOpenedList.LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + RecentFilesRegKey));
    152164  Targets.LoadFromRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\Compiler'));
     165  LastOpenedList.LoadFromRegistry(RecentFileRegistryContext);
    153166  PersistentForm1.RegistryContext := Context;
    154167end;
     
    157170begin
    158171  Targets.SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\Compiler'));
    159   LastOpenedList.SaveToRegistry(TRegistryContext.Create(Context.RootKey, Context.Key + '\' + RecentFilesRegKey));
    160172  with TRegistryEx.Create do
    161173  try
Note: See TracChangeset for help on using the changeset viewer.