Changeset 162
- Timestamp:
- Jul 17, 2018, 11:50:38 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator/Forms/UFormMain.pas
r137 r162 224 224 procedure TFormMain.ProjectOpen(FileName: string); 225 225 begin 226 if Assigned(Core.Grammer) then FreeAndNil(Core.Grammer); 227 LastOpenedList1.AddItem(FileName); 228 Core.Grammer := TGrammer.Create; 229 Core.Grammer.OnChange := GrammerChange; 230 Core.Grammer.OnDestroy := GrammerDestroy; 231 Core.Grammer.LoadFromXmlFile(FileName); 232 Core.Grammer.Change; 226 AProjectClose.Execute; 227 if not Assigned(Core.Grammer) then begin 228 LastOpenedList1.AddItem(FileName); 229 ProjectNew; 230 Core.Grammer := TGrammer.Create; 231 Core.Grammer.OnChange := GrammerChange; 232 Core.Grammer.OnDestroy := GrammerDestroy; 233 Core.Grammer.LoadFromXmlFile(FileName); 234 Core.Grammer.Change; 235 end; 233 236 end; 234 237 … … 326 329 procedure TFormMain.AProjectOpenExecute(Sender: TObject); 327 330 begin 328 AProjectClose.Execute; 329 if not Assigned(Core.Grammer) then begin 330 OpenDialog1.InitialDir := ExtractFileDir(LastOpenedList1.GetFirstFileName); 331 OpenDialog1.FileName := ExtractFileName(LastOpenedList1.GetFirstFileName); 332 if OpenDialog1.Execute then begin 333 ProjectOpen(OpenDialog1.FileName); 334 end; 331 OpenDialog1.InitialDir := ExtractFileDir(LastOpenedList1.GetFirstFileName); 332 OpenDialog1.FileName := ExtractFileName(LastOpenedList1.GetFirstFileName); 333 if OpenDialog1.Execute then begin 334 ProjectOpen(OpenDialog1.FileName); 335 335 end; 336 336 end;
Note:
See TracChangeset
for help on using the changeset viewer.