Changeset 136 for trunk/Forms


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.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r133 r136  
    547547  end
    548548  object TimerRefresh: TTimer
     549    Interval = 200
    549550    OnTimer = TimerRefreshTimer
    550551    Left = 70
  • trunk/Forms/UFormMain.pas

    r134 r136  
    189189  SFileNotFound = 'File %s not found.';
    190190
     191const
     192  ExamplesDir = 'Examples';
     193
    191194{ TFormMain }
    192195
     
    259262    raise Exception.Create(SCloseProjectFirst);
    260263  FormSourceCode.SynEditSource.Lines.LoadFromFile(FileName);
    261   Core.LastOpenedList.AddItem(FileName);
     264  Core.AddItemToLastOpenedList(FileName);
    262265  Core.Project.FileName := FileName;
    263266  Core.Project.Openned := True;
     
    663666  AProjectClose.Execute;
    664667  if Core.Project.Openned then Exit;
    665   Core.Project.FileName := CombinePaths(Core.DataDir, 'Examples' + DirectorySeparator + SNewProject + '.b');
     668  Core.Project.FileName := CombinePaths(Core.DataDir, ExamplesDir + DirectorySeparator + SNewProject + '.b');
    666669  FormSourceCode.SynEditSource.Clear;
    667670  Core.Project.Openned := True;
     
    683686
    684687procedure TFormMain.AProjectOpenExecute(Sender: TObject);
     688var
     689  FileName: string;
    685690begin
    686691  if Core.LastOpenedList.Items.Count > 0 then
    687     OpenDialog1.FileName := Core.LastOpenedList.Items[0]
    688     else OpenDialog1.FileName := CombinePaths(Core.DataDir, 'Examples');
    689   OpenDialog1.InitialDir := ExtractFileDir(OpenDialog1.FileName);
     692    FileName := Core.LastOpenedList.Items[0]
     693    else FileName := CombinePaths(Core.DataDir, ExamplesDir);
     694  OpenDialog1.InitialDir := ExtractFileDir(FileName);
     695  OpenDialog1.FileName := ExtractFileName(FileName);
    690696  if OpenDialog1.Execute then begin
    691697    AProjectClose.Execute;
     
    697703procedure TFormMain.AProjectSaveAsExecute(Sender: TObject);
    698704begin
    699   SaveDialog1.FileName := Core.Project.FileName;
     705  SaveDialog1.InitialDir := ExtractFileDir(Core.Project.FileName);
     706  SaveDialog1.FileName := ExtractFileName(Core.Project.FileName);
    700707  if SaveDialog1.Execute then begin
    701708    FormSourceCode.SynEditSource.Lines.SaveToFile(SaveDialog1.FileName);
    702709    Core.Project.FileName := SaveDialog1.FileName;
    703     Core.LastOpenedList.AddItem(SaveDialog1.FileName);
     710    Core.AddItemToLastOpenedList(SaveDialog1.FileName);
    704711    Core.Project.Modified := False;
    705712    UpdateInterface;
     
    711718  if Core.Project.Modified and FileExists(Core.Project.FileName) then begin
    712719    FormSourceCode.SynEditSource.Lines.SaveToFile(Core.Project.FileName);
     720    Core.AddItemToLastOpenedList(Core.Project.FileName);
    713721    Core.Project.Modified := False;
    714722    UpdateInterface;
Note: See TracChangeset for help on using the changeset viewer.