Changeset 508 for ProjectTemplates
- Timestamp:
- Mar 29, 2018, 10:59:19 AM (7 years ago)
- Location:
- ProjectTemplates/FileMenuProject
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ProjectTemplates/FileMenuProject/Forms/UFormMain.pas
r507 r508 104 104 begin 105 105 Core.Initialize; 106 Core.PersistentForm1.Load(Self );106 Core.PersistentForm1.Load(Self, True); 107 107 Core.ThemeManager1.UseTheme(Self); 108 108 SetToolbarHints; -
ProjectTemplates/FileMenuProject/UCore.pas
r507 r508 244 244 FileClose; 245 245 if FileClosed then begin 246 DataFile := TDataFile.Create;246 DataFile := DataFileClass.Create; 247 247 DataFile.OnModify := FileModified; 248 248 end; … … 312 312 if FileNameOption <> '' then begin 313 313 // Open file specified as command line parameter 314 AFileNew.Execute;314 FileNew; 315 315 DataFile.LoadFromFile(FileNameOption); 316 316 LastOpenedList1.AddItem(FileNameOption); … … 318 318 if (LastOpenedList1.Items.Count > 0) and FileExists(LastOpenedList1.Items[0]) then begin 319 319 // Open last opened file 320 AFileNew.Execute;320 FileNew; 321 321 DataFile.LoadFromFile(LastOpenedList1.Items[0]) 322 322 end; -
ProjectTemplates/FileMenuProject/UDataFile.pas
r507 r508 15 15 FFileName: string; 16 16 FModified: Boolean; 17 FOnDestroy: TNotifyEvent; 17 18 FOnModify: TNotifyEvent; 18 19 procedure SetFileName(AValue: string); … … 24 25 procedure SaveToFile(FileName: string); virtual; 25 26 constructor Create; virtual; 27 destructor Destroy; override; 26 28 property FileName: string read FFileName write SetFileName; 27 29 property Modified: Boolean read FModified write SetModified; 28 30 property OnModify: TNotifyEvent read FOnModify write FOnModify; 31 property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy; 29 32 end; 30 33 … … 81 84 end; 82 85 86 destructor TDataFile.Destroy; 87 begin 88 if Assigned(FOnDestroy) then FOnDestroy(Self); 89 inherited Destroy; 90 end; 91 83 92 procedure TDataFile.SetFileName(AValue: string); 84 93 begin
Note:
See TracChangeset
for help on using the changeset viewer.