Changeset 9
- Timestamp:
- Aug 3, 2012, 1:34:09 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Studio/UCore.pas
r8 r9 18 18 procedure RegisterModules; 19 19 public 20 ModuleManager: TModuleManager;21 API: TLDStudioAPI;22 20 procedure Init; 23 21 end; … … 38 36 begin 39 37 DataModule1 := TDataModule1.Create(nil); 40 API := TLDStudioAPI.Create;41 ModuleManager := TModuleManager.Create(nil);42 ModuleManager.API := API;43 38 end; 44 39 45 40 procedure TCore.DataModuleDestroy(Sender: TObject); 46 41 begin 47 FreeAndNil(ModuleManager);48 FreeAndNil(API);49 42 FreeAndNil(DataModule1); 50 43 end; … … 52 45 procedure TCore.RegisterModules; 53 46 begin 54 ModuleManager.RegisterModule(TLDModuleDebug.Create, True); 55 ModuleManager.RegisterModule(TLDModuleBrainfuck.Create, True); 56 ModuleManager.RegisterModule(TLDModulePascal.Create, True); 57 ModuleManager.InstallMarked; 47 with DataModule1.ModuleManager do begin 48 RegisterModule(TLDModuleDebug.Create, True); 49 RegisterModule(TLDModuleBrainfuck.Create, True); 50 RegisterModule(TLDModulePascal.Create, True); 51 InstallMarked; 52 end; 58 53 end; 59 54 60 55 procedure TCore.Init; 61 56 begin 62 TLDStudioAPI(ModuleManager.API).MainForm := FormMain;63 TLDStudioAPI(ModuleManager.API).MainMenu := FormMain.MainMenu;64 TLDStudioAPI(ModuleManager.API).FileTypes := DataModule1.FileTypes;65 57 RegisterModules; 66 58 end; -
trunk/StudioPackage/Forms/UFormMain.lfm
r8 r9 1 1 object FormMain: TFormMain 2 Left = 2 652 Left = 256 3 3 Height = 520 4 Top = 1 444 Top = 122 5 5 Width = 747 6 6 Caption = 'LibreDevelop Studio' … … 391 391 object MenuItem2: TMenuItem 392 392 Caption = 'Edit' 393 object MenuItem36: TMenuItem 394 Action = AUndo 395 end 396 object MenuItem35: TMenuItem 397 Action = ARedo 398 end 399 object MenuItem18: TMenuItem 400 Caption = '-' 401 end 393 402 object MenuItem4: TMenuItem 394 403 Action = AClipboardCopy … … 508 517 } 509 518 end 519 object MenuItem47: TMenuItem 520 Action = ADelete 521 end 510 522 object MenuItem7: TMenuItem 511 523 Action = ASelectAll 524 end 525 end 526 object MenuItem37: TMenuItem 527 Caption = 'Search' 528 object MenuItem38: TMenuItem 529 Action = ASearch 530 end 531 object MenuItem39: TMenuItem 532 Action = ASearchInFiles 533 end 534 object MenuItem40: TMenuItem 535 Action = AFindNext 536 end 537 object MenuItem41: TMenuItem 538 Action = AFindPrevious 539 end 540 object MenuItem42: TMenuItem 541 Caption = '-' 542 end 543 object MenuItem43: TMenuItem 544 Action = AReplace 545 end 546 object MenuItem44: TMenuItem 547 Action = AReplaceInFiles 548 end 549 object MenuItem45: TMenuItem 550 Caption = '-' 551 end 552 object MenuItem46: TMenuItem 553 Action = AGoToLineNumber 512 554 end 513 555 end … … 571 613 } 572 614 end 615 object MenuItem48: TMenuItem 616 Action = AViewModules 617 end 573 618 end 574 619 object MenuItem17: TMenuItem … … 718 763 Caption = 'Close' 719 764 ImageIndex = 3 765 OnExecute = AFileCloseExecute 766 end 767 object AUndo: TAction 768 Category = 'File' 769 Caption = 'Undo' 770 end 771 object ARedo: TAction 772 Category = 'File' 773 Caption = 'Redo' 774 end 775 object ASearch: TAction 776 Category = 'Search' 777 Caption = 'Search' 778 end 779 object AReplace: TAction 780 Category = 'Search' 781 Caption = 'Replace' 782 end 783 object ASearchInFiles: TAction 784 Category = 'Search' 785 Caption = 'Search in files' 786 end 787 object AGoToLineNumber: TAction 788 Category = 'Search' 789 Caption = 'Go to line number...' 790 end 791 object AReplaceInFiles: TAction 792 Category = 'Search' 793 Caption = 'Replace in files' 794 end 795 object AFindNext: TAction 796 Category = 'Search' 797 Caption = 'Find next' 798 ShortCut = 114 799 end 800 object AFindPrevious: TAction 801 Category = 'Search' 802 Caption = 'Find previous' 803 ShortCut = 8306 804 end 805 object ADelete: TAction 806 Category = 'Edit' 807 Caption = 'Delete' 808 end 809 object AViewModules: TAction 810 Caption = 'Modules' 811 OnExecute = AViewModulesExecute 720 812 end 721 813 end -
trunk/StudioPackage/Forms/UFormMain.lrt
r7 r9 10 10 TFORMMAIN.MENUITEM13.CAPTION=- 11 11 TFORMMAIN.MENUITEM2.CAPTION=Edit 12 TFORMMAIN.MENUITEM18.CAPTION=- 13 TFORMMAIN.MENUITEM37.CAPTION=Search 14 TFORMMAIN.MENUITEM42.CAPTION=- 15 TFORMMAIN.MENUITEM45.CAPTION=- 12 16 TFORMMAIN.MENUITEM20.CAPTION=Build 13 17 TFORMMAIN.MENUITEM16.CAPTION=Tools … … 49 53 TFORMMAIN.AFILESAVEAS.CAPTION=Save as... 50 54 TFORMMAIN.AFILECLOSE.CAPTION=Close 55 TFORMMAIN.AUNDO.CAPTION=Undo 56 TFORMMAIN.AREDO.CAPTION=Redo 57 TFORMMAIN.ASEARCH.CAPTION=Search 58 TFORMMAIN.AREPLACE.CAPTION=Replace 59 TFORMMAIN.ASEARCHINFILES.CAPTION=Search in files 60 TFORMMAIN.AGOTOLINENUMBER.CAPTION=Go to line number... 61 TFORMMAIN.AREPLACEINFILES.CAPTION=Replace in files 62 TFORMMAIN.AFINDNEXT.CAPTION=Find next 63 TFORMMAIN.AFINDPREVIOUS.CAPTION=Find previous 64 TFORMMAIN.ADELETE.CAPTION=Delete 65 TFORMMAIN.AVIEWMODULES.CAPTION=Modules -
trunk/StudioPackage/Forms/UFormMain.pas
r8 r9 18 18 ABuild: TAction; 19 19 ABuildClean: TAction; 20 AViewModules: TAction; 21 ADelete: TAction; 22 AFindNext: TAction; 23 AFindPrevious: TAction; 24 AReplaceInFiles: TAction; 25 AGoToLineNumber: TAction; 26 ASearchInFiles: TAction; 27 ASearch: TAction; 28 AReplace: TAction; 29 AUndo: TAction; 30 ARedo: TAction; 20 31 AFileOpenRecent: TAction; 21 32 AFileNew: TAction; … … 50 61 MenuItem16: TMenuItem; 51 62 MenuItem17: TMenuItem; 63 MenuItem18: TMenuItem; 52 64 MenuItem19: TMenuItem; 53 65 MenuItem2: TMenuItem; … … 68 80 MenuItem33: TMenuItem; 69 81 MenuItem34: TMenuItem; 82 MenuItem35: TMenuItem; 83 MenuItem36: TMenuItem; 84 MenuItem37: TMenuItem; 85 MenuItem38: TMenuItem; 86 MenuItem39: TMenuItem; 70 87 MenuItem4: TMenuItem; 88 MenuItem40: TMenuItem; 89 MenuItem41: TMenuItem; 90 MenuItem42: TMenuItem; 91 MenuItem43: TMenuItem; 92 MenuItem44: TMenuItem; 93 MenuItem45: TMenuItem; 94 MenuItem46: TMenuItem; 95 MenuItem47: TMenuItem; 96 MenuItem48: TMenuItem; 71 97 MenuItem5: TMenuItem; 72 98 MenuItem6: TMenuItem; … … 93 119 ToolButton4: TToolButton; 94 120 procedure AExitExecute(Sender: TObject); 121 procedure AFileCloseExecute(Sender: TObject); 95 122 procedure AFileOpenExecute(Sender: TObject); 123 procedure AViewModulesExecute(Sender: TObject); 96 124 procedure AViewProjectManagerExecute(Sender: TObject); 97 125 procedure AViewSettingsExecute(Sender: TObject); … … 112 140 113 141 uses 114 UFormProject, UFormSourceCode, UFormSettings ;142 UFormProject, UFormSourceCode, UFormSettings, UFormModuleList; 115 143 116 144 { TFormMain } … … 119 147 begin 120 148 Application.Terminate; 149 end; 150 151 procedure TFormMain.AFileCloseExecute(Sender: TObject); 152 begin 153 // DataModule1.OpenedFiles.Close(DataModule1.OpenedFiles.Selected); 121 154 end; 122 155 … … 127 160 DataModule1.OpenedFiles.OpenFile(OpenDialogFile.FileName); 128 161 end; 162 end; 163 164 procedure TFormMain.AViewModulesExecute(Sender: TObject); 165 begin 166 FormModuleList.ModuleManager := DataModule1.ModuleManager; 167 FormModuleList.Show; 129 168 end; 130 169 -
trunk/StudioPackage/LibreDevelopStudio.lpk
r6 r9 23 23 </Other> 24 24 </CompilerOptions> 25 <Files Count=" 6">25 <Files Count="7"> 26 26 <Item1> 27 27 <Filename Value="Forms\UFormMain.pas"/> … … 48 48 <UnitName Value="UFormSettings"/> 49 49 </Item6> 50 <Item7> 51 <Filename Value="Forms\UFormModuleList.pas"/> 52 <UnitName Value="UFormModuleList"/> 53 </Item7> 50 54 </Files> 51 55 <i18n> -
trunk/StudioPackage/LibreDevelopStudio.pas
r6 r9 9 9 uses 10 10 UFormMain, UProject, UDataModule, UFormProject, UFormSourceCode, 11 UFormSettings, LazarusPackageIntf;11 UFormSettings, UFormModuleList, LazarusPackageIntf; 12 12 13 13 implementation -
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.