Changeset 9 for trunk/StudioPackage/UDataModule.pas
- Timestamp:
- Aug 3, 2012, 1:34:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StudioPackage/UDataModule.pas
r8 r9 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UProject, Forms, SpecializedList, USource; 8 Classes, SysUtils, FileUtil, UProject, Forms, SpecializedList, USource, 9 UModularSystem, ULDStudioAPI; 9 10 10 11 type … … 30 31 FOnOpenFile: TOpenFileEvent; 31 32 public 33 Selected: TOpenedFile; 34 procedure CloseFile(OpenedFile: TOpenedFile); 32 35 procedure OpenFile(FileName: string); 33 36 procedure NewFile; … … 41 44 procedure DataModuleDestroy(Sender: TObject); 42 45 private 43 { private declarations }46 API: TLDStudioAPI; 44 47 public 48 ModuleManager: TModuleManager; 45 49 Project: TProject; 46 50 FileTypes: TFileTypes; … … 57 61 58 62 uses 59 UFormSourceCode, UFormMain, UFormProject, UFormSettings ;63 UFormSourceCode, UFormMain, UFormProject, UFormSettings, UFormModuleList; 60 64 61 65 procedure TOpenedFile.SetFileName(AValue: string); … … 69 73 { TOpenedFiles } 70 74 75 procedure TOpenedFiles.CloseFile(OpenedFile: TOpenedFile); 76 begin 77 FreeAndNil(OpenedFile.Form); 78 end; 79 71 80 procedure TOpenedFiles.OpenFile(FileName: string); 72 81 var … … 78 87 NewFile.Form.Caption := ExtractFileName(NewFile.FileName); 79 88 NewFile.Form.Visible := True; 89 Selected := NewFile; 80 90 if Assigned(FOnOpenFile) then 81 91 FOnOpenFile(NewFile); … … 94 104 FileTypes.OwnsObjects := False; 95 105 OpenedFiles := TOpenedFiles.Create; 106 API := TLDStudioAPI.Create; 107 ModuleManager := TModuleManager.Create(nil); 108 ModuleManager.API := API; 96 109 97 110 Application.CreateForm(TFormMain, FormMain); … … 100 113 Application.CreateForm(TFormSourceCode, FormSourceCode); 101 114 Application.CreateForm(TFormSettings, FormSettings); 115 Application.CreateForm(TFormModuleList, FormModuleList); 116 117 TLDStudioAPI(ModuleManager.API).MainForm := FormMain; 118 TLDStudioAPI(ModuleManager.API).MainMenu := FormMain.MainMenu; 119 TLDStudioAPI(ModuleManager.API).FileTypes := FileTypes; 102 120 end; 103 121 104 122 procedure TDataModule1.DataModuleDestroy(Sender: TObject); 105 123 begin 124 FreeAndNil(ModuleManager); 125 FreeAndNil(API); 106 126 FreeAndNil(OpenedFiles); 107 127 FreeAndNil(FileTypes);
Note:
See TracChangeset
for help on using the changeset viewer.