Changeset 136 for trunk/Forms
- Timestamp:
- Mar 5, 2022, 4:14:27 PM (3 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r133 r136 547 547 end 548 548 object TimerRefresh: TTimer 549 Interval = 200 549 550 OnTimer = TimerRefreshTimer 550 551 Left = 70 -
trunk/Forms/UFormMain.pas
r134 r136 189 189 SFileNotFound = 'File %s not found.'; 190 190 191 const 192 ExamplesDir = 'Examples'; 193 191 194 { TFormMain } 192 195 … … 259 262 raise Exception.Create(SCloseProjectFirst); 260 263 FormSourceCode.SynEditSource.Lines.LoadFromFile(FileName); 261 Core. LastOpenedList.AddItem(FileName);264 Core.AddItemToLastOpenedList(FileName); 262 265 Core.Project.FileName := FileName; 263 266 Core.Project.Openned := True; … … 663 666 AProjectClose.Execute; 664 667 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'); 666 669 FormSourceCode.SynEditSource.Clear; 667 670 Core.Project.Openned := True; … … 683 686 684 687 procedure TFormMain.AProjectOpenExecute(Sender: TObject); 688 var 689 FileName: string; 685 690 begin 686 691 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); 690 696 if OpenDialog1.Execute then begin 691 697 AProjectClose.Execute; … … 697 703 procedure TFormMain.AProjectSaveAsExecute(Sender: TObject); 698 704 begin 699 SaveDialog1.FileName := Core.Project.FileName; 705 SaveDialog1.InitialDir := ExtractFileDir(Core.Project.FileName); 706 SaveDialog1.FileName := ExtractFileName(Core.Project.FileName); 700 707 if SaveDialog1.Execute then begin 701 708 FormSourceCode.SynEditSource.Lines.SaveToFile(SaveDialog1.FileName); 702 709 Core.Project.FileName := SaveDialog1.FileName; 703 Core. LastOpenedList.AddItem(SaveDialog1.FileName);710 Core.AddItemToLastOpenedList(SaveDialog1.FileName); 704 711 Core.Project.Modified := False; 705 712 UpdateInterface; … … 711 718 if Core.Project.Modified and FileExists(Core.Project.FileName) then begin 712 719 FormSourceCode.SynEditSource.Lines.SaveToFile(Core.Project.FileName); 720 Core.AddItemToLastOpenedList(Core.Project.FileName); 713 721 Core.Project.Modified := False; 714 722 UpdateInterface;
Note:
See TracChangeset
for help on using the changeset viewer.