Changeset 15 for trunk/StudioPackage
- Timestamp:
- Aug 6, 2012, 2:35:22 PM (12 years ago)
- Location:
- trunk/StudioPackage
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StudioPackage/Forms/UFormMain.lfm
r14 r15 1 1 object FormMain: TFormMain 2 Left = 1502 Left = 240 3 3 Height = 520 4 Top = 1 124 Top = 108 5 5 Width = 747 6 6 Caption = 'LibreDevelop Studio' … … 27 27 Width = 747 28 28 Caption = 'ToolBar1' 29 Images = DataModule1.ImageListMain 29 30 TabOrder = 1 30 31 object ToolButton1: TToolButton 31 32 Left = 1 32 Hint = 'New project'33 33 Top = 2 34 Caption = 'New...' 35 ImageIndex = 4 34 Action = AFileNew 36 35 end 37 36 object ToolButton2: TToolButton 38 37 Left = 24 39 Hint = 'Open project'40 38 Top = 2 41 Caption = 'Open...' 42 ImageIndex = 8 39 Action = AFileOpen 40 DropdownMenu = PopupMenuRecentFiles 41 Style = tbsDropDown 43 42 end 44 43 object ToolButton3: TToolButton 45 Left = 47 46 Hint = 'Save project' 44 Left = 59 47 45 Top = 2 48 Caption = 'Save' 49 ImageIndex = 13 46 Action = AFileSaveAs 50 47 end 51 48 object ToolButton4: TToolButton 52 Left = 70 53 Hint = 'Close project' 49 Left = 82 54 50 Top = 2 55 Caption = 'Close' 56 ImageIndex = 3 51 Action = AFileClose 57 52 end 58 53 end … … 117 112 Action = AFileOpen 118 113 end 119 object MenuItem29: TMenuItem 120 Action = AFileOpenRecent 114 object MenuItemFileOpenRecent: TMenuItem 115 Caption = 'Open recent' 116 ImageIndex = 8 117 OnClick = MenuItemFileOpenRecentClick 121 118 end 122 119 object MenuItem30: TMenuItem … … 313 310 Caption = 'Open recent' 314 311 ImageIndex = 8 312 OnExecute = AFileOpenRecentExecute 315 313 end 316 314 object AFileSave: TAction … … 318 316 Caption = 'Save' 319 317 ImageIndex = 13 318 OnExecute = AFileSaveExecute 320 319 ShortCut = 16467 321 320 end … … 324 323 Caption = 'Save as...' 325 324 ImageIndex = 13 325 OnExecute = AFileSaveAsExecute 326 326 ShortCut = 24659 327 327 end … … 387 387 top = 272 388 388 end 389 object LastOpenedList1: TLastOpenedList 390 MaxCount = 10 391 OnChange = LastOpenedList1Change 392 left = 80 393 top = 160 394 end 395 object PopupMenuRecentFiles: TPopupMenu 396 Images = DataModule1.ImageListMain 397 left = 259 398 top = 69 399 end 389 400 end -
trunk/StudioPackage/Forms/UFormMain.lrt
r14 r15 1 1 TFORMMAIN.CAPTION=LibreDevelop Studio 2 2 TFORMMAIN.TOOLBAR1.CAPTION=ToolBar1 3 TFORMMAIN.TOOLBUTTON1.HINT=New project4 TFORMMAIN.TOOLBUTTON1.CAPTION=New...5 TFORMMAIN.TOOLBUTTON2.HINT=Open project6 TFORMMAIN.TOOLBUTTON2.CAPTION=Open...7 TFORMMAIN.TOOLBUTTON3.HINT=Save project8 TFORMMAIN.TOOLBUTTON3.CAPTION=Save9 TFORMMAIN.TOOLBUTTON4.HINT=Close project10 TFORMMAIN.TOOLBUTTON4.CAPTION=Close11 3 TFORMMAIN.MENUITEM26.CAPTION=File 4 TFORMMAIN.MENUITEMFILEOPENRECENT.CAPTION=Open recent 12 5 TFORMMAIN.MENUITEM33.CAPTION=- 13 6 TFORMMAIN.MENUITEM2.CAPTION=Edit -
trunk/StudioPackage/Forms/UFormMain.pas
r14 r15 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, 9 ActnList, ComCtrls, ExtCtrls, UDataModule; 9 ActnList, ComCtrls, ExtCtrls, ULastOpenedList, UCoolTranslator, UDataModule, 10 URegistry; 10 11 11 12 type … … 44 45 AClipboardCut: TAction; 45 46 ActionListMain: TActionList; 47 LastOpenedList1: TLastOpenedList; 46 48 MainMenu: TMainMenu; 47 49 MenuItem15: TMenuItem; … … 60 62 MenuItem27: TMenuItem; 61 63 MenuItem28: TMenuItem; 62 MenuItem 29: TMenuItem;64 MenuItemFileOpenRecent: TMenuItem; 63 65 MenuItem30: TMenuItem; 64 66 MenuItem31: TMenuItem; … … 89 91 PageControlBottom: TPageControl; 90 92 PageControlCenter: TPageControl; 93 PopupMenuRecentFiles: TPopupMenu; 91 94 SaveDialogFile: TSaveDialog; 92 95 Splitter1: TSplitter; … … 102 105 procedure AFileNewExecute(Sender: TObject); 103 106 procedure AFileOpenExecute(Sender: TObject); 107 procedure AFileOpenRecentExecute(Sender: TObject); 108 procedure AFileSaveAsExecute(Sender: TObject); 109 procedure AFileSaveExecute(Sender: TObject); 104 110 procedure AViewModulesExecute(Sender: TObject); 105 111 procedure AViewSettingsExecute(Sender: TObject); … … 108 114 procedure FormDestroy(Sender: TObject); 109 115 procedure FormShow(Sender: TObject); 116 procedure LastOpenedList1Change(Sender: TObject); 117 procedure MenuItemFileOpenRecentClick(Sender: TObject); 110 118 private 111 119 procedure DockInit; 112 120 public 121 procedure UpdateInterface; 113 122 procedure OpenedFileChange(Sender: TObject); 123 procedure LoadFromRegistry(Context: TRegistryContext); 124 procedure SaveToRegistry(Context: TRegistryContext); 114 125 end; 115 126 … … 117 128 FormMain: TFormMain; 118 129 130 119 131 implementation 120 132 … … 122 134 123 135 uses 124 UFormSourceCode, UFormSettings, UFormModuleList ;136 UFormSourceCode, UFormSettings, UFormModuleList, UFormNewFile, USource; 125 137 126 138 { TFormMain } … … 133 145 procedure TFormMain.AFileCloseExecute(Sender: TObject); 134 146 begin 135 DataModule1.OpenedFiles.CloseFile(DataModule1.OpenedFiles.Selected .FileName);147 DataModule1.OpenedFiles.CloseFile(DataModule1.OpenedFiles.Selected); 136 148 end; 137 149 138 150 procedure TFormMain.AFileNewExecute(Sender: TObject); 139 begin 140 DataModule1.OpenedFiles.NewFile; 151 var 152 NewFile: TSource; 153 begin 154 if FormNewFile.ShowModal = mrOk then 155 if Assigned(FormNewFile.ListView1.Selected) then begin 156 NewFile := TFileTemplate(FormNewFile.ListView1.Selected.Data).Execute; 157 DataModule1.OpenedFiles.OpenFile(NewFile); 158 end; 141 159 end; 142 160 … … 145 163 OpenDialogFile.Filter := DataModule1.FileTypes.GetDialogFilter; 146 164 if OpenDialogFile.Execute then begin 147 DataModule1.OpenedFiles.OpenFile(OpenDialogFile.FileName); 148 end; 165 LastOpenedList1.AddItem(OpenDialogFile.FileName); 166 DataModule1.OpenedFiles.OpenFileName(OpenDialogFile.FileName); 167 end; 168 end; 169 170 procedure TFormMain.AFileOpenRecentExecute(Sender: TObject); 171 begin 172 if Sender is TMenuItem then 173 DataModule1.OpenedFiles.OpenFileName(TMenuItem(Sender).Caption); 174 end; 175 176 procedure TFormMain.AFileSaveAsExecute(Sender: TObject); 177 begin 178 SaveDialogFile.FileName := DataModule1.OpenedFiles.Selected.Name; 179 if SaveDialogFile.Execute then begin 180 LastOpenedList1.AddItem(SaveDialogFile.FileName); 181 DataModule1.OpenedFiles.Selected.Name := SaveDialogFile.FileName; 182 end; 183 end; 184 185 procedure TFormMain.AFileSaveExecute(Sender: TObject); 186 begin 187 149 188 end; 150 189 … … 177 216 begin 178 217 DockInit; 218 UpdateInterface; 219 end; 220 221 procedure TFormMain.LastOpenedList1Change(Sender: TObject); 222 begin 223 LastOpenedList1.LoadToMenuItem(PopupMenuRecentFiles.Items, AFileOpenRecentExecute); 224 LastOpenedList1.LoadToMenuItem(MenuItemFileOpenRecent, AFileOpenRecentExecute); 225 end; 226 227 procedure TFormMain.MenuItemFileOpenRecentClick(Sender: TObject); 228 begin 229 179 230 end; 180 231 … … 186 237 }end; 187 238 239 procedure TFormMain.UpdateInterface; 240 begin 241 AFileClose.Enabled := Assigned(DataModule1.OpenedFiles.Selected); 242 AFileSave.Enabled := Assigned(DataModule1.OpenedFiles.Selected); 243 AFileSaveAs.Enabled := Assigned(DataModule1.OpenedFiles.Selected); 244 end; 245 188 246 procedure TFormMain.OpenedFileChange(Sender: TObject); 189 247 var … … 193 251 with DataModule1.OpenedFiles do begin 194 252 for I := 0 to Count - 1 do 195 with T OpenedFile(Items[I]) do begin253 with TSource(Items[I]) do begin 196 254 if not Assigned(Form.Parent) then begin 197 255 NewTabSheet := PageControlCenter.AddTabSheet; 198 NewTabSheet.Caption := ExtractFileName( FileName);256 NewTabSheet.Caption := ExtractFileName(Name); 199 257 //NewTabSheet.PopupMenu := ; 200 258 Form.ManualDock(NewTabSheet, nil, alClient); … … 206 264 end; 207 265 266 procedure TFormMain.LoadFromRegistry(Context: TRegistryContext); 267 begin 268 LastOpenedList1.LoadFromRegistry(Context.RootKey, Context.Key + '\RecentFiles'); 269 end; 270 271 procedure TFormMain.SaveToRegistry(Context: TRegistryContext); 272 begin 273 LastOpenedList1.SaveToRegistry(Context.RootKey, Context.Key + '\RecentFiles'); 274 end; 275 208 276 end. 209 277 -
trunk/StudioPackage/Languages/UDataModule.po
r13 r15 6 6 msgstr "" 7 7 8 #: udatamodule.stextfile 9 msgid "Text file" 10 msgstr "" 11 -
trunk/StudioPackage/LibreDevelopStudio.lpk
r11 r15 23 23 </Other> 24 24 </CompilerOptions> 25 <Files Count=" 5">25 <Files Count="6"> 26 26 <Item1> 27 27 <Filename Value="Forms\UFormMain.pas"/> … … 44 44 <UnitName Value="UFormModuleList"/> 45 45 </Item5> 46 <Item6> 47 <Filename Value="Forms\UFormNewFile.pas"/> 48 <UnitName Value="UFormNewFile"/> 49 </Item6> 46 50 </Files> 47 51 <i18n> … … 51 55 </i18n> 52 56 <Type Value="RunAndDesignTime"/> 53 <RequiredPkgs Count=" 5">57 <RequiredPkgs Count="7"> 54 58 <Item1> 55 <PackageName Value=" LDStudioCommon"/>59 <PackageName Value="CoolTranslator"/> 56 60 </Item1> 57 61 <Item2> 58 <PackageName Value=" synedit"/>62 <PackageName Value="Common"/> 59 63 </Item2> 60 64 <Item3> 61 <PackageName Value=" TemplateGenerics"/>65 <PackageName Value="LDStudioCommon"/> 62 66 </Item3> 63 67 <Item4> 64 <PackageName Value=" LCL"/>68 <PackageName Value="synedit"/> 65 69 </Item4> 66 70 <Item5> 71 <PackageName Value="TemplateGenerics"/> 72 </Item5> 73 <Item6> 74 <PackageName Value="LCL"/> 75 </Item6> 76 <Item7> 67 77 <PackageName Value="FCL"/> 68 </Item 5>78 </Item7> 69 79 </RequiredPkgs> 70 80 <UsageOptions> -
trunk/StudioPackage/LibreDevelopStudio.pas
r11 r15 9 9 uses 10 10 UFormMain, UDataModule, UFormSourceCode, UFormSettings, UFormModuleList, 11 LazarusPackageIntf;11 UFormNewFile, LazarusPackageIntf; 12 12 13 13 implementation -
trunk/StudioPackage/UDataModule.lfm
r14 r15 733 733 OnUnregisterMainMenuItem = APIUnregisterMainMenuItem 734 734 OnDockForm = APIDockForm 735 OnGetRegistryContext = APIGetRegistryContext 736 OnRegisterFileTemplate = APIRegisterFileTemplate 737 OnUnregisterFileTemplate = APIUnregisterFileTemplate 735 738 left = 92 736 739 top = 168 737 740 end 741 object CoolTranslator1: TCoolTranslator 742 POFilesFolder = 'Languages' 743 left = 92 744 top = 8 745 end 746 object ApplicationInfo1: TApplicationInfo 747 Identification = 1 748 VersionMajor = 1 749 VersionMinor = 0 750 VersionBugFix = 0 751 VersionSuffix = 'alfa' 752 HomePage = 'http://svn.zdechov.net/trac/LibreDevelop' 753 AuthorsName = 'Chronos' 754 EmailContact = 'robie@centrum.cz' 755 AppName = 'LibreDevelop Studio' 756 ReleaseDate = 41096 757 RegistryKey = '\Software\LibreDevelop\Studio' 758 RegistryRoot = rrKeyCurrentUser 759 left = 92 760 top = 224 761 end 738 762 end -
trunk/StudioPackage/UDataModule.pas
r14 r15 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, ActnList, Controls, SpecializedList, 9 USource, UModularSystem, ULDStudioAPI, Menus, ComCtrls; 9 USource, UModularSystem, UCoolTranslator, ULDStudioAPI, Menus, ComCtrls, 10 Registry, URegistry, UApplicationInfo; 10 11 11 12 type 12 13 13 { T OpenedFile }14 15 T OpenedFile = class16 private17 FFileName: string;18 procedure SetFileName(AValue: string); 19 public20 Modified: Boolean; 21 Form: TForm;22 property FileName: string read FFileName write SetFileName;14 { TTextTemplate } 15 16 TTextTemplate = class(TFileTemplate) 17 constructor Create; override; 18 end; 19 20 { TTextFileType } 21 22 TTextFileType = class(TSourceType) 23 constructor Create; override; 23 24 end; 24 25 … … 29 30 FOnChange: TNotifyEvent; 30 31 public 31 Selected: TOpenedFile; 32 function FindByFileName(Value: string): TOpenedFile; 33 procedure CloseFile(FileName: string); 34 procedure OpenFile(FileName: string); 32 Selected: TSource; 33 function FindByFileName(Value: string): TSource; 34 procedure CloseFile(Source: TSource); 35 procedure OpenFileName(FileName: string); 36 procedure OpenFile(Source: TSource); 35 37 procedure NewFile; 36 38 property OnChange: TNotifyEvent read FOnChange write FOnChange; … … 42 44 published 43 45 ActionListRegistred: TActionList; 46 ApplicationInfo1: TApplicationInfo; 47 CoolTranslator1: TCoolTranslator; 44 48 ImageListMain: TImageList; 45 49 API: TLDStudioAPI; 46 50 procedure APIDockForm(Form: TForm; Target: TDockTarget); 51 function APIGetRegistryContext: TRegistryContext; 52 procedure APIRegisterFileTemplate(Template: TFileTemplate); 47 53 procedure APIRegisterFileType(FileType: TSourceType); 48 54 procedure APIRegisterForm(Form: TForm); … … 50 56 ParentItem: TMenuItem; Index: Integer); 51 57 procedure APIUnregisterAction(Action: TAction); 58 procedure APIUnregisterFileTemplate(Template: TFileTemplate); 52 59 procedure APIUnregisterFileType(FileType: TSourceType); 53 60 procedure APIUnregisterForm(Form: TForm); 54 61 procedure APIUnregisterMainMenuItem(MenuItem: TMenuItem); 62 procedure APIOpenFile(FileName: string); 63 procedure APIRegisterAction(Action: TAction); 55 64 procedure DataModuleCreate(Sender: TObject); 56 65 procedure DataModuleDestroy(Sender: TObject); 57 procedure APIOpenFile(FileName: string);58 procedure APIRegisterAction(Action: TAction);59 66 private 67 TextFileType: TSourceType; 68 TextFileTemplate: TTextTemplate; 69 procedure AutoOpen; 60 70 procedure DockToPageControl(PageControl: TPageControl; Form: TForm); 61 71 public 62 72 ModuleManager: TModuleManager; 63 73 FileTypes: TFileTypes; 74 FileTemplates: TFileTemplates; 64 75 OpenedFiles: TOpenedFiles; 65 end; 76 procedure LoadFromRegistry(Context: TRegistryContext); 77 procedure SaveToRegistry(Context: TRegistryContext); 78 end; 79 66 80 67 81 var … … 74 88 75 89 uses 76 UFormSourceCode, UFormMain, UFormSettings, UFormModuleList ;90 UFormSourceCode, UFormMain, UFormSettings, UFormModuleList, UFormNewFile; 77 91 78 92 resourcestring 79 93 SNewFile = 'New file'; 80 81 procedure TOpenedFile.SetFileName(AValue: string); 82 begin 83 if FFileName = AValue then Exit; 84 FFileName := AValue; 85 if Assigned(Form) then 86 Form.Caption := ExtractFileName(FFileName); 87 end; 94 STextFile = 'Text file'; 95 96 { TTextFileType } 97 98 constructor TTextFileType.Create; 99 begin 100 inherited Create; 101 Extension := '.txt'; 102 Title := 'Text file';; 103 end; 104 105 { TTextTemplate } 106 107 constructor TTextTemplate.Create; 108 begin 109 inherited Create; 110 Name := STextFile; 111 end; 112 88 113 89 114 { TOpenedFiles } 90 115 91 function TOpenedFiles.FindByFileName(Value: string): T OpenedFile;116 function TOpenedFiles.FindByFileName(Value: string): TSource; 92 117 var 93 118 I: Integer; 94 119 begin 95 120 I := 0; 96 while (I < Count) and (T OpenedFile(Items[I]).FileName <> Value) do Inc(I);97 if I < Count then Result := T OpenedFile(Items[I])121 while (I < Count) and (TSource(Items[I]).Name <> Value) do Inc(I); 122 if I < Count then Result := TSource(Items[I]) 98 123 else Result := nil; 99 124 end; 100 125 101 procedure TOpenedFiles.CloseFile(FileName: string); 102 var 103 OpenedFile: TOpenedFile; 104 begin 105 OpenedFile := FindByFileName(FileName); 106 FreeAndNil(OpenedFile.Form); 107 Remove(OpenedFile); 126 procedure TOpenedFiles.CloseFile(Source: TSource); 127 begin 128 FreeAndNil(Source.Form); 129 Remove(Source); 108 130 if Assigned(FOnChange) then FOnChange(Self); 109 131 end; 110 132 111 procedure TOpenedFiles.OpenFile(FileName: string); 112 var 113 NewFile: TOpenedFile; 114 begin 115 NewFile := TOpenedFile(AddNew(TOpenedFile.Create)); 116 NewFile.FileName := FileName; 133 procedure TOpenedFiles.OpenFileName(FileName: string); 134 var 135 NewFile: TSourceText; 136 begin 137 NewFile := TSourceText.Create; 138 NewFile.Name := FileName; 139 OpenFile(NewFile); 140 end; 141 142 procedure TOpenedFiles.OpenFile(Source: TSource); 143 begin 144 AddNew(Source); 145 Source.Form := TFormSourceCode.Create(nil); 146 Source.Form.Caption := ExtractFileName(Source.Name); 147 Source.Form.Visible := True; 148 Selected := Source; 149 if Assigned(FOnChange) then FOnChange(Self); 150 end; 151 152 procedure TOpenedFiles.NewFile; 153 var 154 NewFile: TSource; 155 begin 156 NewFile := TSourceText(AddNew(TSource.Create)); 157 NewFile.Name := SNewFile; 117 158 NewFile.Form := TFormSourceCode.Create(nil); 118 NewFile.Form.Caption := ExtractFileName(NewFile. FileName);159 NewFile.Form.Caption := ExtractFileName(NewFile.Name); 119 160 NewFile.Form.Visible := True; 120 161 Selected := NewFile; … … 122 163 end; 123 164 124 procedure TOpenedFiles.NewFile;125 var126 NewFile: TOpenedFile;127 begin128 NewFile := TOpenedFile(AddNew(TOpenedFile.Create));129 NewFile.FileName := SNewFile;130 NewFile.Form := TFormSourceCode.Create(nil);131 NewFile.Form.Caption := ExtractFileName(NewFile.FileName);132 NewFile.Form.Visible := True;133 Selected := NewFile;134 if Assigned(FOnChange) then FOnChange(Self);135 end;136 137 165 { TDataModule1 } 138 166 139 167 procedure TDataModule1.DataModuleCreate(Sender: TObject); 140 168 begin 169 FileTemplates := TFileTemplates.Create; 170 FileTemplates.OwnsObjects := False; 141 171 FileTypes := TFileTypes.Create; 142 172 FileTypes.OwnsObjects := False; … … 144 174 ModuleManager := TModuleManager.Create(nil); 145 175 ModuleManager.API := API; 176 177 TextFileType := TTextFileType.Create; 178 API.RegisterFileType(TextFileType); 179 TextFileTemplate := TTextTemplate.Create; 180 API.RegisterFileTemplate(TextFileTemplate); 146 181 147 182 FormMain := TFormMain.Create(nil); … … 151 186 FormSettings := TFormSettings.Create(nil); 152 187 FormModuleList := TFormModuleList.Create(nil); 153 188 FormNewFile := TFormNewFile.Create(nil); 189 190 LoadFromRegistry(RegContext(HKEY(ApplicationInfo1.RegistryRoot), ApplicationInfo1.RegistryKey)); 191 192 DataModule1 := Self; 154 193 FormMain.Show; 194 AutoOpen; 155 195 end; 156 196 … … 191 231 end; 192 232 233 procedure TDataModule1.LoadFromRegistry(Context: TRegistryContext); 234 begin 235 with TRegistryEx.Create do 236 try 237 RootKey := Context.RootKey; 238 OpenKey(Context.Key, True); 239 240 finally 241 Free; 242 end; 243 FormMain.LoadFromRegistry(Context); 244 end; 245 246 procedure TDataModule1.SaveToRegistry(Context: TRegistryContext); 247 begin 248 with TRegistryEx.Create do 249 try 250 RootKey := Context.RootKey; 251 OpenKey(Context.Key, True); 252 253 finally 254 Free; 255 end; 256 FormMain.SaveToRegistry(Context); 257 end; 258 193 259 procedure TDataModule1.APIDockForm(Form: TForm; Target: TDockTarget); 194 260 begin … … 203 269 end; 204 270 271 function TDataModule1.APIGetRegistryContext: TRegistryContext; 272 begin 273 Result := RegContext(HKEY(ApplicationInfo1.RegistryRoot), ApplicationInfo1.RegistryKey); 274 end; 275 276 procedure TDataModule1.APIRegisterFileTemplate(Template: TFileTemplate); 277 begin 278 FileTemplates.Add(Template); 279 end; 280 205 281 procedure TDataModule1.APIUnregisterAction(Action: TAction); 206 282 begin … … 208 284 end; 209 285 286 procedure TDataModule1.APIUnregisterFileTemplate(Template: TFileTemplate); 287 begin 288 FileTemplates.Remove(Template); 289 end; 290 210 291 procedure TDataModule1.APIUnregisterFileType(FileType: TSourceType); 211 292 begin … … 220 301 procedure TDataModule1.DataModuleDestroy(Sender: TObject); 221 302 begin 303 API.UnregisterFileType(TextFileType); 304 FreeAndNil(TextFileType); 305 API.UnregisterFileTemplate(TextFileTemplate); 306 FreeAndNil(TextFileTemplate); 307 308 SaveToRegistry(RegContext(HKEY(ApplicationInfo1.RegistryRoot), ApplicationInfo1.RegistryKey)); 222 309 FreeAndNil(ModuleManager); 310 FreeAndNil(FormNewFile); 223 311 FreeAndNil(FormMain); 224 312 FreeAndNil(FormSourceCode); … … 227 315 FreeAndNil(OpenedFiles); 228 316 FreeAndNil(FileTypes); 317 FreeAndNil(FileTemplates); 318 end; 319 320 procedure TDataModule1.AutoOpen; 321 var 322 FileName: string; 323 begin 324 if (ParamCount > 0) then begin 325 FileName := UTF8Encode(ParamStr(1)); 326 if FileExistsUTF8(FileName) then begin 327 OpenedFiles.OpenFileName(FileName); 328 end; 329 end; 229 330 end; 230 331 231 332 procedure TDataModule1.APIOpenFile(FileName: string); 232 333 begin 233 OpenedFiles.OpenFile (FileName);334 OpenedFiles.OpenFileName(FileName); 234 335 end; 235 336
Note:
See TracChangeset
for help on using the changeset viewer.