├── .github └── FUNDING.yml ├── .gitignore ├── Images ├── Backup.png ├── C4D-154X154.png ├── C4D-Logo.png ├── Code4D-item-added-to-MainMenu.png ├── Component-InstallPackages.png ├── Default-Files-In-Opening-Project.png ├── Find-in-files-Messages.png ├── Find-in-files.png ├── Form-Install-Packages-Button-ADD.png ├── Menus-Add-in-MainMenu-IDE-Delphi.png ├── Open-External.png ├── Package-C4D-Wizard-Installed.png ├── PopupMenu-Project-Manager.png ├── Reopen.png ├── Replace-in-files.png ├── Settings.png ├── ToolBars.png ├── Translate.png ├── Uses-Organization.png └── c4d-logo-100x100.png ├── Install-BPLs ├── Delphi-10.0-Seattle │ └── C4DWizard.bpl ├── Delphi-10.1-Berlin │ └── C4DWizard.bpl ├── Delphi-10.2-Tokyo │ └── C4DWizard.bpl ├── Delphi-10.3-Rio │ └── C4DWizard.bpl ├── Delphi-10.4-Sydney │ └── C4DWizard.bpl ├── Delphi-11.3-Alexandria │ └── C4DWizard.bpl └── Delphi-12.0-Athens │ └── C4DWizard.bpl ├── LICENSE ├── Package ├── C4DWizard.dpk ├── C4DWizard.dproj ├── C4DWizard.res └── Img │ ├── c4d_Logo.bmp │ ├── c4d_arrow_green.bmp │ ├── c4d_binary.bmp │ ├── c4d_build_group.bmp │ ├── c4d_clean_and_start.bmp │ ├── c4d_empty.bmp │ ├── c4d_export.bmp │ ├── c4d_find.bmp │ ├── c4d_folder_open.bmp │ ├── c4d_gear.bmp │ ├── c4d_git_inf.bmp │ ├── c4d_git_remote.bmp │ ├── c4d_github_desktop.bmp │ ├── c4d_import.bmp │ ├── c4d_indent.bmp │ ├── c4d_link_to_file.bmp │ ├── c4d_lock_off.bmp │ ├── c4d_lock_on.bmp │ ├── c4d_logo_24x24.bmp │ ├── c4d_logo_48x48.bmp │ ├── c4d_notes.bmp │ ├── c4d_open_in_explorer.bmp │ ├── c4d_open_in_explorer_fle.bmp │ ├── c4d_play_blue.bmp │ ├── c4d_refresh.bmp │ ├── c4d_replace.bmp │ ├── c4d_save.bmp │ ├── c4d_star_grey.bmp │ ├── c4d_star_yellow.bmp │ ├── c4d_start.bmp │ ├── c4d_translate.bmp │ ├── c4d_uses_organization.bmp │ ├── c4d_verify_document.bmp │ └── c4d_vscode.bmp ├── README.md └── Src ├── Backup ├── C4D.Wizard.Backup.Export.View.dfm ├── C4D.Wizard.Backup.Export.View.pas ├── C4D.Wizard.Backup.Import.SelectFiles.View.dfm ├── C4D.Wizard.Backup.Import.SelectFiles.View.pas ├── C4D.Wizard.Backup.Import.View.dfm ├── C4D.Wizard.Backup.Import.View.pas └── C4D.Wizard.Backup.Interfaces.pas ├── C4D.Wizard.Register.pas ├── Consts └── C4D.Wizard.Consts.pas ├── DefaultFilesInOpeningProject ├── C4D.Wizard.DefaultFilesInOpeningProject.Interfaces.pas ├── C4D.Wizard.DefaultFilesInOpeningProject.Model.pas └── C4D.Wizard.DefaultFilesInOpeningProject.pas ├── Find ├── C4D.Wizard.Find.Interfaces.pas ├── C4D.Wizard.Find.Model.pas ├── C4D.Wizard.Find.View.dfm └── C4D.Wizard.Find.View.pas ├── FormatSource ├── C4D.Wizard.FormatSource.View.dfm └── C4D.Wizard.FormatSource.View.pas ├── Git └── C4D.Wizard.Git.Utils.pas ├── Groups ├── C4D.Wizard.Groups.AddEdit.View.dfm ├── C4D.Wizard.Groups.AddEdit.View.pas ├── C4D.Wizard.Groups.Interfaces.pas ├── C4D.Wizard.Groups.Model.pas ├── C4D.Wizard.Groups.View.dfm ├── C4D.Wizard.Groups.View.pas └── C4D.Wizard.Groups.pas ├── IDE ├── About │ └── C4D.Wizard.IDE.About.pas ├── CompileNotifier │ └── C4D.Wizard.IDE.CompileNotifier.pas ├── EditServicesNotifier │ └── C4D.Wizard.IDE.EditServicesNotifier.pas ├── FileNotification │ └── C4D.Wizard.IDE.FileNotification.Notifier.pas ├── ImageListMain │ └── C4D.Wizard.IDE.ImageListMain.pas ├── MainMenu │ ├── C4D.Wizard.IDE.MainMenu.Backup.pas │ ├── C4D.Wizard.IDE.MainMenu.Clicks.pas │ ├── C4D.Wizard.IDE.MainMenu.OpenExternal.pas │ ├── C4D.Wizard.IDE.MainMenu.Register.pas │ ├── C4D.Wizard.IDE.MainMenu.VsCodeIntegration.pas │ └── C4D.Wizard.IDE.MainMenu.pas ├── PopupMenu │ ├── C4D.Wizard.IDE.PopupMenu.Item.pas │ └── C4D.Wizard.IDE.PopupMenu.pas ├── PopupMenuDesigner │ ├── C4D.Wizard.IDE.PopupMenuDesigner.ComponentSel.pas │ └── C4D.Wizard.IDE.PopupMenuDesigner.pas ├── ShortCut │ └── C4D.Wizard.IDE.ShortCut.KeyboardBinding.pas ├── Shortcuts │ ├── C4D.Wizard.IDE.Shortcuts.BlockKeyInsert.pas │ └── C4D.Wizard.IDE.Shortcuts.pas ├── Splash │ └── C4D.Wizard.IDE.Splash.pas └── ToolBars │ ├── C4D.Wizard.IDE.ToolBars.Branch.pas │ ├── C4D.Wizard.IDE.ToolBars.Build.pas │ ├── C4D.Wizard.IDE.ToolBars.Notifier.pas │ ├── C4D.Wizard.IDE.ToolBars.Register.pas │ ├── C4D.Wizard.IDE.ToolBars.Utilities.pas │ ├── C4D.Wizard.IDE.ToolBars.Utils.pas │ └── C4D.Wizard.IDE.ToolBars.VsCodeIntegration.pas ├── Indent └── C4D.Wizard.Indent.pas ├── Interfaces └── C4D.Wizard.Interfaces.pas ├── LogFile └── C4D.Wizard.LogFile.pas ├── Messages ├── C4D.Wizard.Messages.Custom.Groups.OTA.pas ├── C4D.Wizard.Messages.Custom.Interfaces.pas ├── C4D.Wizard.Messages.Custom.OTA.pas ├── C4D.Wizard.Messages.Custom.pas └── C4D.Wizard.Messages.Simple.pas ├── Model ├── Files │ └── C4D.Wizard.Model.Files.Loop.pas └── IniFile │ └── C4D.Wizard.Model.IniFile.Components.pas ├── Notes ├── C4D.Wizard.Notes.View.dfm └── C4D.Wizard.Notes.View.pas ├── OpenExternal ├── C4D.Wizard.OpenExternal.AddEdit.View.dfm ├── C4D.Wizard.OpenExternal.AddEdit.View.pas ├── C4D.Wizard.OpenExternal.Interfaces.pas ├── C4D.Wizard.OpenExternal.Model.pas ├── C4D.Wizard.OpenExternal.Utils.pas ├── C4D.Wizard.OpenExternal.View.dfm ├── C4D.Wizard.OpenExternal.View.pas └── C4D.Wizard.OpenExternal.pas ├── ProcessDelphi ├── C4D.Wizard.ProcessDelphi.pas ├── C4D.Wizard.dpipes.pas ├── C4D.Wizard.dprocess.pas ├── pipes_win.inc └── process_win.inc ├── Reopen ├── C4D.Wizard.Reopen.Controller.pas ├── C4D.Wizard.Reopen.Interfaces.pas ├── C4D.Wizard.Reopen.Model.pas ├── C4D.Wizard.Reopen.SaveAs.pas ├── C4D.Wizard.Reopen.View.Edit.dfm ├── C4D.Wizard.Reopen.View.Edit.pas ├── C4D.Wizard.Reopen.View.dfm └── C4D.Wizard.Reopen.View.pas ├── ReplaceFiles ├── C4D.Wizard.ReplaceFiles.Interfaces.pas ├── C4D.Wizard.ReplaceFiles.Model.pas ├── C4D.Wizard.ReplaceFiles.View.dfm └── C4D.Wizard.ReplaceFiles.View.pas ├── Settings ├── C4D.Wizard.Settings.Model.pas ├── C4D.Wizard.Settings.View.dfm └── C4D.Wizard.Settings.View.pas ├── Translate ├── C4D.Wizard.Translate.View.dfm └── C4D.Wizard.Translate.View.pas ├── Types ├── C4D.Wizard.Types.ABMenuAction.pas └── C4D.Wizard.Types.pas ├── UsesOrganization ├── C4D.Wizard.UsesOrganization.List.pas ├── C4D.Wizard.UsesOrganization.ListOfUses.pas ├── C4D.Wizard.UsesOrganization.Params.pas ├── C4D.Wizard.UsesOrganization.View.dfm ├── C4D.Wizard.UsesOrganization.View.pas └── C4D.Wizard.UsesOrganization.pas ├── Utils ├── C4D.Wizard.Utils.CnWizard.pas ├── C4D.Wizard.Utils.GetIniPositionStr.pas ├── C4D.Wizard.Utils.Git.pas ├── C4D.Wizard.Utils.ListOfFilesInFolder.pas ├── C4D.Wizard.Utils.ListView.pas ├── C4D.Wizard.Utils.OTA.BinaryPath.pas ├── C4D.Wizard.Utils.OTA.Codex.pas ├── C4D.Wizard.Utils.OTA.pas ├── C4D.Wizard.Utils.StringList.pas └── C4D.Wizard.Utils.pas ├── View ├── C4D.Wizard.View.About.dfm ├── C4D.Wizard.View.About.pas ├── C4D.Wizard.View.Dialog.dfm ├── C4D.Wizard.View.Dialog.pas ├── C4D.Wizard.View.ListFilesForSelection.dfm ├── C4D.Wizard.View.ListFilesForSelection.pas ├── C4D.Wizard.View.Memo.dfm └── C4D.Wizard.View.Memo.pas ├── VsCodeIntegration └── C4D.Wizard.VsCodeIntegration.pas └── WaitingScreen ├── C4D.Wizard.WaitingScreen.View.dfm ├── C4D.Wizard.WaitingScreen.View.pas └── C4D.Wizard.WaitingScreen.pas /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://pag.ae/7ZhEY1xKr'] 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | # C++ object files produced when C/C++ Output file generation is configured. 25 | # Uncomment this if you are not using external objects (zlib library for example). 26 | #*.obj 27 | # 28 | 29 | # Delphi compiler-generated binaries (safe to delete) 30 | *.exe 31 | *.dll 32 | #*.bpl 33 | *.bpi 34 | *.dcp 35 | *.so 36 | *.apk 37 | *.drc 38 | *.map 39 | *.dres 40 | *.rsm 41 | *.tds 42 | *.dcu 43 | *.lib 44 | *.a 45 | *.o 46 | *.ocx 47 | 48 | # Delphi autogenerated files (duplicated info) 49 | *.cfg 50 | *.hpp 51 | *Resource.rc 52 | 53 | # Delphi local files (user-specific info) 54 | *.local 55 | *.identcache 56 | *.projdata 57 | *.tvsconfig 58 | *.dsk 59 | 60 | # Delphi history and backups 61 | __history/ 62 | __recovery/ 63 | *.~* 64 | 65 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi) 66 | *.stat 67 | 68 | # Boss dependency manager vendor folder https://github.com/HashLoad/boss 69 | modules/ 70 | -------------------------------------------------------------------------------- /Images/Backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Backup.png -------------------------------------------------------------------------------- /Images/C4D-154X154.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/C4D-154X154.png -------------------------------------------------------------------------------- /Images/C4D-Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/C4D-Logo.png -------------------------------------------------------------------------------- /Images/Code4D-item-added-to-MainMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Code4D-item-added-to-MainMenu.png -------------------------------------------------------------------------------- /Images/Component-InstallPackages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Component-InstallPackages.png -------------------------------------------------------------------------------- /Images/Default-Files-In-Opening-Project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Default-Files-In-Opening-Project.png -------------------------------------------------------------------------------- /Images/Find-in-files-Messages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Find-in-files-Messages.png -------------------------------------------------------------------------------- /Images/Find-in-files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Find-in-files.png -------------------------------------------------------------------------------- /Images/Form-Install-Packages-Button-ADD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Form-Install-Packages-Button-ADD.png -------------------------------------------------------------------------------- /Images/Menus-Add-in-MainMenu-IDE-Delphi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Menus-Add-in-MainMenu-IDE-Delphi.png -------------------------------------------------------------------------------- /Images/Open-External.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Open-External.png -------------------------------------------------------------------------------- /Images/Package-C4D-Wizard-Installed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Package-C4D-Wizard-Installed.png -------------------------------------------------------------------------------- /Images/PopupMenu-Project-Manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/PopupMenu-Project-Manager.png -------------------------------------------------------------------------------- /Images/Reopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Reopen.png -------------------------------------------------------------------------------- /Images/Replace-in-files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Replace-in-files.png -------------------------------------------------------------------------------- /Images/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Settings.png -------------------------------------------------------------------------------- /Images/ToolBars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/ToolBars.png -------------------------------------------------------------------------------- /Images/Translate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Translate.png -------------------------------------------------------------------------------- /Images/Uses-Organization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/Uses-Organization.png -------------------------------------------------------------------------------- /Images/c4d-logo-100x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Images/c4d-logo-100x100.png -------------------------------------------------------------------------------- /Install-BPLs/Delphi-10.0-Seattle/C4DWizard.bpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Install-BPLs/Delphi-10.0-Seattle/C4DWizard.bpl -------------------------------------------------------------------------------- /Install-BPLs/Delphi-10.1-Berlin/C4DWizard.bpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Install-BPLs/Delphi-10.1-Berlin/C4DWizard.bpl -------------------------------------------------------------------------------- /Install-BPLs/Delphi-10.2-Tokyo/C4DWizard.bpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Install-BPLs/Delphi-10.2-Tokyo/C4DWizard.bpl -------------------------------------------------------------------------------- /Install-BPLs/Delphi-10.3-Rio/C4DWizard.bpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Install-BPLs/Delphi-10.3-Rio/C4DWizard.bpl -------------------------------------------------------------------------------- /Install-BPLs/Delphi-10.4-Sydney/C4DWizard.bpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Install-BPLs/Delphi-10.4-Sydney/C4DWizard.bpl -------------------------------------------------------------------------------- /Install-BPLs/Delphi-11.3-Alexandria/C4DWizard.bpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Install-BPLs/Delphi-11.3-Alexandria/C4DWizard.bpl -------------------------------------------------------------------------------- /Install-BPLs/Delphi-12.0-Athens/C4DWizard.bpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Install-BPLs/Delphi-12.0-Athens/C4DWizard.bpl -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Code4Delphi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Package/C4DWizard.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/C4DWizard.res -------------------------------------------------------------------------------- /Package/Img/c4d_Logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_Logo.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_arrow_green.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_arrow_green.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_binary.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_binary.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_build_group.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_build_group.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_clean_and_start.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_clean_and_start.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_empty.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_empty.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_export.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_export.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_find.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_find.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_folder_open.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_folder_open.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_gear.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_gear.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_git_inf.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_git_inf.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_git_remote.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_git_remote.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_github_desktop.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_github_desktop.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_import.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_import.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_indent.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_indent.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_link_to_file.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_link_to_file.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_lock_off.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_lock_off.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_lock_on.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_lock_on.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_logo_24x24.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_logo_24x24.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_logo_48x48.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_logo_48x48.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_notes.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_notes.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_open_in_explorer.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_open_in_explorer.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_open_in_explorer_fle.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_open_in_explorer_fle.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_play_blue.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_play_blue.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_refresh.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_refresh.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_replace.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_replace.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_save.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_save.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_star_grey.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_star_grey.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_star_yellow.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_star_yellow.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_start.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_start.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_translate.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_translate.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_uses_organization.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_uses_organization.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_verify_document.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_verify_document.bmp -------------------------------------------------------------------------------- /Package/Img/c4d_vscode.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Package/Img/c4d_vscode.bmp -------------------------------------------------------------------------------- /Src/Backup/C4D.Wizard.Backup.Export.View.dfm: -------------------------------------------------------------------------------- 1 | object C4DWizardBackupExportView: TC4DWizardBackupExportView 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [biSystemMenu] 5 | Caption = 'Code4D - Backup Export Configs' 6 | ClientHeight = 248 7 | ClientWidth = 666 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | KeyPreview = True 15 | OldCreateOrder = False 16 | Position = poScreenCenter 17 | OnCreate = FormCreate 18 | OnDestroy = FormDestroy 19 | OnKeyDown = FormKeyDown 20 | OnShow = FormShow 21 | PixelsPerInch = 96 22 | TextHeight = 13 23 | object Panel1: TPanel 24 | Left = 0 25 | Top = 211 26 | Width = 666 27 | Height = 37 28 | Align = alBottom 29 | BevelEdges = [beLeft, beRight, beBottom] 30 | BevelOuter = bvNone 31 | Padding.Left = 4 32 | Padding.Top = 2 33 | Padding.Right = 2 34 | Padding.Bottom = 2 35 | ParentBackground = False 36 | TabOrder = 0 37 | object btnClose: TButton 38 | AlignWithMargins = True 39 | Left = 551 40 | Top = 2 41 | Width = 110 42 | Height = 33 43 | Cursor = crHandPoint 44 | Margins.Left = 0 45 | Margins.Top = 0 46 | Margins.Bottom = 0 47 | Align = alRight 48 | Caption = 'Close' 49 | TabOrder = 1 50 | OnClick = btnCloseClick 51 | end 52 | object btnExport: TButton 53 | AlignWithMargins = True 54 | Left = 438 55 | Top = 2 56 | Width = 110 57 | Height = 33 58 | Cursor = crHandPoint 59 | Margins.Left = 0 60 | Margins.Top = 0 61 | Margins.Bottom = 0 62 | Align = alRight 63 | Caption = 'Export' 64 | TabOrder = 0 65 | OnClick = btnExportClick 66 | end 67 | object ckOpenFolderAfterExport: TCheckBox 68 | AlignWithMargins = True 69 | Left = 9 70 | Top = 5 71 | Width = 141 72 | Height = 27 73 | Cursor = crHandPoint 74 | Margins.Left = 5 75 | Align = alLeft 76 | Caption = 'Open folder after export' 77 | Checked = True 78 | Font.Charset = DEFAULT_CHARSET 79 | Font.Color = clWindowText 80 | Font.Height = -11 81 | Font.Name = 'Tahoma' 82 | Font.Style = [] 83 | ParentFont = False 84 | ParentShowHint = False 85 | ShowHint = True 86 | State = cbChecked 87 | TabOrder = 2 88 | end 89 | end 90 | object Panel9: TPanel 91 | Left = 0 92 | Top = 0 93 | Width = 666 94 | Height = 211 95 | Align = alClient 96 | BevelOuter = bvNone 97 | ParentBackground = False 98 | TabOrder = 1 99 | object lbFolderForExport: TLabel 100 | Left = 20 101 | Top = 37 102 | Width = 119 103 | Height = 13 104 | Caption = 'Folder default for export' 105 | end 106 | object Bevel1: TBevel 107 | AlignWithMargins = True 108 | Left = 0 109 | Top = 207 110 | Width = 666 111 | Height = 1 112 | Margins.Left = 0 113 | Margins.Top = 0 114 | Margins.Right = 0 115 | Align = alBottom 116 | Shape = bsTopLine 117 | ExplicitTop = 158 118 | ExplicitWidth = 441 119 | end 120 | object lbProgressFile: TLabel 121 | Left = 20 122 | Top = 87 123 | Width = 345 124 | Height = 13 125 | AutoSize = False 126 | Caption = 'Progress file' 127 | end 128 | object lbProgressBarGeneral: TLabel 129 | Left = 20 130 | Top = 133 131 | Width = 81 132 | Height = 13 133 | Caption = 'Progress general' 134 | end 135 | object lbPorcentFile: TLabel 136 | Left = 623 137 | Top = 88 138 | Width = 23 139 | Height = 13 140 | Alignment = taRightJustify 141 | Caption = '0 %' 142 | Font.Charset = DEFAULT_CHARSET 143 | Font.Color = clWindowText 144 | Font.Height = -11 145 | Font.Name = 'Tahoma' 146 | Font.Style = [fsBold] 147 | ParentFont = False 148 | end 149 | object lbPorcentGeneral: TLabel 150 | Left = 623 151 | Top = 134 152 | Width = 23 153 | Height = 13 154 | Alignment = taRightJustify 155 | Caption = '0 %' 156 | Font.Charset = DEFAULT_CHARSET 157 | Font.Color = clWindowText 158 | Font.Height = -11 159 | Font.Name = 'Tahoma' 160 | Font.Style = [fsBold] 161 | ParentFont = False 162 | end 163 | object edtFolderDefault: TEdit 164 | Left = 20 165 | Top = 53 166 | Width = 601 167 | Height = 21 168 | Color = clBtnFace 169 | ReadOnly = True 170 | TabOrder = 0 171 | end 172 | object btnFindFolder: TButton 173 | Left = 623 174 | Top = 52 175 | Width = 25 176 | Height = 23 177 | Cursor = crHandPoint 178 | Hint = 'Search folder' 179 | Caption = '...' 180 | Font.Charset = DEFAULT_CHARSET 181 | Font.Color = clWindowText 182 | Font.Height = -12 183 | Font.Name = 'Tahoma' 184 | Font.Style = [fsBold] 185 | ParentFont = False 186 | ParentShowHint = False 187 | ShowHint = True 188 | TabOrder = 1 189 | OnClick = btnFindFolderClick 190 | end 191 | object ProgressBarFile: TProgressBar 192 | Left = 20 193 | Top = 104 194 | Width = 628 195 | Height = 20 196 | Smooth = True 197 | TabOrder = 2 198 | end 199 | object ProgressBarGeneral: TProgressBar 200 | Left = 20 201 | Top = 150 202 | Width = 628 203 | Height = 20 204 | Step = 1 205 | TabOrder = 3 206 | end 207 | end 208 | end 209 | -------------------------------------------------------------------------------- /Src/Backup/C4D.Wizard.Backup.Import.SelectFiles.View.dfm: -------------------------------------------------------------------------------- 1 | object C4DWizardBackupImportSelectFilesView: TC4DWizardBackupImportSelectFilesView 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [biSystemMenu] 5 | Caption = 'Code4D - Select Files For Import Configs' 6 | ClientHeight = 318 7 | ClientWidth = 294 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | KeyPreview = True 15 | OldCreateOrder = False 16 | Position = poScreenCenter 17 | OnCreate = FormCreate 18 | OnKeyDown = FormKeyDown 19 | OnShow = FormShow 20 | PixelsPerInch = 96 21 | TextHeight = 13 22 | object Panel1: TPanel 23 | Left = 0 24 | Top = 281 25 | Width = 294 26 | Height = 37 27 | Align = alBottom 28 | BevelEdges = [beLeft, beRight, beBottom] 29 | BevelOuter = bvNone 30 | Padding.Left = 4 31 | Padding.Top = 2 32 | Padding.Right = 2 33 | Padding.Bottom = 2 34 | ParentBackground = False 35 | TabOrder = 0 36 | ExplicitTop = 276 37 | ExplicitWidth = 298 38 | object btnCancel: TButton 39 | AlignWithMargins = True 40 | Left = 179 41 | Top = 2 42 | Width = 110 43 | Height = 33 44 | Cursor = crHandPoint 45 | Margins.Left = 0 46 | Margins.Top = 0 47 | Margins.Bottom = 0 48 | Align = alRight 49 | Caption = 'Cancel' 50 | TabOrder = 1 51 | OnClick = btnCancelClick 52 | ExplicitLeft = 183 53 | end 54 | object btnConfirm: TButton 55 | AlignWithMargins = True 56 | Left = 66 57 | Top = 2 58 | Width = 110 59 | Height = 33 60 | Cursor = crHandPoint 61 | Margins.Left = 0 62 | Margins.Top = 0 63 | Margins.Bottom = 0 64 | Align = alRight 65 | Caption = 'Confirm' 66 | TabOrder = 0 67 | OnClick = btnConfirmClick 68 | ExplicitLeft = 70 69 | end 70 | end 71 | object Panel9: TPanel 72 | Left = 0 73 | Top = 0 74 | Width = 294 75 | Height = 281 76 | Align = alClient 77 | BevelOuter = bvNone 78 | ParentBackground = False 79 | TabOrder = 1 80 | ExplicitTop = -1 81 | object Bevel1: TBevel 82 | AlignWithMargins = True 83 | Left = 0 84 | Top = 277 85 | Width = 294 86 | Height = 1 87 | Margins.Left = 0 88 | Margins.Top = 0 89 | Margins.Right = 0 90 | Align = alBottom 91 | Shape = bsTopLine 92 | ExplicitTop = 158 93 | ExplicitWidth = 441 94 | end 95 | object ckGeneralSettings: TCheckBox 96 | Left = 65 97 | Top = 45 98 | Width = 98 99 | Height = 17 100 | Caption = 'General settings' 101 | Checked = True 102 | State = cbChecked 103 | TabOrder = 0 104 | end 105 | object ckGroups: TCheckBox 106 | Left = 65 107 | Top = 214 108 | Width = 54 109 | Height = 17 110 | Caption = 'Groups' 111 | Checked = True 112 | State = cbChecked 113 | TabOrder = 4 114 | end 115 | object ckOpenExternalPath: TCheckBox 116 | Left = 65 117 | Top = 129 118 | Width = 113 119 | Height = 17 120 | Caption = 'Open external path' 121 | Checked = True 122 | State = cbChecked 123 | TabOrder = 2 124 | end 125 | object ckReopenFileHistory: TCheckBox 126 | Left = 65 127 | Top = 171 128 | Width = 109 129 | Height = 17 130 | Caption = 'Reopen file history' 131 | Checked = True 132 | State = cbChecked 133 | TabOrder = 3 134 | end 135 | object ckDefaultFilesInOpeningProject: TCheckBox 136 | Left = 65 137 | Top = 87 138 | Width = 172 139 | Height = 17 140 | Caption = 'Default Files In Opening Project' 141 | Checked = True 142 | State = cbChecked 143 | TabOrder = 1 144 | end 145 | end 146 | end 147 | -------------------------------------------------------------------------------- /Src/Backup/C4D.Wizard.Backup.Import.SelectFiles.View.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Backup.Import.SelectFiles.View; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, 7 | System.SysUtils, 8 | System.Classes, 9 | Vcl.Controls, 10 | Vcl.Forms, 11 | Vcl.StdCtrls, 12 | Vcl.ExtCtrls; 13 | 14 | type 15 | TC4DWizardBackupImportSelectFilesView = class(TForm) 16 | Panel1: TPanel; 17 | btnCancel: TButton; 18 | btnConfirm: TButton; 19 | Panel9: TPanel; 20 | Bevel1: TBevel; 21 | ckGeneralSettings: TCheckBox; 22 | ckGroups: TCheckBox; 23 | ckOpenExternalPath: TCheckBox; 24 | ckReopenFileHistory: TCheckBox; 25 | ckDefaultFilesInOpeningProject: TCheckBox; 26 | procedure FormCreate(Sender: TObject); 27 | procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 28 | procedure btnCancelClick(Sender: TObject); 29 | procedure btnConfirmClick(Sender: TObject); 30 | procedure FormShow(Sender: TObject); 31 | private 32 | 33 | public 34 | 35 | end; 36 | 37 | var 38 | C4DWizardBackupImportSelectFilesView: TC4DWizardBackupImportSelectFilesView; 39 | 40 | implementation 41 | 42 | uses 43 | C4D.Wizard.Utils, 44 | C4D.Wizard.Utils.OTA; 45 | 46 | {$R *.dfm} 47 | 48 | 49 | procedure TC4DWizardBackupImportSelectFilesView.FormCreate(Sender: TObject); 50 | begin 51 | Self.ModalResult := mrCancel; 52 | TC4DWizardUtilsOTA.IDEThemingAll(TC4DWizardBackupImportSelectFilesView, Self); 53 | end; 54 | 55 | procedure TC4DWizardBackupImportSelectFilesView.FormShow(Sender: TObject); 56 | begin 57 | ckGeneralSettings.Checked := ckGeneralSettings.Enabled; 58 | ckDefaultFilesInOpeningProject.Checked := ckDefaultFilesInOpeningProject.Enabled; 59 | ckOpenExternalPath.Checked := ckOpenExternalPath.Enabled; 60 | ckReopenFileHistory.Checked := ckReopenFileHistory.Enabled; 61 | ckGroups.Checked := ckGroups.Enabled; 62 | end; 63 | 64 | procedure TC4DWizardBackupImportSelectFilesView.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 65 | begin 66 | case(Key)of 67 | VK_F4: 68 | if(ssAlt in Shift)then 69 | Key := 0; 70 | VK_ESCAPE: 71 | if(Shift = [])then 72 | Self.Close; 73 | end; 74 | end; 75 | 76 | procedure TC4DWizardBackupImportSelectFilesView.btnCancelClick(Sender: TObject); 77 | begin 78 | Self.Close; 79 | Self.ModalResult := mrCancel; 80 | end; 81 | 82 | procedure TC4DWizardBackupImportSelectFilesView.btnConfirmClick(Sender: TObject); 83 | begin 84 | if(not ckGeneralSettings.Checked) 85 | and(not ckDefaultFilesInOpeningProject.Checked) 86 | and(not ckOpenExternalPath.Checked) 87 | and(not ckReopenFileHistory.Checked) 88 | and(not ckGroups.Checked) 89 | then 90 | TC4DWizardUtils.ShowMsgAndAbort('Select at least one option'); 91 | 92 | Self.Close; 93 | Self.ModalResult := mrOk; 94 | end; 95 | 96 | end. 97 | -------------------------------------------------------------------------------- /Src/Backup/C4D.Wizard.Backup.Import.View.dfm: -------------------------------------------------------------------------------- 1 | object C4DWizardBackupImportView: TC4DWizardBackupImportView 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [biSystemMenu] 5 | Caption = 'Code4D - Backup Restore Configs' 6 | ClientHeight = 157 7 | ClientWidth = 670 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | KeyPreview = True 15 | OldCreateOrder = False 16 | Position = poScreenCenter 17 | OnClose = FormClose 18 | OnCreate = FormCreate 19 | OnKeyDown = FormKeyDown 20 | OnShow = FormShow 21 | PixelsPerInch = 96 22 | TextHeight = 13 23 | object Panel1: TPanel 24 | Left = 0 25 | Top = 120 26 | Width = 670 27 | Height = 37 28 | Align = alBottom 29 | BevelEdges = [beLeft, beRight, beBottom] 30 | BevelOuter = bvNone 31 | Padding.Left = 4 32 | Padding.Top = 2 33 | Padding.Right = 2 34 | Padding.Bottom = 2 35 | ParentBackground = False 36 | TabOrder = 0 37 | object btnClose: TButton 38 | AlignWithMargins = True 39 | Left = 555 40 | Top = 2 41 | Width = 110 42 | Height = 33 43 | Cursor = crHandPoint 44 | Margins.Left = 0 45 | Margins.Top = 0 46 | Margins.Bottom = 0 47 | Align = alRight 48 | Caption = 'Close' 49 | TabOrder = 1 50 | OnClick = btnCloseClick 51 | end 52 | object btnRestore: TButton 53 | AlignWithMargins = True 54 | Left = 442 55 | Top = 2 56 | Width = 110 57 | Height = 33 58 | Cursor = crHandPoint 59 | Margins.Left = 0 60 | Margins.Top = 0 61 | Margins.Bottom = 0 62 | Align = alRight 63 | Caption = 'Restore' 64 | TabOrder = 0 65 | OnClick = btnRestoreClick 66 | end 67 | end 68 | object Panel9: TPanel 69 | Left = 0 70 | Top = 0 71 | Width = 670 72 | Height = 120 73 | Align = alClient 74 | BevelOuter = bvNone 75 | ParentBackground = False 76 | TabOrder = 1 77 | object lbFolder: TLabel 78 | Left = 20 79 | Top = 37 80 | Width = 67 81 | Height = 13 82 | Caption = 'Folder default' 83 | end 84 | object Bevel1: TBevel 85 | AlignWithMargins = True 86 | Left = 0 87 | Top = 116 88 | Width = 670 89 | Height = 1 90 | Margins.Left = 0 91 | Margins.Top = 0 92 | Margins.Right = 0 93 | Align = alBottom 94 | Shape = bsTopLine 95 | ExplicitTop = 158 96 | ExplicitWidth = 441 97 | end 98 | object edtFolder: TEdit 99 | Left = 20 100 | Top = 53 101 | Width = 601 102 | Height = 21 103 | Color = clBtnFace 104 | ReadOnly = True 105 | TabOrder = 0 106 | end 107 | object btnFindFolder: TButton 108 | Left = 623 109 | Top = 52 110 | Width = 25 111 | Height = 23 112 | Cursor = crHandPoint 113 | Hint = 'Search folder' 114 | Caption = '...' 115 | Font.Charset = DEFAULT_CHARSET 116 | Font.Color = clWindowText 117 | Font.Height = -12 118 | Font.Name = 'Tahoma' 119 | Font.Style = [fsBold] 120 | ParentFont = False 121 | ParentShowHint = False 122 | ShowHint = True 123 | TabOrder = 1 124 | OnClick = btnFindFolderClick 125 | end 126 | end 127 | end 128 | -------------------------------------------------------------------------------- /Src/Backup/C4D.Wizard.Backup.Interfaces.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Backup.Interfaces; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils; 7 | 8 | type 9 | IC4DWizardIDEMainMenuBackup = interface 10 | ['{5AFD4D5D-99A0-4177-BAA8-8705015D186F}'] 11 | function Process: IC4DWizardIDEMainMenuBackup; 12 | end; 13 | 14 | implementation 15 | 16 | end. 17 | -------------------------------------------------------------------------------- /Src/C4D.Wizard.Register.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Register; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | Vcl.Dialogs, 9 | C4D.Wizard.IDE.MainMenu.Register, 10 | C4D.Wizard.IDE.Shortcuts, 11 | C4D.Wizard.IDE.Shortcuts.BlockKeyInsert, 12 | C4D.Wizard.IDE.PopupMenu, 13 | C4D.Wizard.IDE.FileNotification.Notifier, 14 | C4D.Wizard.Reopen.View, 15 | C4D.Wizard.Messages.Custom.Groups.OTA, 16 | C4D.Wizard.IDE.EditServicesNotifier, 17 | C4D.Wizard.IDE.CompileNotifier, 18 | C4D.Wizard.IDE.ShortCut.KeyboardBinding, 19 | C4D.Wizard.Notes.View; 20 | 21 | procedure register; 22 | 23 | implementation 24 | 25 | procedure RegisterAll; 26 | begin 27 | C4D.Wizard.IDE.MainMenu.Register.RegisterSelf; 28 | C4D.Wizard.IDE.Shortcuts.BlockKeyInsert.RefreshRegister; 29 | C4D.Wizard.IDE.PopupMenu.RegisterSelf; 30 | C4D.Wizard.IDE.FileNotification.Notifier.RegisterSelf; 31 | C4D.Wizard.Reopen.View.RegisterSelf; 32 | C4D.Wizard.Messages.Custom.Groups.OTA.RegisterSelf; 33 | C4D.Wizard.IDE.EditServicesNotifier.RegisterSelf; 34 | C4D.Wizard.IDE.CompileNotifier.RegisterSelf; 35 | C4D.Wizard.Notes.View.RegisterSelf; 36 | end; 37 | 38 | procedure register; 39 | begin 40 | RegisterAll; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Src/DefaultFilesInOpeningProject/C4D.Wizard.DefaultFilesInOpeningProject.Interfaces.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.DefaultFilesInOpeningProject.Interfaces; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes; 8 | 9 | type 10 | IC4DWizardDefaultFilesInOpeningProject = interface 11 | ['{0710FBFE-F205-4F60-ADE2-D1BBDE3678F6}'] 12 | procedure OpenFilesOfProject; 13 | procedure GetListFilesPathsDefaults(Astrings: TStrings); 14 | procedure SelectionFilesForDefaultOpening; 15 | end; 16 | 17 | IC4DWizardDefaultFilesInOpeningProjectModel = interface 18 | ['{FAC72037-7F08-454F-9F16-98978F2C46BE}'] 19 | procedure WriteInIniFile(const AFilePathProject: string; const AListFilePathDefault: string); 20 | function ReadInIniFile(const AFilePathProject: string): string; 21 | procedure RemoveInIniFile(const AFilePathProject: string); 22 | end; 23 | 24 | implementation 25 | 26 | end. 27 | -------------------------------------------------------------------------------- /Src/DefaultFilesInOpeningProject/C4D.Wizard.DefaultFilesInOpeningProject.Model.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.DefaultFilesInOpeningProject.Model; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.IniFiles, 8 | System.Classes, 9 | C4D.Wizard.DefaultFilesInOpeningProject.Interfaces, 10 | C4D.Wizard.Consts; 11 | 12 | type 13 | TC4DWizardDefaultFilesInOpeningProjectModel = class(TInterfacedObject, IC4DWizardDefaultFilesInOpeningProjectModel) 14 | private 15 | function GetIniFile: TIniFile; 16 | protected 17 | procedure WriteInIniFile(const AFilePathProject: string; const AListFilePathDefault: string); 18 | function ReadInIniFile(const AFilePathProject: string): string; 19 | procedure RemoveInIniFile(const AFilePathProject: string); 20 | public 21 | class function New: IC4DWizardDefaultFilesInOpeningProjectModel; 22 | end; 23 | 24 | implementation 25 | 26 | uses 27 | C4D.Wizard.Utils; 28 | 29 | class function TC4DWizardDefaultFilesInOpeningProjectModel.New: IC4DWizardDefaultFilesInOpeningProjectModel; 30 | begin 31 | Result := Self.Create; 32 | end; 33 | 34 | function TC4DWizardDefaultFilesInOpeningProjectModel.GetIniFile: TIniFile; 35 | begin 36 | Result := TIniFile.Create(TC4DWizardUtils.GetPathFileIniDefaultFilesInOpeningProject); 37 | end; 38 | 39 | procedure TC4DWizardDefaultFilesInOpeningProjectModel.WriteInIniFile(const AFilePathProject: string; 40 | const AListFilePathDefault: string); 41 | var 42 | LIniFile: TIniFile; 43 | begin 44 | LIniFile := Self.GetIniFile; 45 | try 46 | LIniFile.Writestring(AFilePathProject, 47 | TC4DConsts.DEFAULT_FILES_IN_OPENING_PROJECT_INI_ListFilePathDefault, 48 | AListFilePathDefault); 49 | finally 50 | LIniFile.Free; 51 | end; 52 | end; 53 | 54 | function TC4DWizardDefaultFilesInOpeningProjectModel.ReadInIniFile(const AFilePathProject: string): string; 55 | var 56 | LIniFile: TIniFile; 57 | begin 58 | if(AFilePathProject.Trim.IsEmpty)then 59 | Exit; 60 | 61 | LIniFile := Self.GetIniFile; 62 | try 63 | Result := LIniFile.Readstring(AFilePathProject, 64 | TC4DConsts.DEFAULT_FILES_IN_OPENING_PROJECT_INI_ListFilePathDefault, 65 | ''); 66 | finally 67 | LIniFile.Free; 68 | end; 69 | end; 70 | 71 | procedure TC4DWizardDefaultFilesInOpeningProjectModel.RemoveInIniFile(const AFilePathProject: string); 72 | var 73 | LIniFile: TIniFile; 74 | begin 75 | LIniFile := Self.GetIniFile; 76 | try 77 | LIniFile.EraseSection(AFilePathProject); 78 | finally 79 | LIniFile.Free; 80 | end; 81 | end; 82 | 83 | end. 84 | -------------------------------------------------------------------------------- /Src/DefaultFilesInOpeningProject/C4D.Wizard.DefaultFilesInOpeningProject.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.DefaultFilesInOpeningProject; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | Vcl.Controls, 9 | C4D.Wizard.DefaultFilesInOpeningProject.Interfaces, 10 | C4D.Wizard.DefaultFilesInOpeningProject.Model, 11 | C4D.Wizard.View.ListFilesForSelection; 12 | 13 | type 14 | TC4DWizardDefaultFilesInOpeningProject = class(TInterfacedObject, IC4DWizardDefaultFilesInOpeningProject) 15 | private 16 | FFilePathProjectOrGroup: string; 17 | FModel: IC4DWizardDefaultFilesInOpeningProjectModel; 18 | protected 19 | procedure OpenFilesOfProject; 20 | procedure GetListFilesPathsDefaults(Astrings: TStrings); 21 | procedure SelectionFilesForDefaultOpening; 22 | public 23 | class function New(const AFilePathProjectOrGroup: string): IC4DWizardDefaultFilesInOpeningProject; 24 | constructor Create(const AFilePathProjectOrGroup: string); 25 | end; 26 | 27 | implementation 28 | 29 | uses 30 | C4D.Wizard.Utils, 31 | C4D.Wizard.Utils.OTA; 32 | 33 | class function TC4DWizardDefaultFilesInOpeningProject.New(const AFilePathProjectOrGroup: string): IC4DWizardDefaultFilesInOpeningProject; 34 | begin 35 | Result := Self.Create(AFilePathProjectOrGroup); 36 | end; 37 | 38 | constructor TC4DWizardDefaultFilesInOpeningProject.Create(const AFilePathProjectOrGroup: string); 39 | begin 40 | FFilePathProjectOrGroup := AFilePathProjectOrGroup; 41 | FModel := TC4DWizardDefaultFilesInOpeningProjectModel.New; 42 | end; 43 | 44 | procedure TC4DWizardDefaultFilesInOpeningProject.OpenFilesOfProject; 45 | var 46 | LStrings: TStrings; 47 | LItem: string; 48 | begin 49 | //TC4DWizardUtilsOTA.CloseFilesOpened([TC4DExtensionsFiles.pas]); 50 | LStrings := TStringList.Create; 51 | try 52 | Self.GetListFilesPathsDefaults(LStrings); 53 | if(LStrings.Count < 0)then 54 | Exit; 55 | 56 | for LItem in LStrings do 57 | begin 58 | if(LItem.Trim.IsEmpty)then 59 | Continue; 60 | 61 | //LAbsolutePath := TC4DWizardUtils.PathRelativeToAbsolute(LItem, ExtractFileDir(FFilePathProjectOrGroup)); 62 | TC4DWizardUtilsOTA.OpenFilePathInIDE(LItem); 63 | end; 64 | finally 65 | LStrings.Free; 66 | end; 67 | end; 68 | 69 | procedure TC4DWizardDefaultFilesInOpeningProject.GetListFilesPathsDefaults(Astrings: TStrings); 70 | var 71 | LListFilesPathsDefaults: string; 72 | i: Integer; 73 | LAbsolutePath: string; 74 | begin 75 | Astrings.Clear; 76 | LListFilesPathsDefaults := FModel.ReadInIniFile(FFilePathProjectOrGroup).Trim; 77 | if(LListFilesPathsDefaults.IsEmpty)then 78 | Exit; 79 | 80 | TC4DWizardUtils.ExplodeList(LListFilesPathsDefaults, ';', Astrings); 81 | for i := 0 to Pred(Astrings.Count)do 82 | begin 83 | if(Astrings[i].Trim.IsEmpty)then 84 | Continue; 85 | 86 | LAbsolutePath := TC4DWizardUtils.PathRelativeToAbsolute(Astrings[i], ExtractFileDir(FFilePathProjectOrGroup)); 87 | Astrings[i] := LAbsolutePath; 88 | end; 89 | end; 90 | 91 | procedure TC4DWizardDefaultFilesInOpeningProject.SelectionFilesForDefaultOpening; 92 | var 93 | LC4DWizardViewListFilesForSelection: TC4DWizardViewListFilesForSelection; 94 | LListFilesPathsDefaults: TStrings; 95 | LPathListInStr: string; 96 | begin 97 | LC4DWizardViewListFilesForSelection := TC4DWizardViewListFilesForSelection.Create(nil); 98 | try 99 | LListFilesPathsDefaults := TStringList.Create; 100 | try 101 | Self.GetListFilesPathsDefaults(LListFilesPathsDefaults); 102 | 103 | LC4DWizardViewListFilesForSelection.FilePathProjectOrGroupForFilter := FFilePathProjectOrGroup; 104 | LC4DWizardViewListFilesForSelection.ListFilesPathsDefaults := LListFilesPathsDefaults; 105 | if(LC4DWizardViewListFilesForSelection.ShowModal <> mrOK)then 106 | Exit; 107 | finally 108 | LListFilesPathsDefaults.Free; 109 | end; 110 | 111 | LPathListInStr := LC4DWizardViewListFilesForSelection.GetPathListInstring(';'); 112 | finally 113 | LC4DWizardViewListFilesForSelection.Free; 114 | end; 115 | 116 | FModel.WriteInIniFile(FFilePathProjectOrGroup, LPathListInStr);; 117 | end; 118 | 119 | end. 120 | -------------------------------------------------------------------------------- /Src/Find/C4D.Wizard.Find.Interfaces.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Find.Interfaces; 2 | 3 | interface 4 | 5 | uses 6 | C4D.Wizard.Types; 7 | 8 | type 9 | IC4DWizardFindModel = interface 10 | ['{CE4BE3EA-48D9-4270-BE7A-C34402D75944}'] 11 | function ResetValues: IC4DWizardFindModel; 12 | function WholeWordOnly(AValue: Boolean): IC4DWizardFindModel; 13 | function DisplayAccountant(AValue: Boolean): IC4DWizardFindModel; 14 | function CaseSensitive(AValue: Boolean): IC4DWizardFindModel; 15 | function SearchFor(AValue: string): IC4DWizardFindModel; 16 | function TextIgnoreEscope(AValue: TC4DTextIgnoreEscope): IC4DWizardFindModel; 17 | function TextIgnore(AValue: string): IC4DWizardFindModel; 18 | function GetCountFind: Integer; 19 | function GetCountArqFind: Integer; 20 | function GetCountError: Integer; 21 | function GetGroupNameMsg: string; 22 | procedure FindInFile(AInfoFile: TC4DWizardInfoFile); 23 | end; 24 | 25 | implementation 26 | 27 | end. 28 | -------------------------------------------------------------------------------- /Src/FormatSource/C4D.Wizard.FormatSource.View.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Src/FormatSource/C4D.Wizard.FormatSource.View.pas -------------------------------------------------------------------------------- /Src/Git/C4D.Wizard.Git.Utils.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Git.Utils; 2 | 3 | interface 4 | 5 | uses 6 | System.Sysutils, 7 | System.IniFiles; 8 | 9 | type 10 | TC4DWizardGitUtils = class 11 | private 12 | public 13 | class procedure OpenInGitHubDesktop(const AFolderGit: String); 14 | class function GetLinkRemoteRepository(const AFolderGit: String): String; 15 | class procedure ViewInRemoteRepository(const AFolderGit: String); 16 | class procedure ViewInformationRemoteRepository(const AFolderGit: String); 17 | class function GetNameCurrentBranchInGit(const AFolderGit: String): String; 18 | end; 19 | 20 | implementation 21 | 22 | uses 23 | C4D.Wizard.ProcessDelphi, 24 | C4D.Wizard.Consts, 25 | C4D.Wizard.Utils; 26 | 27 | class procedure TC4DWizardGitUtils.OpenInGitHubDesktop(const AFolderGit: String); 28 | var 29 | LFolderGit: String; 30 | begin 31 | LFolderGit := IncludeTrailingPathDelimiter(AFolderGit.Replace(TC4DConsts.C_NAME_FOLDER_GIT, EmptyStr)); 32 | TC4DWizardProcessDelphi.RunCommand(['github ' + LFolderGit]); 33 | end; 34 | 35 | class function TC4DWizardGitUtils.GetLinkRemoteRepository(const AFolderGit: String): String; 36 | var 37 | LIniFile: TIniFile; 38 | begin 39 | LIniFile := TIniFile.Create(AFolderGit + 'config'); 40 | try 41 | Result := LIniFile.ReadString('remote "origin"', 'url', EmptyStr); 42 | finally 43 | LIniFile.Free; 44 | end; 45 | end; 46 | 47 | class procedure TC4DWizardGitUtils.ViewInRemoteRepository(const AFolderGit: String); 48 | var 49 | LUrlRemote: String; 50 | begin 51 | LUrlRemote := Self.GetLinkRemoteRepository(AFolderGit); 52 | LUrlRemote := LUrlRemote.Replace('.git', EmptyStr); 53 | if(not LUrlRemote.Trim.IsEmpty)then 54 | TC4DWizardUtils.OpenLink(LUrlRemote); 55 | end; 56 | 57 | class procedure TC4DWizardGitUtils.ViewInformationRemoteRepository(const AFolderGit: String); 58 | var 59 | LUrlRemote: String; 60 | LTextFile: TextFile; 61 | LLineText: String; 62 | LBranch: String; 63 | begin 64 | LUrlRemote := Self.GetLinkRemoteRepository(AFolderGit); 65 | LUrlRemote := LUrlRemote.Replace('.git', EmptyStr); 66 | 67 | AssignFile(LTextFile, AFolderGit + 'HEAD'); 68 | try 69 | Reset(LTextFile); 70 | ReadLn(LTextFile, LLineText); 71 | finally 72 | CloseFile(LTextFile); 73 | end; 74 | 75 | LBranch := ''; 76 | if(not LLineText.Trim.IsEmpty)then 77 | LBranch := StringReplace(LLineText, 'ref: refs/heads/', '', [rfIgnoreCase, rfReplaceAll]); 78 | 79 | TC4DWizardUtils.ShowMsg(Format('%s %s Current Branch: %s', [LUrlRemote, sLineBreak, LBranch])); 80 | end; 81 | 82 | class function TC4DWizardGitUtils.GetNameCurrentBranchInGit(const AFolderGit: String): String; 83 | var 84 | LTextFile: TextFile; 85 | LLineText: String; 86 | LBranch: String; 87 | begin 88 | Result := ''; 89 | AssignFile(LTextFile, AFolderGit + 'HEAD'); 90 | try 91 | Reset(LTextFile); 92 | ReadLn(LTextFile, LLineText); 93 | finally 94 | CloseFile(LTextFile); 95 | end; 96 | 97 | if(not LLineText.Trim.IsEmpty)then 98 | Result := StringReplace(LLineText, 'ref: refs/heads/', '', [rfIgnoreCase, rfReplaceAll]); 99 | end; 100 | 101 | 102 | end. 103 | -------------------------------------------------------------------------------- /Src/Groups/C4D.Wizard.Groups.AddEdit.View.dfm: -------------------------------------------------------------------------------- 1 | object C4DWizardGroupsAddEditView: TC4DWizardGroupsAddEditView 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [biSystemMenu] 5 | Caption = 'Code4D - Groups XXX' 6 | ClientHeight = 179 7 | ClientWidth = 450 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | KeyPreview = True 15 | OldCreateOrder = False 16 | Position = poScreenCenter 17 | OnCreate = FormCreate 18 | OnDestroy = FormDestroy 19 | OnKeyDown = FormKeyDown 20 | OnShow = FormShow 21 | PixelsPerInch = 96 22 | TextHeight = 13 23 | object Panel1: TPanel 24 | Left = 0 25 | Top = 144 26 | Width = 450 27 | Height = 35 28 | Align = alBottom 29 | BevelEdges = [beLeft, beRight, beBottom] 30 | BevelOuter = bvNone 31 | Padding.Left = 2 32 | Padding.Top = 2 33 | Padding.Right = 2 34 | Padding.Bottom = 2 35 | ParentBackground = False 36 | TabOrder = 0 37 | object btnConfirm: TButton 38 | AlignWithMargins = True 39 | Left = 222 40 | Top = 2 41 | Width = 110 42 | Height = 31 43 | Cursor = crHandPoint 44 | Margins.Left = 0 45 | Margins.Top = 0 46 | Margins.Bottom = 0 47 | Align = alRight 48 | Caption = 'Confirm' 49 | TabOrder = 0 50 | OnClick = btnConfirmClick 51 | ExplicitLeft = 224 52 | end 53 | object btnClose: TButton 54 | AlignWithMargins = True 55 | Left = 335 56 | Top = 2 57 | Width = 110 58 | Height = 31 59 | Cursor = crHandPoint 60 | Margins.Left = 0 61 | Margins.Top = 0 62 | Margins.Bottom = 0 63 | Align = alRight 64 | Caption = 'Close' 65 | TabOrder = 1 66 | OnClick = btnCloseClick 67 | ExplicitLeft = 336 68 | end 69 | end 70 | object Panel9: TPanel 71 | Left = 0 72 | Top = 0 73 | Width = 450 74 | Height = 144 75 | Align = alClient 76 | BevelOuter = bvNone 77 | ParentBackground = False 78 | TabOrder = 1 79 | object Label1: TLabel 80 | Left = 32 81 | Top = 34 82 | Width = 58 83 | Height = 13 84 | Caption = 'Name group' 85 | end 86 | object Bevel1: TBevel 87 | AlignWithMargins = True 88 | Left = 0 89 | Top = 140 90 | Width = 450 91 | Height = 1 92 | Margins.Left = 0 93 | Margins.Top = 0 94 | Margins.Right = 0 95 | Align = alBottom 96 | Shape = bsTopLine 97 | ExplicitTop = 158 98 | ExplicitWidth = 441 99 | end 100 | object edtName: TEdit 101 | Left = 32 102 | Top = 50 103 | Width = 377 104 | Height = 21 105 | TabOrder = 0 106 | end 107 | object ckDefault: TCheckBox 108 | Left = 32 109 | Top = 88 110 | Width = 58 111 | Height = 17 112 | Cursor = crHandPoint 113 | Caption = 'Default' 114 | TabOrder = 1 115 | end 116 | end 117 | end 118 | -------------------------------------------------------------------------------- /Src/Groups/C4D.Wizard.Groups.AddEdit.View.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Groups.AddEdit.View; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, 7 | System.SysUtils, 8 | System.Classes, 9 | Vcl.Controls, 10 | Vcl.Forms, 11 | Vcl.StdCtrls, 12 | Vcl.ExtCtrls, 13 | C4D.Wizard.Groups; 14 | 15 | type 16 | TC4DWizardGroupsAddEditView = class(TForm) 17 | Panel1: TPanel; 18 | btnConfirm: TButton; 19 | btnClose: TButton; 20 | Panel9: TPanel; 21 | Label1: TLabel; 22 | Bevel1: TBevel; 23 | edtName: TEdit; 24 | ckDefault: TCheckBox; 25 | procedure btnCloseClick(Sender: TObject); 26 | procedure btnConfirmClick(Sender: TObject); 27 | procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 28 | procedure FormShow(Sender: TObject); 29 | procedure FormCreate(Sender: TObject); 30 | procedure FormDestroy(Sender: TObject); 31 | private 32 | FC4DWizardGroups: TC4DWizardGroups; 33 | public 34 | property C4DWizardGroups: TC4DWizardGroups read FC4DWizardGroups write FC4DWizardGroups; 35 | end; 36 | 37 | var 38 | C4DWizardGroupsAddEditView: TC4DWizardGroupsAddEditView; 39 | 40 | implementation 41 | 42 | uses 43 | C4D.Wizard.Utils, 44 | C4D.Wizard.Utils.OTA; 45 | 46 | {$R *.dfm} 47 | 48 | 49 | procedure TC4DWizardGroupsAddEditView.FormCreate(Sender: TObject); 50 | begin 51 | Self.ModalResult := mrCancel; 52 | TC4DWizardUtilsOTA.IDEThemingAll(TC4DWizardGroupsAddEditView, Self); 53 | end; 54 | 55 | procedure TC4DWizardGroupsAddEditView.FormDestroy(Sender: TObject); 56 | begin 57 | // 58 | end; 59 | 60 | procedure TC4DWizardGroupsAddEditView.FormShow(Sender: TObject); 61 | begin 62 | edtName.Text := FC4DWizardGroups.Name; 63 | ckDefault.Checked := FC4DWizardGroups.DefaultGroup; 64 | edtName.SetFocus; 65 | end; 66 | 67 | procedure TC4DWizardGroupsAddEditView.btnCloseClick(Sender: TObject); 68 | begin 69 | Self.Close; 70 | Self.ModalResult := mrCancel; 71 | end; 72 | 73 | procedure TC4DWizardGroupsAddEditView.btnConfirmClick(Sender: TObject); 74 | begin 75 | if(Trim(edtName.Text).IsEmpty)then 76 | TC4DWizardUtils.ShowMsgAndAbort('No informed name group', edtName); 77 | 78 | FC4DWizardGroups.Name := edtName.Text; 79 | FC4DWizardGroups.DefaultGroup := ckDefault.Checked; 80 | Self.Close; 81 | Self.ModalResult := mrOK; 82 | end; 83 | 84 | procedure TC4DWizardGroupsAddEditView.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 85 | begin 86 | case(Key)of 87 | VK_F4: 88 | if(ssAlt in Shift)then 89 | Key := 0; 90 | VK_ESCAPE: 91 | if(Shift = [])then 92 | btnClose.Click; 93 | end; 94 | end; 95 | 96 | end. 97 | -------------------------------------------------------------------------------- /Src/Groups/C4D.Wizard.Groups.Interfaces.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Groups.Interfaces; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | C4D.Wizard.Groups; 8 | 9 | type 10 | IC4DWizardGroupsModel = interface 11 | ['{08D4836C-F789-4228-8773-D9A1DC15AB57}'] 12 | procedure WriteInIniFile(AC4DWizardGroups: TC4DWizardGroups); 13 | function ReadGuidInIniFile(AGuid: string): TC4DWizardGroups; 14 | procedure ReadIniFile(AProc: TProc); 15 | procedure RemoveGuidInIniFile(AGuid: string); 16 | end; 17 | 18 | implementation 19 | 20 | end. 21 | -------------------------------------------------------------------------------- /Src/Groups/C4D.Wizard.Groups.Model.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Groups.Model; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.IniFiles, 8 | System.Classes, 9 | C4D.Wizard.Consts, 10 | C4D.Wizard.Groups.Interfaces, 11 | C4D.Wizard.Groups; 12 | 13 | type 14 | TC4DWizardGroupsModel = class(TInterfacedObject, IC4DWizardGroupsModel) 15 | private 16 | function GetIniFile: TIniFile; 17 | procedure CreateIniFileWithGroupsFixed(var AIniFile: TIniFile); 18 | procedure WriteDefaultFalseInIniFile; 19 | protected 20 | procedure WriteInIniFile(AC4DWizardGroups: TC4DWizardGroups); 21 | function ReadGuidInIniFile(AGuid: string): TC4DWizardGroups; 22 | procedure ReadIniFile(AProc: TProc); 23 | procedure RemoveGuidInIniFile(AGuid: string); 24 | public 25 | class function New: IC4DWizardGroupsModel; 26 | end; 27 | 28 | implementation 29 | 30 | uses 31 | C4D.Wizard.Utils, 32 | C4D.Wizard.Reopen.Model; 33 | 34 | class function TC4DWizardGroupsModel.New: IC4DWizardGroupsModel; 35 | begin 36 | Result := Self.Create; 37 | end; 38 | 39 | function TC4DWizardGroupsModel.GetIniFile: TIniFile; 40 | var 41 | LPathIniFile: string; 42 | begin 43 | LPathIniFile := TC4DWizardUtils.GetPathFileIniGroups; 44 | Result := TIniFile.Create(LPathIniFile); 45 | if(not FileExists(LPathIniFile))then 46 | Self.CreateIniFileWithGroupsFixed(Result); 47 | end; 48 | 49 | procedure TC4DWizardGroupsModel.CreateIniFileWithGroupsFixed(var AIniFile: TIniFile); 50 | begin 51 | AIniFile.Writestring(TC4DConsts.GROUPS_GUID_ALL, TC4DConsts.GROUPS_INI_Name, '- Show ALL'); 52 | AIniFile.WriteBool(TC4DConsts.GROUPS_GUID_ALL, TC4DConsts.GROUPS_INI_FixedSystem, True); 53 | AIniFile.WriteBool(TC4DConsts.GROUPS_GUID_ALL, TC4DConsts.GROUPS_INI_DefaultGroup, True); 54 | 55 | AIniFile.Writestring(TC4DConsts.GROUPS_GUID_NO_GROUP, TC4DConsts.GROUPS_INI_Name, '- No group'); 56 | AIniFile.WriteBool(TC4DConsts.GROUPS_GUID_NO_GROUP, TC4DConsts.GROUPS_INI_FixedSystem, True); 57 | AIniFile.WriteBool(TC4DConsts.GROUPS_GUID_NO_GROUP, TC4DConsts.GROUPS_INI_DefaultGroup, False); 58 | end; 59 | 60 | procedure TC4DWizardGroupsModel.WriteInIniFile(AC4DWizardGroups: TC4DWizardGroups); 61 | var 62 | LIniFile: TIniFile; 63 | begin 64 | if(AC4DWizardGroups.Guid.Trim.IsEmpty)or(AC4DWizardGroups.Name.Trim.IsEmpty)then 65 | Exit; 66 | 67 | if(AC4DWizardGroups.DefaultGroup)then 68 | Self.WriteDefaultFalseInIniFile; 69 | 70 | LIniFile := Self.GetIniFile; 71 | try 72 | LIniFile.Writestring(AC4DWizardGroups.Guid, TC4DConsts.GROUPS_INI_Name, AC4DWizardGroups.Name); 73 | LIniFile.WriteBool(AC4DWizardGroups.Guid, TC4DConsts.GROUPS_INI_FixedSystem, AC4DWizardGroups.FixedSystem); 74 | LIniFile.WriteBool(AC4DWizardGroups.Guid, TC4DConsts.GROUPS_INI_DefaultGroup, AC4DWizardGroups.DefaultGroup); 75 | finally 76 | LIniFile.Free; 77 | end; 78 | end; 79 | 80 | procedure TC4DWizardGroupsModel.WriteDefaultFalseInIniFile; 81 | var 82 | LIniFile: TIniFile; 83 | LSections: TStrings; 84 | LSessaoStr: string; 85 | i: Integer; 86 | begin 87 | LIniFile := Self.GetIniFile; 88 | try 89 | LSections := TStringList.Create; 90 | try 91 | LIniFile.ReadSections(LSections); 92 | for i := 0 to Pred(LSections.Count) do 93 | begin 94 | LSessaoStr := LSections[i]; 95 | if(LIniFile.ReadBool(LSessaoStr, TC4DConsts.GROUPS_INI_DefaultGroup, False))then 96 | LIniFile.WriteBool(LSessaoStr, TC4DConsts.GROUPS_INI_DefaultGroup, False); 97 | end; 98 | finally 99 | LSections.Free; 100 | end; 101 | finally 102 | LIniFile.Free; 103 | end; 104 | end; 105 | 106 | function TC4DWizardGroupsModel.ReadGuidInIniFile(AGuid: string): TC4DWizardGroups; 107 | var 108 | LIniFile: TIniFile; 109 | begin 110 | Result := nil; 111 | if(AGuid.Trim.IsEmpty)then 112 | Exit; 113 | 114 | LIniFile := Self.GetIniFile; 115 | try 116 | Result.Guid := AGuid; 117 | Result.Name := LIniFile.Readstring(AGuid, TC4DConsts.GROUPS_INI_Name, ''); 118 | Result.FixedSystem := LIniFile.ReadBool(AGuid, TC4DConsts.GROUPS_INI_FixedSystem, False); 119 | Result.DefaultGroup := LIniFile.ReadBool(AGuid, TC4DConsts.GROUPS_INI_DefaultGroup, False); 120 | finally 121 | LIniFile.Free; 122 | end; 123 | end; 124 | 125 | procedure TC4DWizardGroupsModel.ReadIniFile(AProc: TProc); 126 | var 127 | LIniFile: TIniFile; 128 | LSections: TStrings; 129 | LSessaoStr: string; 130 | i: Integer; 131 | LC4DWizardGroups: TC4DWizardGroups; 132 | begin 133 | LIniFile := Self.GetIniFile; 134 | try 135 | LSections := TStringList.Create; 136 | try 137 | LIniFile.ReadSections(LSections); 138 | for i := 0 to Pred(LSections.Count) do 139 | begin 140 | LSessaoStr := LSections[i]; 141 | LC4DWizardGroups := TC4DWizardGroups.Create; 142 | try 143 | LC4DWizardGroups.Guid := LSessaoStr; 144 | LC4DWizardGroups.Name := LIniFile.Readstring(LSessaoStr, TC4DConsts.GROUPS_INI_Name, ''); 145 | LC4DWizardGroups.FixedSystem := LIniFile.ReadBool(LSessaoStr, TC4DConsts.GROUPS_INI_FixedSystem, False); 146 | LC4DWizardGroups.DefaultGroup := LIniFile.ReadBool(LSessaoStr, TC4DConsts.GROUPS_INI_DefaultGroup, False); 147 | AProc(LC4DWizardGroups); 148 | finally 149 | LC4DWizardGroups.Free; 150 | end; 151 | end; 152 | finally 153 | LSections.Free; 154 | end; 155 | finally 156 | LIniFile.Free; 157 | end; 158 | end; 159 | 160 | procedure TC4DWizardGroupsModel.RemoveGuidInIniFile(AGuid: string); 161 | var 162 | LIniFile: TIniFile; 163 | begin 164 | if(AGuid.Trim.ToUpper = TC4DConsts.GROUPS_GUID_ALL)or(AGuid.Trim.ToUpper = TC4DConsts.GROUPS_GUID_NO_GROUP)then 165 | Exit; 166 | 167 | if(TC4DWizardReopenModel.New.ReadIniFileIfExistGuidGroup(AGuid))then 168 | TC4DWizardUtils.ShowMsgAndAbort('This group cannot be deleted, as it is linked to a register of Reopen.'); 169 | 170 | LIniFile := Self.GetIniFile; 171 | try 172 | LIniFile.EraseSection(AGuid); 173 | finally 174 | LIniFile.Free; 175 | end; 176 | end; 177 | 178 | end. 179 | -------------------------------------------------------------------------------- /Src/Groups/C4D.Wizard.Groups.View.dfm: -------------------------------------------------------------------------------- 1 | object C4DWizardGroupsView: TC4DWizardGroupsView 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [biSystemMenu] 5 | Caption = 'Code4D - Group View' 6 | ClientHeight = 505 7 | ClientWidth = 606 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | KeyPreview = True 15 | OldCreateOrder = False 16 | Position = poScreenCenter 17 | OnCreate = FormCreate 18 | OnKeyDown = FormKeyDown 19 | OnShow = FormShow 20 | PixelsPerInch = 96 21 | TextHeight = 13 22 | object Panel1: TPanel 23 | Left = 0 24 | Top = 451 25 | Width = 606 26 | Height = 35 27 | Align = alBottom 28 | BevelEdges = [beLeft, beRight, beBottom] 29 | BevelOuter = bvNone 30 | Padding.Left = 2 31 | Padding.Top = 2 32 | Padding.Right = 2 33 | Padding.Bottom = 2 34 | ParentBackground = False 35 | TabOrder = 0 36 | object btnEdit: TButton 37 | AlignWithMargins = True 38 | Left = 114 39 | Top = 2 40 | Width = 110 41 | Height = 31 42 | Cursor = crHandPoint 43 | Margins.Left = 0 44 | Margins.Top = 0 45 | Margins.Right = 2 46 | Margins.Bottom = 0 47 | Align = alLeft 48 | Caption = 'Edit' 49 | TabOrder = 0 50 | OnClick = btnEditClick 51 | end 52 | object btnClose: TButton 53 | AlignWithMargins = True 54 | Left = 492 55 | Top = 2 56 | Width = 110 57 | Height = 31 58 | Cursor = crHandPoint 59 | Margins.Left = 0 60 | Margins.Top = 0 61 | Margins.Right = 2 62 | Margins.Bottom = 0 63 | Align = alRight 64 | Caption = 'Close' 65 | TabOrder = 1 66 | OnClick = btnCloseClick 67 | end 68 | object btnAdd: TButton 69 | AlignWithMargins = True 70 | Left = 2 71 | Top = 2 72 | Width = 110 73 | Height = 31 74 | Cursor = crHandPoint 75 | Margins.Left = 0 76 | Margins.Top = 0 77 | Margins.Right = 2 78 | Margins.Bottom = 0 79 | Align = alLeft 80 | Caption = 'Add new' 81 | TabOrder = 2 82 | OnClick = btnAddClick 83 | end 84 | object btnRemove: TButton 85 | AlignWithMargins = True 86 | Left = 226 87 | Top = 2 88 | Width = 110 89 | Height = 31 90 | Cursor = crHandPoint 91 | Margins.Left = 0 92 | Margins.Top = 0 93 | Margins.Right = 2 94 | Margins.Bottom = 0 95 | Align = alLeft 96 | Caption = 'Remove' 97 | TabOrder = 3 98 | OnClick = btnRemoveClick 99 | end 100 | end 101 | object ListViewHistory: TListView 102 | Left = 0 103 | Top = 50 104 | Width = 606 105 | Height = 401 106 | Align = alClient 107 | Columns = < 108 | item 109 | Caption = 'Name group' 110 | Width = 470 111 | end 112 | item 113 | Caption = 'Default' 114 | Width = 55 115 | end 116 | item 117 | Caption = 'Fixed' 118 | Width = 55 119 | end 120 | item 121 | Caption = 'Guid' 122 | Width = 0 123 | end> 124 | Font.Charset = DEFAULT_CHARSET 125 | Font.Color = clWindowText 126 | Font.Height = -12 127 | Font.Name = 'Tahoma' 128 | Font.Style = [] 129 | ReadOnly = True 130 | RowSelect = True 131 | ParentFont = False 132 | SortType = stText 133 | TabOrder = 1 134 | ViewStyle = vsReport 135 | OnDblClick = ListViewHistoryDblClick 136 | OnKeyDown = ListViewHistoryKeyDown 137 | OnSelectItem = ListViewHistorySelectItem 138 | end 139 | object pnTop: TPanel 140 | Left = 0 141 | Top = 0 142 | Width = 606 143 | Height = 50 144 | Margins.Left = 0 145 | Margins.Top = 0 146 | Margins.Right = 0 147 | Margins.Bottom = 0 148 | Align = alTop 149 | BevelOuter = bvNone 150 | TabOrder = 2 151 | object btnSearch: TButton 152 | AlignWithMargins = True 153 | Left = 521 154 | Top = 14 155 | Width = 75 156 | Height = 27 157 | Cursor = crHandPoint 158 | Margins.Left = 2 159 | Margins.Top = 14 160 | Margins.Right = 10 161 | Margins.Bottom = 9 162 | Align = alRight 163 | Caption = 'Buscar' 164 | TabOrder = 0 165 | OnClick = btnSearchClick 166 | end 167 | object edtSearch: TEdit 168 | AlignWithMargins = True 169 | Left = 10 170 | Top = 15 171 | Width = 509 172 | Height = 25 173 | Margins.Left = 10 174 | Margins.Top = 15 175 | Margins.Right = 0 176 | Margins.Bottom = 10 177 | Align = alClient 178 | AutoSize = False 179 | TabOrder = 1 180 | OnKeyDown = edtSearchKeyDown 181 | end 182 | end 183 | object StatusBar1: TStatusBar 184 | Left = 0 185 | Top = 486 186 | Width = 606 187 | Height = 19 188 | Panels = < 189 | item 190 | Width = 50 191 | end 192 | item 193 | Width = 50 194 | end> 195 | end 196 | end 197 | -------------------------------------------------------------------------------- /Src/Groups/C4D.Wizard.Groups.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Groups; 2 | 3 | interface 4 | 5 | type 6 | TC4DWizardGroups = class 7 | private 8 | FGuid: string; 9 | FName: string; 10 | FFixedSystem: Boolean; 11 | FDefaultGroup: Boolean; 12 | public 13 | property Guid: string read FGuid write FGuid; 14 | property Name: string read FName write FName; 15 | property FixedSystem: Boolean read FFixedSystem write FFixedSystem; 16 | property DefaultGroup: Boolean read FDefaultGroup write FDefaultGroup; 17 | procedure Clear; 18 | constructor Create; 19 | end; 20 | 21 | implementation 22 | 23 | constructor TC4DWizardGroups.Create; 24 | begin 25 | Self.Clear; 26 | end; 27 | 28 | procedure TC4DWizardGroups.Clear; 29 | begin 30 | FGuid := ''; 31 | FName := ''; 32 | FFixedSystem := False; 33 | FDefaultGroup := False; 34 | end; 35 | 36 | end. 37 | -------------------------------------------------------------------------------- /Src/IDE/About/C4D.Wizard.IDE.About.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.About; 2 | 3 | interface 4 | 5 | implementation 6 | 7 | uses 8 | System.SysUtils, 9 | Winapi.Windows, 10 | ToolsAPI, 11 | C4D.Wizard.Consts; 12 | 13 | var 14 | OTAAboutBoxServices: IOTAAboutBoxServices = nil; 15 | IndexAboutBox: Integer = 0; 16 | 17 | procedure RegisterAboutBox; 18 | var 19 | LDescription: string; 20 | begin 21 | if(not Supports(BorlandIDEServices, IOTAAboutBoxServices, OTAAboutBoxServices))then 22 | Exit; 23 | 24 | LDescription := TC4DConsts.ABOUT_COPY_RIGHT + sLineBreak + TC4DConsts.ABOUT_DESCRIPTION + sLineBreak + 25 | TC4DConsts.GITHUB_Code4D_Wizard + sLineBreak + TC4DConsts.SEMANTIC_VERSION_LB + sLineBreak + TC4DConsts.WIZARD_LICENSE; 26 | 27 | IndexAboutBox := OTAAboutBoxServices.AddPluginInfo(TC4DConsts.ABOUT_TITLE, LDescription, 28 | LoadBitmap(HInstance, TC4DConsts.RESOURCE_c4d_logo_48x48), TC4DConsts.IS_UNREGISTERED, TC4DConsts.WIZARD_LICENSE); 29 | end; 30 | 31 | procedure UnregisterAboutBox; 32 | begin 33 | if(IndexAboutBox > 0)and Assigned(OTAAboutBoxServices)then 34 | begin 35 | OTAAboutBoxServices.RemovePluginInfo(IndexAboutBox); 36 | IndexAboutBox := 0; 37 | OTAAboutBoxServices := nil; 38 | end; 39 | end; 40 | 41 | initialization 42 | RegisterAboutBox; 43 | 44 | finalization 45 | UnregisterAboutBox; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /Src/IDE/CompileNotifier/C4D.Wizard.IDE.CompileNotifier.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.CompileNotifier; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | ToolsAPI; 9 | 10 | type 11 | TC4DWizardIDECompileNotifier = class(TNotifierObject, IOTACompileNotifier) 12 | private 13 | protected 14 | procedure ProjectCompileStarted(const Project: IOTAProject; Mode: TOTACompileMode); 15 | procedure ProjectCompileFinished(const Project: IOTAProject; Result: TOTACompileResult); 16 | procedure ProjectGroupCompileStarted(Mode: TOTACompileMode); 17 | procedure ProjectGroupCompileFinished(Result: TOTACompileResult); 18 | public 19 | constructor Create; 20 | destructor Destroy; override; 21 | end; 22 | 23 | procedure RegisterSelf; 24 | 25 | implementation 26 | 27 | uses 28 | C4D.Wizard.Consts, 29 | C4D.Wizard.Utils, 30 | C4D.Wizard.Utils.OTA, 31 | C4D.Wizard.Settings.Model, 32 | C4D.Wizard.ProcessDelphi; 33 | 34 | var 35 | IndexNotifier: Integer = -1; 36 | 37 | procedure RegisterSelf; 38 | begin 39 | if(IndexNotifier < 0)then 40 | IndexNotifier := TC4DWizardUtilsOTA.GetIOTACompileServices.AddNotifier(TC4DWizardIDECompileNotifier.Create); 41 | end; 42 | 43 | constructor TC4DWizardIDECompileNotifier.Create; 44 | begin 45 | 46 | end; 47 | 48 | destructor TC4DWizardIDECompileNotifier.Destroy; 49 | begin 50 | inherited; 51 | end; 52 | 53 | procedure TC4DWizardIDECompileNotifier.ProjectCompileStarted(const Project: IOTAProject; Mode: TOTACompileMode); 54 | var 55 | LIOTAProject: IOTAProject; 56 | LCurrentBinaryPath: string; 57 | LCommand: string; 58 | begin 59 | if(not C4DWizardSettingsModel.BeforeCompilingCheckRunning)then 60 | Exit; 61 | 62 | LIOTAProject := TC4DWizardUtilsOTA.GetCurrentProject; 63 | 64 | if(TC4DWizardUtils.FileNameIsC4DWizardDPROJ(LIOTAProject.FileName))then 65 | Exit; 66 | 67 | LCurrentBinaryPath := TC4DWizardUtilsOTA.GetBinaryPathCurrent; 68 | if(FileExists(LCurrentBinaryPath))then 69 | begin 70 | if(TC4DWizardUtils.ProcessWindowsExists(ExtractFileName(LCurrentBinaryPath), LCurrentBinaryPath))then 71 | begin 72 | if(not TC4DWizardUtils.ShowQuestion2('The application is already running, do you wish to continue (Kills current process)?'))then 73 | Abort; 74 | 75 | LCommand := 'taskkill /f /IM ' + ExtractFileName(Project.ProjectOptions.TargetName); 76 | TC4DWizardProcessDelphi.RunCommand([LCommand]); 77 | Sleep(1000); 78 | end; 79 | end; 80 | end; 81 | 82 | procedure TC4DWizardIDECompileNotifier.ProjectCompileFinished(const Project: IOTAProject; Result: TOTACompileResult); 83 | begin 84 | 85 | end; 86 | 87 | procedure TC4DWizardIDECompileNotifier.ProjectGroupCompileStarted(Mode: TOTACompileMode); 88 | begin 89 | 90 | end; 91 | 92 | procedure TC4DWizardIDECompileNotifier.ProjectGroupCompileFinished(Result: TOTACompileResult); 93 | begin 94 | 95 | end; 96 | 97 | initialization 98 | 99 | finalization 100 | if(IndexNotifier >= 0)then 101 | begin 102 | TC4DWizardUtilsOTA.GetIOTACompileServices.RemoveNotifier(IndexNotifier); 103 | IndexNotifier := -1; 104 | end; 105 | 106 | end. 107 | -------------------------------------------------------------------------------- /Src/IDE/EditServicesNotifier/C4D.Wizard.IDE.EditServicesNotifier.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Src/IDE/EditServicesNotifier/C4D.Wizard.IDE.EditServicesNotifier.pas -------------------------------------------------------------------------------- /Src/IDE/MainMenu/C4D.Wizard.IDE.MainMenu.Backup.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.MainMenu.Backup; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | VCL.Menus, 9 | C4D.Wizard.Backup.Interfaces; 10 | 11 | type 12 | TC4DWizardIDEMainMenuBackup = class(TInterfacedObject, IC4DWizardIDEMainMenuBackup) 13 | private 14 | FMenuItemC4D: TMenuItem; 15 | FMenuItemSave: TMenuItem; 16 | procedure AddMenuItemSave; 17 | procedure AddMenuItemExport; 18 | procedure AddMenuItemImport; 19 | protected 20 | function Process: IC4DWizardIDEMainMenuBackup; 21 | public 22 | class function New(AMenuItemParent: TMenuItem): IC4DWizardIDEMainMenuBackup; 23 | constructor Create(AMenuItemParent: TMenuItem); 24 | end; 25 | 26 | implementation 27 | 28 | uses 29 | C4D.Wizard.Consts, 30 | C4D.Wizard.IDE.ImageListMain, 31 | C4D.Wizard.IDE.MainMenu.Clicks; 32 | 33 | class function TC4DWizardIDEMainMenuBackup.New(AMenuItemParent: TMenuItem): IC4DWizardIDEMainMenuBackup; 34 | begin 35 | Result := Self.Create(AMenuItemParent); 36 | end; 37 | 38 | constructor TC4DWizardIDEMainMenuBackup.Create(AMenuItemParent: TMenuItem); 39 | begin 40 | FMenuItemC4D := AMenuItemParent; 41 | end; 42 | 43 | function TC4DWizardIDEMainMenuBackup.Process: IC4DWizardIDEMainMenuBackup; 44 | begin 45 | Self.AddMenuItemSave; 46 | Self.AddMenuItemExport; 47 | Self.AddMenuItemImport; 48 | end; 49 | 50 | procedure TC4DWizardIDEMainMenuBackup.AddMenuItemSave; 51 | begin 52 | FMenuItemSave := TMenuItem.Create(FMenuItemC4D); 53 | FMenuItemSave.Name := TC4DConsts.MENU_IDE_BACKUP_NAME; 54 | FMenuItemSave.Caption := TC4DConsts.MENU_IDE_BACKUP_CAPTION; 55 | FMenuItemSave.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexSave; 56 | FMenuItemC4D.Add(FMenuItemSave); 57 | end; 58 | 59 | procedure TC4DWizardIDEMainMenuBackup.AddMenuItemExport; 60 | var 61 | LItemExport: TMenuItem; 62 | begin 63 | LItemExport := TMenuItem.Create(FMenuItemSave); 64 | LItemExport.Name := TC4DConsts.MENU_IDE_EXPORT_NAME; 65 | LItemExport.Caption := TC4DConsts.MENU_IDE_EXPORT_CAPTION; 66 | LItemExport.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexExport; 67 | LItemExport.OnClick := TC4DWizardIDEMainMenuClicks.BackupExportClick; 68 | FMenuItemSave.Add(LItemExport); 69 | end; 70 | 71 | procedure TC4DWizardIDEMainMenuBackup.AddMenuItemImport; 72 | var 73 | LItemImport: TMenuItem; 74 | begin 75 | LItemImport := TMenuItem.Create(FMenuItemSave); 76 | LItemImport.Name := TC4DConsts.MENU_IDE_IMPORT_NAME; 77 | LItemImport.Caption := TC4DConsts.MENU_IDE_IMPORT_CAPTION; 78 | LItemImport.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexImport; 79 | LItemImport.OnClick := TC4DWizardIDEMainMenuClicks.BackupImportClick; 80 | FMenuItemSave.Add(LItemImport); 81 | end; 82 | 83 | end. 84 | -------------------------------------------------------------------------------- /Src/IDE/MainMenu/C4D.Wizard.IDE.MainMenu.Register.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.MainMenu.Register; 2 | 3 | interface 4 | 5 | uses 6 | ToolsAPI, 7 | System.Classes, 8 | System.SysUtils, 9 | C4D.Wizard.Interfaces; 10 | 11 | type 12 | TC4DWizardIDEMainMenuRegister = class(TNotifierObject, IOTAWizard) 13 | private 14 | protected 15 | function GetIDstring: string; 16 | function GetName: string; 17 | function GetState: TWizardState; 18 | procedure Execute; 19 | public 20 | constructor Create; 21 | destructor Destroy; override; 22 | end; 23 | 24 | procedure RegisterSelf; 25 | procedure UnRegisterSelf; 26 | 27 | implementation 28 | 29 | uses 30 | C4D.Wizard.IDE.MainMenu, 31 | C4D.Wizard.Utils.OTA; 32 | 33 | var 34 | C4DWizardIDEMainMenuRegister: TC4DWizardIDEMainMenuRegister; 35 | IndexWizard: Integer = -1; 36 | 37 | procedure RegisterSelf; 38 | var 39 | LWizard: IOTAWizard; 40 | begin 41 | C4DWizardIDEMainMenuRegister := TC4DWizardIDEMainMenuRegister.Create; 42 | 43 | if(Supports(TObject(C4DWizardIDEMainMenuRegister), IOTAWizard, LWizard))then 44 | IndexWizard := TC4DWizardUtilsOTA.GetIOTAWizardServices.AddWizard(LWizard); 45 | end; 46 | 47 | procedure UnRegisterSelf; 48 | begin 49 | if(IndexWizard >= 0)then 50 | begin 51 | TC4DWizardUtilsOTA.GetIOTAWizardServices.RemoveWizard(IndexWizard); 52 | IndexWizard := -1; 53 | end; 54 | end; 55 | 56 | constructor TC4DWizardIDEMainMenuRegister.Create; 57 | begin 58 | TC4DWizardIDEMainMenu.GetInstance.CreateMenus; 59 | end; 60 | 61 | destructor TC4DWizardIDEMainMenuRegister.Destroy; 62 | begin 63 | inherited; 64 | end; 65 | 66 | function TC4DWizardIDEMainMenuRegister.GetIDstring: string; 67 | begin 68 | Result := Self.ClassName; 69 | end; 70 | 71 | function TC4DWizardIDEMainMenuRegister.GetName: string; 72 | begin 73 | Result := Self.ClassName; 74 | end; 75 | 76 | function TC4DWizardIDEMainMenuRegister.GetState: TWizardState; 77 | begin 78 | Result := [wsEnabled]; 79 | end; 80 | 81 | procedure TC4DWizardIDEMainMenuRegister.Execute; 82 | begin 83 | 84 | end; 85 | 86 | end. 87 | -------------------------------------------------------------------------------- /Src/IDE/MainMenu/C4D.Wizard.IDE.MainMenu.VsCodeIntegration.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.MainMenu.VsCodeIntegration; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | VCL.Menus; 9 | 10 | type 11 | IC4DWizardIDEMainMenuVsCodeIntegration = interface 12 | ['{9B729013-F7A2-4B98-AC35-994E236682A0}'] 13 | function Process: IC4DWizardIDEMainMenuVsCodeIntegration; 14 | end; 15 | 16 | TC4DWizardIDEMainMenuVsCodeIntegration = class(TInterfacedObject, IC4DWizardIDEMainMenuVsCodeIntegration) 17 | private 18 | FMenuItemC4D: TMenuItem; 19 | FMenuItemVsCodeIntegration: TMenuItem; 20 | procedure AddMenuVsCodeIntegration; 21 | procedure AddSubMenuItemOpen; 22 | procedure AddSeparator(AName: string); 23 | procedure AddSubMenuInstallDelphiLSP; 24 | procedure AddSubMenuInstallGithubCopilot; 25 | procedure AddSubMenuInstallSupermaven; 26 | function GetShortcutOpenInVsCode: string; 27 | protected 28 | function Process: IC4DWizardIDEMainMenuVsCodeIntegration; 29 | public 30 | class function New(AMenuItemParent: TMenuItem): IC4DWizardIDEMainMenuVsCodeIntegration; 31 | constructor Create(AMenuItemParent: TMenuItem); 32 | end; 33 | 34 | implementation 35 | 36 | uses 37 | C4D.Wizard.Consts, 38 | C4D.Wizard.Utils, 39 | C4D.Wizard.IDE.ImageListMain, 40 | C4D.Wizard.IDE.MainMenu.Clicks, 41 | C4D.Wizard.Settings.Model; 42 | 43 | class function TC4DWizardIDEMainMenuVsCodeIntegration.New(AMenuItemParent: TMenuItem): IC4DWizardIDEMainMenuVsCodeIntegration; 44 | begin 45 | Result := Self.Create(AMenuItemParent); 46 | end; 47 | 48 | constructor TC4DWizardIDEMainMenuVsCodeIntegration.Create(AMenuItemParent: TMenuItem); 49 | begin 50 | FMenuItemC4D := AMenuItemParent; 51 | end; 52 | 53 | function TC4DWizardIDEMainMenuVsCodeIntegration.Process: IC4DWizardIDEMainMenuVsCodeIntegration; 54 | begin 55 | Self.AddMenuVsCodeIntegration; 56 | Self.AddSubMenuItemOpen; 57 | Self.AddSeparator('C4DVsCodeIntegrationSeparator01'); 58 | Self.AddSubMenuInstallDelphiLSP; 59 | Self.AddSubMenuInstallGithubCopilot; 60 | Self.AddSubMenuInstallSupermaven; 61 | end; 62 | 63 | procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSeparator(AName: string); 64 | var 65 | LMenuItem: TMenuItem; 66 | begin 67 | LMenuItem := TMenuItem.Create(FMenuItemVsCodeIntegration); 68 | LMenuItem.Name := AName; 69 | LMenuItem.Caption := '-'; 70 | LMenuItem.ImageIndex := -1; 71 | LMenuItem.OnClick := nil; 72 | FMenuItemVsCodeIntegration.Add(LMenuItem); 73 | end; 74 | 75 | procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddMenuVsCodeIntegration; 76 | begin 77 | FMenuItemVsCodeIntegration := TMenuItem.Create(FMenuItemC4D); 78 | FMenuItemVsCodeIntegration.Name := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_NAME; 79 | FMenuItemVsCodeIntegration.Caption := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_CAPTION; 80 | FMenuItemVsCodeIntegration.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexVsCode; 81 | FMenuItemC4D.Add(FMenuItemVsCodeIntegration); 82 | end; 83 | 84 | procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSubMenuItemOpen; 85 | var 86 | LMenuItem: TMenuItem; 87 | begin 88 | LMenuItem := TMenuItem.Create(FMenuItemVsCodeIntegration); 89 | LMenuItem.Name := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_OPEN_NAME; 90 | LMenuItem.Caption := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_OPEN_CAPTION; 91 | LMenuItem.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexVsCode; 92 | LMenuItem.OnClick := TC4DWizardIDEMainMenuClicks.VsCodeIntegrationOpenInVsCodeClick; 93 | LMenuItem.ShortCut := TextToShortCut(TC4DWizardUtils.RemoveSpacesAll(Self.GetShortcutOpenInVsCode)); 94 | FMenuItemVsCodeIntegration.Add(LMenuItem); 95 | end; 96 | 97 | procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSubMenuInstallDelphiLSP; 98 | var 99 | LMenuItem: TMenuItem; 100 | begin 101 | LMenuItem := TMenuItem.Create(FMenuItemVsCodeIntegration); 102 | LMenuItem.Name := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_DELPHILSP_NAME; 103 | LMenuItem.Caption := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_DELPHILSP_CAPTION; 104 | LMenuItem.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexImport; 105 | LMenuItem.OnClick := TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallDelphiLSPClick; 106 | FMenuItemVsCodeIntegration.Add(LMenuItem); 107 | end; 108 | 109 | procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSubMenuInstallGithubCopilot; 110 | var 111 | LMenuItem: TMenuItem; 112 | begin 113 | LMenuItem := TMenuItem.Create(FMenuItemVsCodeIntegration); 114 | LMenuItem.Name := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_GithubCopilot_NAME; 115 | LMenuItem.Caption := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_GithubCopilot_CAPTION; 116 | LMenuItem.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexImport; 117 | LMenuItem.OnClick := TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallGithubCopilotClick; 118 | FMenuItemVsCodeIntegration.Add(LMenuItem); 119 | end; 120 | 121 | function TC4DWizardIDEMainMenuVsCodeIntegration.GetShortcutOpenInVsCode: string; 122 | begin 123 | Result := ''; 124 | if(C4DWizardSettingsModel.ShortcutVsCodeIntegrationOpenUse)and(not C4DWizardSettingsModel.ShortcutVsCodeIntegrationOpen.Trim.IsEmpty)then 125 | Result := C4DWizardSettingsModel.ShortcutVsCodeIntegrationOpen.Trim; 126 | end; 127 | 128 | procedure TC4DWizardIDEMainMenuVsCodeIntegration.AddSubMenuInstallSupermaven; 129 | var 130 | LMenuItem: TMenuItem; 131 | begin 132 | LMenuItem := TMenuItem.Create(FMenuItemVsCodeIntegration); 133 | LMenuItem.Name := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_Supermaven_NAME; 134 | LMenuItem.Caption := TC4DConsts.MENU_IDE_VSCODE_INTEGRATION_INSTALL_Supermaven_CAPTION; 135 | LMenuItem.ImageIndex := TC4DWizardIDEImageListMain.GetInstance.ImgIndexImport; 136 | LMenuItem.OnClick := TC4DWizardIDEMainMenuClicks.VsCodeIntegrationInstallSupermavenClick; 137 | FMenuItemVsCodeIntegration.Add(LMenuItem); 138 | end; 139 | 140 | end. 141 | -------------------------------------------------------------------------------- /Src/IDE/PopupMenu/C4D.Wizard.IDE.PopupMenu.Item.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.PopupMenu.Item; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | ToolsAPI, 9 | C4D.Wizard.Types; 10 | 11 | type 12 | TC4DWizardIDEPopupMenuItem = class(TNotifierObject, IOTALocalMenu, IOTAProjectManagerMenu) 13 | private 14 | FCaption: string; 15 | FIsMultiSelectable: Boolean; 16 | FChecked: Boolean; 17 | FEnabled: Boolean; 18 | FHelpContext: Integer; 19 | FName: string; 20 | FParent: string; 21 | FPosition: Integer; 22 | FVerb: string; 23 | protected 24 | FProject: IOTAProject; 25 | FOnExecute: TC4DWizardMenuContextList; 26 | function GetCaption: string; 27 | function GetChecked: Boolean; 28 | function GetEnabled: Boolean; 29 | function GetHelpContext: Integer; 30 | function GetName: string; 31 | function GetParent: string; 32 | function GetPosition: Integer; 33 | function GetVerb: string; 34 | procedure SetCaption(const Value: string); 35 | procedure SetChecked(Value: Boolean); 36 | procedure SetEnabled(Value: Boolean); 37 | procedure SetHelpContext(Value: Integer); 38 | procedure SetName(const Value: string); 39 | procedure SetParent(const Value: string); 40 | procedure SetPosition(Value: Integer); 41 | procedure SetVerb(const Value: string); 42 | function GetIsMultiSelectable: Boolean; 43 | procedure SetIsMultiSelectable(Value: Boolean); 44 | procedure Execute(const MenuContextList: IInterfaceList); virtual; 45 | function PreExecute(const MenuContextList: IInterfaceList): Boolean; 46 | function PostExecute(const MenuContextList: IInterfaceList): Boolean; 47 | public 48 | class function New(OnExecute: TC4DWizardMenuContextList): IOTAProjectManagerMenu; overload; 49 | constructor Create(OnExecute: TC4DWizardMenuContextList); overload; 50 | end; 51 | 52 | implementation 53 | 54 | class function TC4DWizardIDEPopupMenuItem.New(OnExecute: TC4DWizardMenuContextList): IOTAProjectManagerMenu; 55 | begin 56 | Result := Self.Create(OnExecute); 57 | end; 58 | 59 | constructor TC4DWizardIDEPopupMenuItem.Create(OnExecute: TC4DWizardMenuContextList); 60 | begin 61 | FOnExecute := OnExecute; 62 | FEnabled := True; 63 | FChecked := False; 64 | FIsMultiSelectable := False; 65 | end; 66 | 67 | procedure TC4DWizardIDEPopupMenuItem.Execute(const MenuContextList: IInterfaceList); 68 | begin 69 | if(Assigned(FOnExecute))then 70 | FOnExecute(MenuContextList); 71 | end; 72 | 73 | function TC4DWizardIDEPopupMenuItem.GetCaption: string; 74 | begin 75 | Result := FCaption; 76 | end; 77 | 78 | function TC4DWizardIDEPopupMenuItem.GetChecked: Boolean; 79 | begin 80 | Result := FChecked; 81 | end; 82 | 83 | function TC4DWizardIDEPopupMenuItem.GetEnabled: Boolean; 84 | begin 85 | Result := FEnabled; 86 | end; 87 | 88 | function TC4DWizardIDEPopupMenuItem.GetHelpContext: Integer; 89 | begin 90 | Result := FHelpContext; 91 | end; 92 | 93 | function TC4DWizardIDEPopupMenuItem.GetIsMultiSelectable: Boolean; 94 | begin 95 | Result := FIsMultiSelectable; 96 | end; 97 | 98 | function TC4DWizardIDEPopupMenuItem.GetName: string; 99 | begin 100 | Result := FName; 101 | end; 102 | 103 | function TC4DWizardIDEPopupMenuItem.GetParent: string; 104 | begin 105 | Result := FParent; 106 | end; 107 | 108 | function TC4DWizardIDEPopupMenuItem.GetPosition: Integer; 109 | begin 110 | Result := FPosition; 111 | end; 112 | 113 | function TC4DWizardIDEPopupMenuItem.GetVerb: string; 114 | begin 115 | Result := FVerb; 116 | end; 117 | 118 | function TC4DWizardIDEPopupMenuItem.PostExecute(const MenuContextList: IInterfaceList): Boolean; 119 | begin 120 | Result := True; 121 | end; 122 | 123 | function TC4DWizardIDEPopupMenuItem.PreExecute(const MenuContextList: IInterfaceList): Boolean; 124 | begin 125 | Result := True; 126 | end; 127 | 128 | procedure TC4DWizardIDEPopupMenuItem.SetCaption(const Value: string); 129 | begin 130 | FCaption := Value; 131 | end; 132 | 133 | procedure TC4DWizardIDEPopupMenuItem.SetChecked(Value: Boolean); 134 | begin 135 | FChecked := Value; 136 | end; 137 | 138 | procedure TC4DWizardIDEPopupMenuItem.SetEnabled(Value: Boolean); 139 | begin 140 | FEnabled := Value; 141 | end; 142 | 143 | procedure TC4DWizardIDEPopupMenuItem.SetHelpContext(Value: Integer); 144 | begin 145 | FHelpContext := Value; 146 | end; 147 | 148 | procedure TC4DWizardIDEPopupMenuItem.SetIsMultiSelectable(Value: Boolean); 149 | begin 150 | FIsMultiSelectable := Value; 151 | end; 152 | 153 | procedure TC4DWizardIDEPopupMenuItem.SetName(const Value: string); 154 | begin 155 | FName := Value; 156 | end; 157 | 158 | procedure TC4DWizardIDEPopupMenuItem.SetParent(const Value: string); 159 | begin 160 | FParent := Value; 161 | end; 162 | 163 | procedure TC4DWizardIDEPopupMenuItem.SetPosition(Value: Integer); 164 | begin 165 | FPosition := Value; 166 | end; 167 | 168 | procedure TC4DWizardIDEPopupMenuItem.SetVerb(const Value: string); 169 | begin 170 | FVerb := Value; 171 | end; 172 | 173 | end. 174 | -------------------------------------------------------------------------------- /Src/IDE/PopupMenuDesigner/C4D.Wizard.IDE.PopupMenuDesigner.ComponentSel.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.PopupMenuDesigner.ComponentSel; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | Vcl.Menus, 9 | Vcl.Dialogs, 10 | Vcl.ClipBrd, 11 | ToolsAPI, 12 | DesignMenus; 13 | 14 | type 15 | TC4DWizardIDEPopupMenuDesignerComponentSel = class 16 | private 17 | class procedure CopyNamesClick(Sender: TObject); 18 | class procedure AddItem(const AItem: IMenuItem; const ACaption: WideString; 19 | const AName: string = ''; AOnClick: TNotifyEvent = nil); 20 | class procedure CopyDataFieldsClick(Sender: TObject); 21 | class procedure CopyDataFields; 22 | public 23 | class procedure AddSubItems(const AItem: IMenuItem); 24 | class procedure CopyNames; 25 | end; 26 | 27 | implementation 28 | 29 | uses 30 | C4D.Wizard.Utils.OTA; 31 | 32 | class procedure TC4DWizardIDEPopupMenuDesignerComponentSel.AddSubItems(const AItem: IMenuItem); 33 | begin 34 | Self.AddItem(AItem, 'Copy names of selected components', 'C4DWizardNamesComponentSel1', Self.CopyNamesClick); 35 | Self.AddItem(AItem, 'Copy DataField of selected components', 'C4DWizardDataFieldComponentSel1', Self.CopyDataFieldsClick); 36 | end; 37 | 38 | class procedure TC4DWizardIDEPopupMenuDesignerComponentSel.AddItem(const AItem: IMenuItem; const ACaption: WideString; 39 | const AName: string = ''; AOnClick: TNotifyEvent = nil); 40 | begin 41 | AItem.AddItem(ACaption, TextToShortCut(''), False, True, AOnClick, 0, AName); 42 | end; 43 | 44 | class procedure TC4DWizardIDEPopupMenuDesignerComponentSel.CopyNamesClick(Sender: TObject); 45 | begin 46 | Self.CopyNames; 47 | end; 48 | 49 | class procedure TC4DWizardIDEPopupMenuDesignerComponentSel.CopyNames; 50 | var 51 | LIOTAModule: IOTAModule; 52 | LIOTAFormEditor: IOTAFormEditor; 53 | LIOTAComponent: IOTAComponent; 54 | LStrList: TStringList; 55 | LNameComponent: String; 56 | LSelCount: Integer; 57 | begin 58 | LIOTAModule := (BorlandIDEServices as IOTAModuleServices).CurrentModule; 59 | if not Assigned(LIOTAModule) then 60 | Exit; 61 | 62 | LIOTAFormEditor := TC4DWizardUtilsOTA.GetIOTAFormEditor(LIOTAModule); 63 | if not Assigned(LIOTAFormEditor) then 64 | Exit; 65 | 66 | LStrList := TStringList.Create; 67 | try 68 | for LSelCount := 0 to Pred(LIOTAFormEditor.GetSelCount) do 69 | begin 70 | LIOTAComponent := LIOTAFormEditor.GetSelComponent(LSelCount); 71 | LIOTAComponent.GetPropValueByName('Name', LNameComponent); 72 | LStrList.Add(LNameComponent); 73 | end; 74 | 75 | if not Trim(LStrList.Text).IsEmpty then 76 | Clipboard.AsText := LStrList.Text; 77 | finally 78 | LStrList.Free; 79 | end; 80 | end; 81 | 82 | class procedure TC4DWizardIDEPopupMenuDesignerComponentSel.CopyDataFieldsClick(Sender: TObject); 83 | begin 84 | Self.CopyDataFields; 85 | end; 86 | 87 | class procedure TC4DWizardIDEPopupMenuDesignerComponentSel.CopyDataFields; 88 | var 89 | LIOTAModule: IOTAModule; 90 | LIOTAFormEditor: IOTAFormEditor; 91 | LIOTAComponent: IOTAComponent; 92 | LStrList: TStringList; 93 | LNameComponent: String; 94 | LSelCount: Integer; 95 | begin 96 | LIOTAModule := (BorlandIDEServices as IOTAModuleServices).CurrentModule; 97 | if not Assigned(LIOTAModule) then 98 | Exit; 99 | 100 | LIOTAFormEditor := TC4DWizardUtilsOTA.GetIOTAFormEditor(LIOTAModule); 101 | if not Assigned(LIOTAFormEditor) then 102 | Exit; 103 | 104 | LStrList := TStringList.Create; 105 | try 106 | for LSelCount := 0 to Pred(LIOTAFormEditor.GetSelCount) do 107 | begin 108 | LIOTAComponent := LIOTAFormEditor.GetSelComponent(LSelCount); 109 | LIOTAComponent.GetPropValueByName('DataField', LNameComponent); 110 | if not LNameComponent.Trim.IsEmpty then 111 | LStrList.Add(LNameComponent); 112 | end; 113 | 114 | if not Trim(LStrList.Text).IsEmpty then 115 | Clipboard.AsText := LStrList.Text; 116 | finally 117 | LStrList.Free; 118 | end; 119 | end; 120 | 121 | end. 122 | -------------------------------------------------------------------------------- /Src/IDE/PopupMenuDesigner/C4D.Wizard.IDE.PopupMenuDesigner.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.PopupMenuDesigner; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | Vcl.Menus, 9 | Vcl.Dialogs, 10 | DesignIntf, 11 | DesignMenus; 12 | 13 | type 14 | TC4DWizardIDEPopupMenuDesigner = class(TBaseSelectionEditor, ISelectionEditor) 15 | private 16 | protected 17 | procedure ExecuteVerb(Index: Integer; const List: IDesignerSelections); 18 | function GetVerb(Index: Integer): string; 19 | function GetVerbCount: Integer; 20 | procedure PrepareItem(Index: Integer; const AItem: IMenuItem); 21 | procedure RequiresUnits(Proc: TGetStrProc); 22 | public 23 | end; 24 | 25 | implementation 26 | 27 | uses 28 | C4D.Wizard.IDE.PopupMenuDesigner.ComponentSel; 29 | 30 | procedure TC4DWizardIDEPopupMenuDesigner.ExecuteVerb(Index: Integer; const List: IDesignerSelections); 31 | begin 32 | 33 | end; 34 | 35 | function TC4DWizardIDEPopupMenuDesigner.GetVerb(Index: Integer): string; 36 | begin 37 | Result := 'C4D Wizard Editor Menu'; 38 | end; 39 | 40 | function TC4DWizardIDEPopupMenuDesigner.GetVerbCount: Integer; 41 | begin 42 | Result := 1; 43 | end; 44 | 45 | procedure TC4DWizardIDEPopupMenuDesigner.PrepareItem(Index: Integer; const AItem: IMenuItem); 46 | begin 47 | AItem.Visible := True; 48 | TC4DWizardIDEPopupMenuDesignerComponentSel.AddSubItems(AItem); 49 | //AItem.AddLine(); 50 | //AItem.AddItem('SubItem 05', TextToShortCut(''), False, True); 51 | end; 52 | 53 | procedure TC4DWizardIDEPopupMenuDesigner.RequiresUnits(Proc: TGetStrProc); 54 | begin 55 | 56 | end; 57 | 58 | initialization 59 | RegisterSelectionEditor(TComponent, TC4DWizardIDEPopupMenuDesigner); 60 | 61 | finalization 62 | 63 | end. 64 | -------------------------------------------------------------------------------- /Src/IDE/ShortCut/C4D.Wizard.IDE.ShortCut.KeyboardBinding.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.ShortCut.KeyboardBinding; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | Vcl.Menus, 9 | ToolsAPI; 10 | 11 | type 12 | TC4DWizardIDEShortCutKeyboardBinding = class(TNotifierObject, IOTAKeyboardBinding) 13 | private 14 | procedure SelectedComponents(const Context: IOTAKeyContext; KeyCode: TShortCut; var BindingResult: TKeyBindingResult); 15 | protected 16 | function GetBindingType: TBindingType; 17 | function GetDisplayName: string; 18 | function GetName: string; 19 | procedure BindKeyboard(const BindingServices: IOTAKeyBindingServices); 20 | public 21 | class function New: IOTAKeyboardBinding; 22 | end; 23 | 24 | procedure RegisterSelf; 25 | 26 | implementation 27 | 28 | uses 29 | C4D.Wizard.IDE.PopupMenuDesigner.ComponentSel; 30 | 31 | var 32 | IndexNotifier: Integer = -1; 33 | 34 | procedure RegisterSelf; 35 | begin 36 | if(IndexNotifier < 0)then 37 | IndexNotifier := (BorlandIDEServices as IOTAKeyboardServices) 38 | .AddKeyboardBinding(TC4DWizardIDEShortCutKeyboardBinding.New); 39 | end; 40 | 41 | class function TC4DWizardIDEShortCutKeyboardBinding.New: IOTAKeyboardBinding; 42 | begin 43 | Result := Self.Create; 44 | end; 45 | 46 | procedure TC4DWizardIDEShortCutKeyboardBinding.BindKeyboard(const BindingServices: IOTAKeyBindingServices); 47 | begin 48 | BindingServices.AddKeyBinding([TextToShortCut('Ctrl+Shift+Alt+A')], SelectedComponents, nil, 0, '', 'C4DWizardIDEPopupMenuDesignerComponentSel1'); //[ShortCut(Ord('A'), [ssCtrl, ssShift, ssAlt])] 49 | end; 50 | 51 | procedure TC4DWizardIDEShortCutKeyboardBinding.SelectedComponents(const Context: IOTAKeyContext; KeyCode: TShortCut; 52 | var BindingResult: TKeyBindingResult); 53 | begin 54 | //TC4DWizardUtils.ShowMsg('ShortCutKeyboardBinding'); 55 | TC4DWizardIDEPopupMenuDesignerComponentSel.CopyNames; 56 | BindingResult := krHandled; 57 | end; 58 | 59 | function TC4DWizardIDEShortCutKeyboardBinding.GetBindingType: TBindingType; 60 | begin 61 | Result := btPartial; 62 | end; 63 | 64 | function TC4DWizardIDEShortCutKeyboardBinding.GetDisplayName: string; 65 | begin 66 | Result := Self.ClassName; 67 | end; 68 | 69 | function TC4DWizardIDEShortCutKeyboardBinding.GetName: string; 70 | begin 71 | Result := Self.ClassName; 72 | end; 73 | 74 | initialization 75 | 76 | finalization 77 | if(IndexNotifier >= 0)then 78 | (BorlandIDEServices as IOTAKeyboardServices).RemoveKeyboardBinding(IndexNotifier); 79 | 80 | end. 81 | -------------------------------------------------------------------------------- /Src/IDE/Shortcuts/C4D.Wizard.IDE.Shortcuts.BlockKeyInsert.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.Shortcuts.BlockKeyInsert; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | Winapi.Windows, 9 | Vcl.Menus, 10 | ToolsAPI, 11 | C4D.Wizard.LogFile; 12 | 13 | type 14 | TC4DWizardIDEShortcutsBlockKeyInsert = class(TNotifierObject, IOTAKeyboardBinding) 15 | private 16 | procedure KeyProcBlockInsert(const Context: IOTAKeyContext; KeyCode: TShortcut; var BindingResult: TKeyBindingResult); 17 | protected 18 | function GetBindingType: TBindingType; 19 | function GetDisplayName: string; 20 | function GetName: string; 21 | procedure BindKeyboard(const BindingServices: IOTAKeyBindingServices); 22 | public 23 | class function New: IOTAKeyboardBinding; 24 | constructor Create; 25 | destructor Destroy; override; 26 | end; 27 | 28 | procedure RefreshRegister; 29 | 30 | implementation 31 | 32 | uses 33 | C4D.Wizard.Settings.Model, 34 | C4D.Wizard.Utils.OTA; 35 | 36 | var 37 | Index: Integer = -1; 38 | 39 | procedure RegisterSelf; 40 | begin 41 | if(Index < 0)and(C4DWizardSettingsModel.BlockKeyInsert)then 42 | Index := TC4DWizardUtilsOTA.GetIOTAKeyboardServices.AddKeyboardBinding(TC4DWizardIDEShortcutsBlockKeyInsert.New); 43 | end; 44 | 45 | procedure UnRegisterSelf; 46 | begin 47 | if(Index >= 0)then 48 | begin 49 | TC4DWizardUtilsOTA.GetIOTAKeyboardServices.RemoveKeyboardBinding(Index); 50 | Index := -1; 51 | end; 52 | end; 53 | 54 | procedure RefreshRegister; 55 | begin 56 | UnRegisterSelf; 57 | RegisterSelf; 58 | end; 59 | 60 | class function TC4DWizardIDEShortcutsBlockKeyInsert.New: IOTAKeyboardBinding; 61 | begin 62 | Result := Self.Create; 63 | end; 64 | 65 | constructor TC4DWizardIDEShortcutsBlockKeyInsert.Create; 66 | begin 67 | 68 | end; 69 | 70 | destructor TC4DWizardIDEShortcutsBlockKeyInsert.Destroy; 71 | begin 72 | inherited; 73 | end; 74 | 75 | function TC4DWizardIDEShortcutsBlockKeyInsert.GetBindingType: TBindingType; 76 | begin 77 | Result := btPartial; 78 | end; 79 | 80 | function TC4DWizardIDEShortcutsBlockKeyInsert.GetDisplayName: string; 81 | begin 82 | Result := Self.ClassName; 83 | end; 84 | 85 | function TC4DWizardIDEShortcutsBlockKeyInsert.GetName: string; 86 | begin 87 | Result := Self.ClassName; 88 | end; 89 | 90 | procedure TC4DWizardIDEShortcutsBlockKeyInsert.BindKeyboard(const BindingServices: IOTAKeyBindingServices); 91 | begin 92 | if(C4DWizardSettingsModel.BlockKeyInsert)then 93 | BindingServices.AddKeyBinding([Shortcut(VK_INSERT, [])], Self.KeyProcBlockInsert, nil); 94 | end; 95 | 96 | procedure TC4DWizardIDEShortcutsBlockKeyInsert.KeyProcBlockInsert(const Context: IOTAKeyContext; KeyCode: TShortcut; var BindingResult: TKeyBindingResult); 97 | begin 98 | if(C4DWizardSettingsModel.BlockKeyInsert)then 99 | BindingResult := krHandled 100 | else 101 | BindingResult := krUnhandled; 102 | end; 103 | 104 | initialization 105 | 106 | finalization 107 | UnRegisterSelf; 108 | 109 | end. 110 | -------------------------------------------------------------------------------- /Src/IDE/Shortcuts/C4D.Wizard.IDE.Shortcuts.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.Shortcuts; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | Winapi.Windows, 9 | Vcl.Menus, 10 | ToolsAPI, 11 | C4D.Wizard.LogFile; 12 | 13 | type 14 | TC4DWizardIDEShortcuts = class(TNotifierObject, IOTAKeyboardBinding) 15 | private 16 | protected 17 | function GetBindingType: TBindingType; 18 | function GetDisplayName: string; 19 | function GetName: string; 20 | procedure BindKeyboard(const BindingServices: IOTAKeyBindingServices); 21 | public 22 | class function New: IOTAKeyboardBinding; 23 | end; 24 | 25 | var 26 | IndexRegShortcuts: Integer = -1; 27 | 28 | procedure RegisterSelf; 29 | 30 | implementation 31 | 32 | uses 33 | C4D.Wizard.Settings.Model, 34 | C4D.Wizard.Utils.OTA; 35 | 36 | procedure RegisterSelf; 37 | begin 38 | if(IndexRegShortcuts < 0)then 39 | IndexRegShortcuts := TC4DWizardUtilsOTA.GetIOTAKeyboardServices.AddKeyboardBinding(TC4DWizardIDEShortcuts.New); 40 | end; 41 | 42 | class function TC4DWizardIDEShortcuts.New: IOTAKeyboardBinding; 43 | begin 44 | Result := Self.Create; 45 | end; 46 | 47 | function TC4DWizardIDEShortcuts.GetBindingType: TBindingType; 48 | begin 49 | Result := btPartial; 50 | end; 51 | 52 | function TC4DWizardIDEShortcuts.GetDisplayName: string; 53 | begin 54 | Result := Self.ClassName; 55 | end; 56 | 57 | function TC4DWizardIDEShortcuts.GetName: string; 58 | begin 59 | Result := Self.ClassName; 60 | end; 61 | 62 | procedure TC4DWizardIDEShortcuts.BindKeyboard(const BindingServices: IOTAKeyBindingServices); 63 | begin 64 | //BindingServices.AddKeyBinding([ShortCut(Ord('C'), [ssCtrl, ssAlt])], Self.KeyProcUsesOrganization, nil, 0, '', TC4DConsts.MENU_IDE_ORGANIZATION_NAME); 65 | //BindingServices.AddKeyBinding([TextToShortcut('Ins')], Self.KeyProcInsert, nil); 66 | 67 | {if(C4DWizardSettingsModel.BlockKeyInsert)then 68 | BindingServices.AddKeyBinding([Shortcut(VK_INSERT, [])], Self.KeyProcInsert, nil);} 69 | end; 70 | 71 | {procedure TC4DWizardIDEShortcuts.KeyProcInsert(const Context: IOTAKeyContext; KeyCode: TShortcut; var BindingResult: TKeyBindingResult); 72 | begin 73 | //Context.EditBuffer.EditBlock.Copy(False); 74 | //Context.EditBuffer.TopView.Block.Text 75 | 76 | LogFile.AddLog('**KeyProcInsert**'); 77 | if(not C4DWizardSettingsModel.BlockKeyInsert)then 78 | begin 79 | BindingResult := krUnhandled; 80 | keybd_event(VK_CANCEL, 0, 0, 0); 81 | LogFile.AddLog(Context.EditBuffer.TopView.GetEditWindow.StatusBar.Panels[2].Text); 82 | Exit; 83 | end; 84 | 85 | LogFile.AddLog('ShortCutToText(KeyCode) DEPOIS: ' + ShortCutToText(KeyCode)); 86 | BindingResult := krHandled; 87 | end; } 88 | 89 | initialization 90 | 91 | finalization 92 | if(IndexRegShortcuts >= 0)then 93 | begin 94 | TC4DWizardUtilsOTA.GetIOTAKeyboardServices.RemoveKeyboardBinding(IndexRegShortcuts); 95 | IndexRegShortcuts := -1; 96 | end; 97 | 98 | end. 99 | -------------------------------------------------------------------------------- /Src/IDE/Splash/C4D.Wizard.IDE.Splash.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.Splash; 2 | 3 | interface 4 | 5 | implementation 6 | 7 | uses 8 | Windows, 9 | SysUtils, 10 | ToolsAPI, 11 | DesignIntf, 12 | C4D.Wizard.Consts; 13 | 14 | procedure RegisterSplashScreen; 15 | begin 16 | ForceDemandLoadState(dlDisable); 17 | SplashScreenServices.AddPluginBitmap(TC4DConsts.ABOUT_TITLE, LoadBitmap(HInstance, TC4DConsts.RESOURCE_c4d_logo_24x24), 18 | TC4DConsts.IS_UNREGISTERED, TC4DConsts.WIZARD_LICENSE); 19 | end; 20 | 21 | initialization 22 | RegisterSplashScreen; 23 | 24 | finalization 25 | 26 | end. 27 | -------------------------------------------------------------------------------- /Src/IDE/ToolBars/C4D.Wizard.IDE.ToolBars.Notifier.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Src/IDE/ToolBars/C4D.Wizard.IDE.ToolBars.Notifier.pas -------------------------------------------------------------------------------- /Src/IDE/ToolBars/C4D.Wizard.IDE.ToolBars.Register.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.ToolBars.Register; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | C4D.Wizard.Utils, 9 | C4D.Wizard.IDE.ToolBars.Notifier, 10 | C4D.Wizard.IDE.ToolBars.Build, 11 | C4D.Wizard.IDE.ToolBars.VsCodeIntegration, 12 | C4D.Wizard.IDE.ToolBars.Utilities, 13 | C4D.Wizard.IDE.ToolBars.Branch; 14 | 15 | type 16 | TC4DWizardIDEToolBarsRegister = class 17 | private 18 | public 19 | class procedure Process; 20 | class procedure ProcessWithThread; 21 | end; 22 | 23 | implementation 24 | 25 | class procedure TC4DWizardIDEToolBarsRegister.Process; 26 | begin 27 | C4D.Wizard.IDE.ToolBars.Notifier.RegisterSelf; 28 | C4D.Wizard.IDE.ToolBars.Build.RegisterSelf; 29 | C4D.Wizard.IDE.ToolBars.VsCodeIntegration.RegisterSelf; 30 | C4D.Wizard.IDE.ToolBars.Utilities.RegisterSelf; 31 | C4D.Wizard.IDE.ToolBars.Branch.RegisterSelf; 32 | end; 33 | 34 | class procedure TC4DWizardIDEToolBarsRegister.ProcessWithThread; 35 | begin 36 | TThread.CreateAnonymousThread( 37 | procedure 38 | begin 39 | TThread.Sleep(200); 40 | TThread.Synchronize(TThread.CurrenTThread, 41 | procedure 42 | begin 43 | Self.Process; 44 | end); 45 | end).Start; 46 | end; 47 | 48 | end. 49 | -------------------------------------------------------------------------------- /Src/IDE/ToolBars/C4D.Wizard.IDE.ToolBars.Utils.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.IDE.ToolBars.Utils; 2 | 3 | interface 4 | 5 | uses 6 | Vcl.ComCtrls, 7 | Vcl.ExtCtrls, 8 | Vcl.Controls, 9 | ToolsAPI; 10 | 11 | type 12 | TC4DWizardIDEToolBarsUtils = class 13 | private 14 | public 15 | class function GetReferenceToolbarName: string; 16 | end; 17 | 18 | implementation 19 | 20 | uses 21 | C4D.Wizard.Utils.OTA, 22 | C4D.Wizard.Consts; 23 | 24 | class function TC4DWizardIDEToolBarsUtils.GetReferenceToolbarName: string; 25 | var 26 | LINTAServices: INTAServices; 27 | LStandardToolBar: TToolBar; 28 | LControlBar: TControlBar; 29 | LControl: TControl; 30 | i: integer; 31 | LBiggerLeft: integer; 32 | begin 33 | Result := sBrowserToolbar; 34 | 35 | LINTAServices := TC4DWizardUtilsOTA.GetINTAServices; 36 | if(LINTAServices.ToolBar[TC4DConsts.TOOL_BAR_BRANCH_NAME] <> nil)then 37 | Result := TC4DConsts.TOOL_BAR_BRANCH_NAME; 38 | 39 | LStandardToolBar := LINTAServices.ToolBar[sStandardToolBar]; 40 | if(not Assigned(LStandardToolBar))then 41 | Exit; 42 | LControlBar := LStandardToolBar.Parent as TControlBar; 43 | 44 | LBiggerLeft := 0; 45 | for i := 0 to Pred(LControlBar.ControlCount) do 46 | begin 47 | LControl := LControlBar.Controls[i]; 48 | if(LControl.Visible)and(LControl.Left > LBiggerLeft)then 49 | begin 50 | Result := LControl.Name; 51 | LBiggerLeft := LControl.Left; 52 | end; 53 | end; 54 | end; 55 | 56 | end. 57 | -------------------------------------------------------------------------------- /Src/LogFile/C4D.Wizard.LogFile.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Src/LogFile/C4D.Wizard.LogFile.pas -------------------------------------------------------------------------------- /Src/Messages/C4D.Wizard.Messages.Custom.Groups.OTA.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Messages.Custom.Groups.OTA; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | Vcl.Menus, 9 | ToolsAPI, 10 | C4D.Wizard.Utils, 11 | C4D.Wizard.Utils.OTA; 12 | 13 | type 14 | TDGHIDENotification = ( 15 | dinWizard, 16 | dinMenuWizard, 17 | dinIDENotifier, 18 | dinVersionControlNotifier, 19 | dinCompileNotifier, 20 | dinMessageNotifier, 21 | dinIDEInsightNotifier, 22 | dinProjectFileStorageNotifier, 23 | dinEditorNotifier, 24 | dinDebuggerNotifier 25 | ); 26 | 27 | TDGHNotifierObject = Class(TNotifierObject, IOTANotifier) 28 | strict private 29 | strict protected 30 | procedure DoNotification(strMessage: string); 31 | public 32 | constructor Create(strNotifier: string; iNotification: TDGHIDENotification); 33 | // IOTANotifier 34 | Procedure AfterSave; 35 | Procedure BeforeSave; 36 | Procedure Destroyed; 37 | Procedure Modified; 38 | Procedure AfterConstruction; Override; 39 | Procedure BeforeDestruction; Override; 40 | End; 41 | 42 | TC4DWizardMessagesCustomGroupsOTA = class(TDGHNotifierObject, IOTAMessageNotifier, INTAMessageNotifier) 43 | strict private 44 | procedure MessageGroupRepeatSearch1Click(Sender: TObject); 45 | Protected 46 | public 47 | // IOTAMessageNotifier 48 | procedure MessageGroupAdded(Const Group: IOTAMessageGroup); 49 | procedure MessageGroupDeleted(Const Group: IOTAMessageGroup); 50 | // INTAMessageNotifier 51 | procedure MessageViewMenuShown(Menu: TPopupMenu; const MessageGroup: IOTAMessageGroup; LineRef: Pointer); 52 | end; 53 | 54 | procedure RegisterSelf; 55 | 56 | implementation 57 | 58 | var 59 | IndexNotifier: Integer = -1; 60 | 61 | procedure RegisterSelf; 62 | begin 63 | if(IndexNotifier < 0)then 64 | IndexNotifier := TC4DWizardUtilsOTA.GetIOTAMessageServices.AddNotifier( 65 | TC4DWizardMessagesCustomGroupsOTA.Create('IOTAMessageNotifier', dinMessageNotifier)); 66 | end; 67 | 68 | { TDGHNotifierObject } 69 | procedure TDGHNotifierObject.AfterConstruction; 70 | begin 71 | inherited; 72 | end; 73 | 74 | procedure TDGHNotifierObject.AfterSave; 75 | begin 76 | 77 | end; 78 | 79 | procedure TDGHNotifierObject.BeforeDestruction; 80 | begin 81 | inherited; 82 | end; 83 | 84 | procedure TDGHNotifierObject.BeforeSave; 85 | begin 86 | 87 | end; 88 | 89 | constructor TDGHNotifierObject.Create(strNotifier: string; iNotification: TDGHIDENotification); 90 | begin 91 | 92 | end; 93 | 94 | procedure TDGHNotifierObject.Destroyed; 95 | begin 96 | 97 | end; 98 | 99 | procedure TDGHNotifierObject.DoNotification(strMessage: string); 100 | begin 101 | 102 | end; 103 | 104 | procedure TDGHNotifierObject.Modified; 105 | begin 106 | 107 | end; 108 | 109 | { TC4DWizardMessagesCustomGroupsOTA } 110 | procedure TC4DWizardMessagesCustomGroupsOTA.MessageGroupAdded(const Group: IOTAMessageGroup); 111 | begin 112 | 113 | end; 114 | 115 | procedure TC4DWizardMessagesCustomGroupsOTA.MessageGroupDeleted(const Group: IOTAMessageGroup); 116 | begin 117 | 118 | end; 119 | 120 | procedure TC4DWizardMessagesCustomGroupsOTA.MessageViewMenuShown(Menu: TPopupMenu; const MessageGroup: IOTAMessageGroup; LineRef: Pointer); 121 | var 122 | LMenuItem: TMenuItem; 123 | begin 124 | if(not MessageGroup.Name.StartsWith('Find for', True))then 125 | Exit; 126 | 127 | LMenuItem := TMenuItem.Create(Menu); 128 | LMenuItem.Name := 'C4DMessageGroupSeparator1'; 129 | LMenuItem.Caption := '-'; 130 | Menu.Items.Add(LMenuItem); 131 | 132 | LMenuItem := TMenuItem.Create(Menu); 133 | LMenuItem.Name := 'C4DMessageGroupRepeatSearch1'; 134 | LMenuItem.Caption := 'Repeat Search'; 135 | LMenuItem.ShortCut := TextToShortCut('F3'); 136 | LMenuItem.OnClick := Self.MessageGroupRepeatSearch1Click; 137 | Menu.Items.Add(LMenuItem); 138 | end; 139 | 140 | procedure TC4DWizardMessagesCustomGroupsOTA.MessageGroupRepeatSearch1Click(Sender: TObject); 141 | begin 142 | TC4DWizardUtils.ShowMsg('Under development'); 143 | end; 144 | 145 | initialization 146 | 147 | finalization 148 | if(IndexNotifier >= 0)then 149 | begin 150 | TC4DWizardUtilsOTA.GetIOTAMessageServices.RemoveNotifier(IndexNotifier); 151 | IndexNotifier := -1; 152 | end; 153 | 154 | end. 155 | -------------------------------------------------------------------------------- /Src/Messages/C4D.Wizard.Messages.Custom.Interfaces.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Messages.Custom.Interfaces; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | Vcl.Graphics, 8 | ToolsAPI, 9 | C4D.Wizard.Types; 10 | 11 | type 12 | IC4DWizardMessagesSimple = interface 13 | ['{E4897D7C-590A-4531-8B8C-DBFD3F7F24F9}'] 14 | function FileName(AValue: string): IC4DWizardMessagesSimple; 15 | function Prefix(AValue: string): IC4DWizardMessagesSimple; 16 | function Msg(AValue: string): IC4DWizardMessagesSimple; 17 | function Line(AValue: Integer): IC4DWizardMessagesSimple; 18 | function Column(AValue: Integer): IC4DWizardMessagesSimple; 19 | function GroupName(AValue: string): IC4DWizardMessagesSimple; 20 | function ClearMessageGroup(const AGroupName: string): IC4DWizardMessagesSimple; 21 | function ClearMessages(const ATypesMsg: TC4DMsgsClear): IC4DWizardMessagesSimple; 22 | function ShowMessages(const AGroupName: string = ''): IC4DWizardMessagesSimple; 23 | function AddMsgGeneral(AMsg: string): IC4DWizardMessagesSimple; 24 | function AddMsg: IC4DWizardMessagesSimple; 25 | end; 26 | 27 | IC4DWizardMessageCustom = interface 28 | ['{CC10991A-48AE-4E40-8DED-AE390A06F629}'] 29 | function Clear: IC4DWizardMessageCustom; 30 | function Msg(Value: string): IC4DWizardMessageCustom; 31 | function FileName(Value: string): IC4DWizardMessageCustom; 32 | function Prefix(Value: string): IC4DWizardMessageCustom; 33 | function Line(Value: Integer): IC4DWizardMessageCustom; 34 | function Column(Value: Integer): IC4DWizardMessageCustom; 35 | function GroupName(Value: string): IC4DWizardMessageCustom; 36 | function Color(Value: TColor): IC4DWizardMessageCustom; 37 | function ColorBack(Value: TColor): IC4DWizardMessageCustom; 38 | function Style(Value: TFontStyles): IC4DWizardMessageCustom; 39 | function SubstrContrast(Value: string): IC4DWizardMessageCustom; 40 | function WholeWordOnly(Value: Boolean): IC4DWizardMessageCustom; 41 | function CaseSensitive(Value: Boolean): IC4DWizardMessageCustom; 42 | function ClearMessageGroup: IC4DWizardMessageCustom; overload; 43 | function ClearMessageGroup(AIOTAMessageGroup: IOTAMessageGroup): IC4DWizardMessageCustom; overload; 44 | function ShowMessages: IC4DWizardMessageCustom; 45 | function AddMsg: IC4DWizardMessageCustom; 46 | end; 47 | 48 | IC4DWizardMessageCustomOTA = interface 49 | ['{F7FAFD2F-6454-45CA-8494-5D1D8A237625}'] 50 | function Msg(Value: string): IC4DWizardMessageCustomOTA; 51 | function FileName(Value: string): IC4DWizardMessageCustomOTA; 52 | function Prefix(Value: string): IC4DWizardMessageCustomOTA; 53 | function Line(Value: Integer): IC4DWizardMessageCustomOTA; 54 | function Column(Value: Integer): IC4DWizardMessageCustomOTA; 55 | function GroupName(Value: string): IC4DWizardMessageCustomOTA; 56 | function Color(Value: TColor): IC4DWizardMessageCustomOTA; 57 | function ColorBack(Value: TColor): IC4DWizardMessageCustomOTA; 58 | function Style(Value: TFontStyles): IC4DWizardMessageCustomOTA; 59 | end; 60 | 61 | implementation 62 | 63 | end. 64 | -------------------------------------------------------------------------------- /Src/Messages/C4D.Wizard.Messages.Simple.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Messages.Simple; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | ToolsAPI, 9 | C4D.Wizard.Messages.Custom.Interfaces, 10 | C4D.Wizard.Types; 11 | 12 | type 13 | TC4DWizardMessagesSimple = class(TInterfacedObject, IC4DWizardMessagesSimple) 14 | private 15 | FFileName: string; 16 | FPrefix: string; 17 | FMsg: string; 18 | FLine: Integer; 19 | FColumn: Integer; 20 | FGroupName: string; 21 | protected 22 | function FileName(AValue: string): IC4DWizardMessagesSimple; 23 | function Prefix(AValue: string): IC4DWizardMessagesSimple; 24 | function Msg(AValue: string): IC4DWizardMessagesSimple; 25 | function Line(AValue: Integer): IC4DWizardMessagesSimple; 26 | function Column(AValue: Integer): IC4DWizardMessagesSimple; 27 | function GroupName(AValue: string): IC4DWizardMessagesSimple; 28 | function ClearMessageGroup(const AGroupName: string): IC4DWizardMessagesSimple; 29 | function ClearMessages(const ATypesMsg: TC4DMsgsClear): IC4DWizardMessagesSimple; 30 | function ShowMessages(const AGroupName: string = ''): IC4DWizardMessagesSimple; 31 | function AddMsgGeneral(AMsg: string): IC4DWizardMessagesSimple; 32 | function AddMsg: IC4DWizardMessagesSimple; 33 | public 34 | class function New: IC4DWizardMessagesSimple; 35 | end; 36 | 37 | implementation 38 | 39 | uses 40 | C4D.Wizard.Utils.OTA; 41 | 42 | class function TC4DWizardMessagesSimple.New: IC4DWizardMessagesSimple; 43 | begin 44 | Result := Self.Create; 45 | end; 46 | 47 | function TC4DWizardMessagesSimple.FileName(AValue: string): IC4DWizardMessagesSimple; 48 | begin 49 | Result := Self; 50 | FFileName := AValue; 51 | end; 52 | 53 | function TC4DWizardMessagesSimple.Prefix(AValue: string): IC4DWizardMessagesSimple; 54 | begin 55 | Result := Self; 56 | FPrefix := AValue; 57 | end; 58 | 59 | function TC4DWizardMessagesSimple.Msg(AValue: string): IC4DWizardMessagesSimple; 60 | begin 61 | Result := Self; 62 | FMsg := AValue; 63 | end; 64 | 65 | function TC4DWizardMessagesSimple.Line(AValue: Integer): IC4DWizardMessagesSimple; 66 | begin 67 | Result := Self; 68 | FLine := AValue; 69 | end; 70 | 71 | function TC4DWizardMessagesSimple.Column(AValue: Integer): IC4DWizardMessagesSimple; 72 | begin 73 | Result := Self; 74 | FColumn := AValue; 75 | end; 76 | 77 | function TC4DWizardMessagesSimple.GroupName(AValue: string): IC4DWizardMessagesSimple; 78 | begin 79 | Result := Self; 80 | FGroupName := AValue; 81 | end; 82 | 83 | function TC4DWizardMessagesSimple.ClearMessages(const ATypesMsg: TC4DMsgsClear): IC4DWizardMessagesSimple; 84 | var 85 | LIOTAMessageServices: IOTAMessageServices; 86 | begin 87 | Result := Self; 88 | LIOTAMessageServices := TC4DWizardUtilsOTA.GetIOTAMessageServices; 89 | if(TC4DMsgClear.All in ATypesMsg)or(TC4DMsgClear.Compiler in ATypesMsg)then 90 | LIOTAMessageServices.ClearCompilerMessages; 91 | if(TC4DMsgClear.All in ATypesMsg)or(TC4DMsgClear.Search in ATypesMsg)then 92 | LIOTAMessageServices.ClearSearchMessages; 93 | if(TC4DMsgClear.All in ATypesMsg)or(TC4DMsgClear.Tool in ATypesMsg)then 94 | LIOTAMessageServices.ClearToolMessages; 95 | end; 96 | 97 | function TC4DWizardMessagesSimple.ClearMessageGroup(const AGroupName: string): IC4DWizardMessagesSimple; 98 | var 99 | LIOTAMessageServices: IOTAMessageServices; 100 | LIOTAMessageGroup: IOTAMessageGroup; 101 | begin 102 | Result := Self; 103 | LIOTAMessageServices := TC4DWizardUtilsOTA.GetIOTAMessageServices; 104 | LIOTAMessageGroup := LIOTAMessageServices.AddMessageGroup(AGroupName); 105 | LIOTAMessageServices.ClearMessageGroup(LIOTAMessageGroup); 106 | end; 107 | 108 | function TC4DWizardMessagesSimple.ShowMessages(const AGroupName: string = ''): IC4DWizardMessagesSimple; 109 | var 110 | LIOTAMessageServices: IOTAMessageServices; 111 | LIOTAMessageGroup: IOTAMessageGroup; 112 | begin 113 | Result := Self; 114 | LIOTAMessageServices := TC4DWizardUtilsOTA.GetIOTAMessageServices; 115 | LIOTAMessageGroup := nil; 116 | if(not AGroupName.Trim.IsEmpty)then 117 | LIOTAMessageGroup := LIOTAMessageServices.AddMessageGroup(AGroupName); 118 | LIOTAMessageServices.ShowMessageView(LIOTAMessageGroup); 119 | end; 120 | 121 | function TC4DWizardMessagesSimple.AddMsgGeneral(AMsg: string): IC4DWizardMessagesSimple; 122 | begin 123 | Result := Self; 124 | TC4DWizardUtilsOTA.GetIOTAMessageServices.AddTitleMessage(AMsg); 125 | end; 126 | 127 | function TC4DWizardMessagesSimple.AddMsg: IC4DWizardMessagesSimple; 128 | var 129 | LIOTAMessageServices: IOTAMessageServices; 130 | LIOTAMessageGroup: IOTAMessageGroup; 131 | LLineRef: Pointer; 132 | begin 133 | Result := Self; 134 | LIOTAMessageServices := TC4DWizardUtilsOTA.GetIOTAMessageServices; 135 | LIOTAMessageGroup := nil; 136 | if(not FGroupName.Trim.IsEmpty)then 137 | LIOTAMessageGroup := LIOTAMessageServices.AddMessageGroup(FGroupName); 138 | LIOTAMessageServices.AddToolMessage(FFileName, FMsg, FPrefix, FLine, FColumn, nil, LLineRef, LIOTAMessageGroup); 139 | end; 140 | 141 | end. 142 | -------------------------------------------------------------------------------- /Src/Model/IniFile/C4D.Wizard.Model.IniFile.Components.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Model.IniFile.Components; 2 | 3 | interface 4 | 5 | uses 6 | System.IniFiles, 7 | System.SysUtils, 8 | System.Classes, 9 | Vcl.ExtCtrls, 10 | Vcl.StdCtrls, 11 | C4D.Wizard.Interfaces; 12 | 13 | type 14 | TC4DWizardModelIniFileComponents = class(TInterfacedObject, IC4DWizardModelIniFile) 15 | private 16 | FIniFile: TIniFile; 17 | FSection: string; 18 | function GetIniFile: TIniFile; 19 | protected 20 | function Write(const AComponent: TCheckBox): IC4DWizardModelIniFile; overload; 21 | function Write(const AComponent: TRadioGroup): IC4DWizardModelIniFile; overload; 22 | function Write(const AComponent: TEdit): IC4DWizardModelIniFile; overload; 23 | function Write(const AComponent: TComboBox; const AMaxItemsSave: Integer = 40): IC4DWizardModelIniFile; overload; 24 | function Read(var AComponent: TCheckBox; AValueDefault: Boolean): IC4DWizardModelIniFile; overload; 25 | function Read(var AComponent: TRadioGroup; AValueDefault: Integer): IC4DWizardModelIniFile; overload; 26 | function Read(var AComponent: TEdit; AValueDefault: string): IC4DWizardModelIniFile; overload; 27 | function Read(var AComponent: TComboBox; AValueDefault: string): IC4DWizardModelIniFile; overload; 28 | public 29 | class function New(ASectionName: string): IC4DWizardModelIniFile; 30 | constructor Create(ASectionName: string); 31 | destructor Destroy; override; 32 | end; 33 | 34 | implementation 35 | 36 | uses 37 | C4D.Wizard.Utils; 38 | 39 | const 40 | C_COMBOBOX_SEPARATOR_TEXT = '
;'; 41 | 42 | class function TC4DWizardModelIniFileComponents.New(ASectionName: string): IC4DWizardModelIniFile; 43 | begin 44 | Result := Self.Create(ASectionName); 45 | end; 46 | 47 | constructor TC4DWizardModelIniFileComponents.Create(ASectionName: string); 48 | begin 49 | FIniFile := Self.GetIniFile; 50 | FSection := ASectionName 51 | end; 52 | 53 | destructor TC4DWizardModelIniFileComponents.Destroy; 54 | begin 55 | FIniFile.Free; 56 | inherited; 57 | end; 58 | 59 | function TC4DWizardModelIniFileComponents.GetIniFile: TIniFile; 60 | begin 61 | Result := TIniFile.Create(TC4DWizardUtils.GetPathFileIniGeneralSettings); 62 | end; 63 | 64 | function TC4DWizardModelIniFileComponents.Write(const AComponent: TCheckBox): IC4DWizardModelIniFile; 65 | begin 66 | Result := Self; 67 | FIniFile.WriteBool(FSection, AComponent.Name, AComponent.Checked); 68 | end; 69 | 70 | function TC4DWizardModelIniFileComponents.Write(const AComponent: TRadioGroup): IC4DWizardModelIniFile; 71 | begin 72 | Result := Self; 73 | FIniFile.WriteInteger(FSection, AComponent.Name, AComponent.ItemIndex); 74 | end; 75 | 76 | function TC4DWizardModelIniFileComponents.Write(const AComponent: TEdit): IC4DWizardModelIniFile; 77 | begin 78 | Result := Self; 79 | FIniFile.Writestring(FSection, AComponent.Name, AComponent.Text); 80 | end; 81 | 82 | function TC4DWizardModelIniFileComponents.Write(const AComponent: TComboBox; const AMaxItemsSave: Integer = 40): IC4DWizardModelIniFile; 83 | var 84 | LComboBox: TComboBox; 85 | LItem: string; 86 | LStrWrite: string; 87 | LNumItemsSave: Integer; 88 | LFirstItem: string; 89 | begin 90 | Result := Self; 91 | if(AComponent = nil)then 92 | Exit; 93 | 94 | LComboBox := AComponent; 95 | if(LComboBox.Items.Count < 0)then 96 | Exit; 97 | 98 | LFirstItem := ''; 99 | LNumItemsSave := 0; 100 | LStrWrite := ''; 101 | if(LComboBox.Text <> '')then 102 | begin 103 | LStrWrite := LComboBox.Text + C_COMBOBOX_SEPARATOR_TEXT; 104 | LFirstItem := LComboBox.Text; 105 | Inc(LNumItemsSave); 106 | end; 107 | 108 | for LItem in LComboBox.Items do 109 | begin 110 | if(LNumItemsSave = AMaxItemsSave)then 111 | Break; 112 | 113 | if(LItem = LFirstItem)then 114 | Continue; 115 | 116 | LStrWrite := LStrWrite + LItem + C_COMBOBOX_SEPARATOR_TEXT; 117 | Inc(LNumItemsSave); 118 | if(LFirstItem.Trim.IsEmpty)then 119 | LFirstItem := LItem; 120 | end; 121 | 122 | FIniFile.Writestring(FSection, AComponent.Name, LStrWrite); 123 | end; 124 | 125 | function TC4DWizardModelIniFileComponents.Read(var AComponent: TCheckBox; AValueDefault: Boolean): IC4DWizardModelIniFile; 126 | begin 127 | Result := Self; 128 | AComponent.Checked := FIniFile.ReadBool(FSection, AComponent.Name, AValueDefault); 129 | end; 130 | 131 | function TC4DWizardModelIniFileComponents.Read(var AComponent: TRadioGroup; AValueDefault: Integer): IC4DWizardModelIniFile; 132 | begin 133 | Result := Self; 134 | AComponent.ItemIndex := FIniFile.ReadInteger(FSection, AComponent.Name, AValueDefault); 135 | end; 136 | 137 | function TC4DWizardModelIniFileComponents.Read(var AComponent: TEdit; AValueDefault: string): IC4DWizardModelIniFile; 138 | begin 139 | Result := Self; 140 | AComponent.Text := FIniFile.Readstring(FSection, AComponent.Name, AValueDefault); 141 | end; 142 | 143 | function TC4DWizardModelIniFileComponents.Read(var AComponent: TComboBox; AValueDefault: string): IC4DWizardModelIniFile; 144 | var 145 | LComboBox: TComboBox; 146 | LTextInFileIni: string; 147 | LStrings: TStrings; 148 | LItem: string; 149 | LItemExisting: string; 150 | begin 151 | Result := Self; 152 | if(AComponent = nil)then 153 | Exit; 154 | 155 | LComboBox := AComponent; 156 | LTextInFileIni := FIniFile.Readstring(FSection, LComboBox.Name, AValueDefault); 157 | if(LTextInFileIni.IsEmpty)then 158 | Exit; 159 | 160 | LItemExisting := ''; 161 | if(LComboBox.Items.Count >= 0)then 162 | LItemExisting := LComboBox.Items[0]; 163 | 164 | LStrings := TStringList.Create; 165 | try 166 | TC4DWizardUtils.ExplodeList(LTextInFileIni, C_COMBOBOX_SEPARATOR_TEXT, LStrings); 167 | for LItem in LStrings do 168 | begin 169 | if(LItem <> LItemExisting)then 170 | LComboBox.Items.Add(LItem); 171 | end; 172 | finally 173 | LStrings.Free; 174 | end; 175 | end; 176 | 177 | end. 178 | -------------------------------------------------------------------------------- /Src/OpenExternal/C4D.Wizard.OpenExternal.Interfaces.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.OpenExternal.Interfaces; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | C4D.Wizard.OpenExternal; 8 | 9 | type 10 | IC4DWizardIDEMainMenuOpenExternal = interface 11 | ['{E9642ED4-94B4-4E17-94AA-6B869E4D285C}'] 12 | function CreateMenusOpenExternal: IC4DWizardIDEMainMenuOpenExternal; 13 | end; 14 | 15 | IC4DWizardOpenExternalModel = interface 16 | ['{08D4836C-F789-4228-8773-D9A1DC15AB57}'] 17 | function WriteInIniFile(AC4DWizardOpenExternal: TC4DWizardOpenExternal): IC4DWizardOpenExternalModel; 18 | function SaveIconInFolder(const AGuid, APathIcon: string): IC4DWizardOpenExternalModel; 19 | //function ReadGuidInIniFile(AGuid: string): TC4DWizardOpenExternal; 20 | procedure ReadIniFile(AProc: TProc); 21 | function ExistGuidInIniFile(const AGuid: string): Boolean; 22 | procedure RemoveGuidInIniFile(const AGuid: string); 23 | end; 24 | 25 | implementation 26 | 27 | end. 28 | -------------------------------------------------------------------------------- /Src/OpenExternal/C4D.Wizard.OpenExternal.Utils.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.OpenExternal.Utils; 2 | 3 | interface 4 | 5 | uses 6 | System.Sysutils, 7 | C4D.Wizard.OpenExternal, 8 | C4D.Wizard.Utils; 9 | 10 | type 11 | TC4DWizardOpenExternalUtils = class 12 | private 13 | public 14 | class procedure ClickFromString(const AStringClick: String); 15 | class function GetImageIndexIfExists(const AC4DWizardOpenExternal: TC4DWizardOpenExternal; 16 | const AGetImgEmptyIfNotImg: Boolean = False): Integer; 17 | class function ProcessTags(const AText: string): string; 18 | end; 19 | 20 | implementation 21 | 22 | uses 23 | C4D.Wizard.Consts, 24 | C4D.Wizard.Utils.OTA, 25 | C4D.Wizard.Types, 26 | C4D.Wizard.ProcessDelphi, 27 | C4D.Wizard.IDE.ImageListMain, 28 | C4D.Wizard.Reopen.Controller; 29 | 30 | class procedure TC4DWizardOpenExternalUtils.ClickFromString(const AStringClick: String); 31 | var 32 | LStringClick: string; 33 | LSeparator: string; 34 | LLink: string; 35 | LParameters: string; 36 | begin 37 | LStringClick := AStringClick; 38 | LSeparator := TC4DConsts.OPEN_EXTERNAL_Separator_PARAMETERS; 39 | if(LStringClick.Trim.Replace(LSeparator, '').IsEmpty)then 40 | Exit; 41 | 42 | LLink := Copy(LStringClick, 1, pos(LSeparator, LStringClick) - 1); 43 | LParameters := Copy(LStringClick, (pos(LSeparator, LStringClick) + LSeparator.Length), LStringClick.Length); 44 | if(LLink = TC4DWizardOpenExternalKind.CMD.ToString)then 45 | TC4DWizardProcessDelphi.RunCommand(TC4DWizardOpenExternalUtils.ProcessTags(LParameters)) 46 | else 47 | TC4DWizardUtils.ShellExecuteC4D(TC4DWizardOpenExternalUtils.ProcessTags(LLink), 48 | TC4DWizardOpenExternalUtils.ProcessTags(LParameters)); 49 | end; 50 | 51 | class function TC4DWizardOpenExternalUtils.GetImageIndexIfExists(const AC4DWizardOpenExternal: TC4DWizardOpenExternal; 52 | const AGetImgEmptyIfNotImg: Boolean = False): Integer; 53 | var 54 | LFilePath: string; 55 | begin 56 | Result := -1; 57 | if(AGetImgEmptyIfNotImg)then 58 | Result := TC4DWizardIDEImageListMain.GetInstance.ImgIndexEmpty; 59 | 60 | if(not AC4DWizardOpenExternal.IconHas)then 61 | Exit; 62 | 63 | LFilePath := TC4DWizardUtils.GetPathImageOpenExternal(AC4DWizardOpenExternal.Guid); 64 | if(not FileExists(LFilePath))then 65 | Exit; 66 | 67 | Result := TC4DWizardUtilsOTA.AddImgIDEFilePath(LFilePath); 68 | end; 69 | 70 | class function TC4DWizardOpenExternalUtils.ProcessTags(const AText: string): string; 71 | var 72 | LBlockTextSelect: string; 73 | LProjectFileName: string; 74 | LFolderGit: string; 75 | begin 76 | Result := AText; 77 | 78 | if(Result.ToUpper.Contains(TC4DConsts.TAG_BLOCK_TEXT_SELECT.ToUpper))then 79 | begin 80 | LBlockTextSelect := TC4DWizardUtilsOTA.GetBlockTextSelect; 81 | Result := StringReplace(Result, TC4DConsts.TAG_BLOCK_TEXT_SELECT, LBlockTextSelect, [rfReplaceAll, rfIgnoreCase]); 82 | end; 83 | 84 | if(Result.ToUpper.Contains(TC4DConsts.TAG_FOLDER_GIT.ToUpper))then 85 | begin 86 | LFolderGit := ''; 87 | LProjectFileName := TC4DWizardUtilsOTA.GetCurrentProjectFileName; 88 | if(not LProjectFileName.IsEmpty)then 89 | begin 90 | LFolderGit := TC4DWizardReopenController.New(LProjectFileName).GetPathFolderGit; 91 | LFolderGit := IncludeTrailingPathDelimiter(LFolderGit.Replace(TC4DConsts.NAME_FOLDER_GIT, EmptyStr)); 92 | end; 93 | Result := StringReplace(Result, TC4DConsts.TAG_FOLDER_GIT, LFolderGit, [rfReplaceAll, rfIgnoreCase]); 94 | end; 95 | 96 | if(Result.ToUpper.Contains(TC4DConsts.TAG_FILE_PATH_BINARY.ToUpper))then 97 | Result := StringReplace(Result, 98 | TC4DConsts.TAG_FILE_PATH_BINARY, 99 | TC4DWizardUtilsOTA.GetBinaryPathCurrent, 100 | [rfReplaceAll, rfIgnoreCase]); 101 | end; 102 | 103 | end. 104 | -------------------------------------------------------------------------------- /Src/OpenExternal/C4D.Wizard.OpenExternal.View.dfm: -------------------------------------------------------------------------------- 1 | object C4DWizardOpenExternalView: TC4DWizardOpenExternalView 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [biSystemMenu] 5 | Caption = 'Code4D - Open External' 6 | ClientHeight = 561 7 | ClientWidth = 884 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | KeyPreview = True 15 | OldCreateOrder = False 16 | Position = poScreenCenter 17 | OnClose = FormClose 18 | OnCreate = FormCreate 19 | OnKeyDown = FormKeyDown 20 | OnShow = FormShow 21 | PixelsPerInch = 96 22 | TextHeight = 13 23 | object Panel1: TPanel 24 | Left = 0 25 | Top = 507 26 | Width = 884 27 | Height = 35 28 | Align = alBottom 29 | BevelEdges = [beLeft, beRight, beBottom] 30 | BevelOuter = bvNone 31 | Padding.Left = 2 32 | Padding.Top = 2 33 | Padding.Right = 2 34 | Padding.Bottom = 2 35 | ParentBackground = False 36 | TabOrder = 0 37 | object btnEdit: TButton 38 | AlignWithMargins = True 39 | Left = 124 40 | Top = 2 41 | Width = 120 42 | Height = 31 43 | Cursor = crHandPoint 44 | Margins.Left = 0 45 | Margins.Top = 0 46 | Margins.Right = 2 47 | Margins.Bottom = 0 48 | Align = alLeft 49 | Caption = 'Edit' 50 | TabOrder = 0 51 | OnClick = btnEditClick 52 | end 53 | object btnClose: TButton 54 | AlignWithMargins = True 55 | Left = 770 56 | Top = 2 57 | Width = 110 58 | Height = 31 59 | Cursor = crHandPoint 60 | Margins.Left = 0 61 | Margins.Top = 0 62 | Margins.Right = 2 63 | Margins.Bottom = 0 64 | Align = alRight 65 | Caption = 'Close' 66 | TabOrder = 1 67 | OnClick = btnCloseClick 68 | end 69 | object btnAdd: TButton 70 | AlignWithMargins = True 71 | Left = 2 72 | Top = 2 73 | Width = 120 74 | Height = 31 75 | Cursor = crHandPoint 76 | Margins.Left = 0 77 | Margins.Top = 0 78 | Margins.Right = 2 79 | Margins.Bottom = 0 80 | Align = alLeft 81 | Caption = 'Add new' 82 | TabOrder = 2 83 | OnClick = btnAddClick 84 | end 85 | object btnRemove: TButton 86 | AlignWithMargins = True 87 | Left = 246 88 | Top = 2 89 | Width = 120 90 | Height = 31 91 | Cursor = crHandPoint 92 | Margins.Left = 0 93 | Margins.Top = 0 94 | Margins.Right = 2 95 | Margins.Bottom = 0 96 | Align = alLeft 97 | Caption = 'Remove' 98 | TabOrder = 3 99 | OnClick = btnRemoveClick 100 | end 101 | object btnOpenRun: TButton 102 | AlignWithMargins = True 103 | Left = 368 104 | Top = 2 105 | Width = 145 106 | Height = 31 107 | Cursor = crHandPoint 108 | Margins.Left = 0 109 | Margins.Top = 0 110 | Margins.Right = 2 111 | Margins.Bottom = 0 112 | Align = alLeft 113 | Caption = 'Open path / Run command' 114 | TabOrder = 4 115 | OnClick = btnOpenRunClick 116 | end 117 | end 118 | object ListViewHistory: TListView 119 | Left = 0 120 | Top = 50 121 | Width = 884 122 | Height = 457 123 | Align = alClient 124 | Columns = < 125 | item 126 | Caption = 'Description' 127 | Width = 200 128 | end 129 | item 130 | Alignment = taRightJustify 131 | Caption = 'Order' 132 | Width = 43 133 | end 134 | item 135 | Caption = 'Shortcut' 136 | Width = 150 137 | end 138 | item 139 | Caption = 'Kind' 140 | Width = 80 141 | end 142 | item 143 | Alignment = taCenter 144 | Caption = 'Visible' 145 | Width = 45 146 | end 147 | item 148 | Alignment = taCenter 149 | Caption = 'Visible ToolBar Utilities' 150 | Width = 90 151 | end 152 | item 153 | Caption = 'Path' 154 | Width = 265 155 | end 156 | item 157 | Caption = 'Parameters' 158 | Width = 200 159 | end 160 | item 161 | Alignment = taCenter 162 | Caption = 'IconHas' 163 | Width = 56 164 | end 165 | item 166 | Caption = 'Guid' 167 | Width = 0 168 | end> 169 | Font.Charset = DEFAULT_CHARSET 170 | Font.Color = clWindowText 171 | Font.Height = -12 172 | Font.Name = 'Tahoma' 173 | Font.Style = [] 174 | ReadOnly = True 175 | RowSelect = True 176 | ParentFont = False 177 | SortType = stText 178 | TabOrder = 1 179 | ViewStyle = vsReport 180 | OnColumnClick = ListViewHistoryColumnClick 181 | OnDblClick = ListViewHistoryDblClick 182 | OnKeyDown = ListViewHistoryKeyDown 183 | OnSelectItem = ListViewHistorySelectItem 184 | end 185 | object pnTop: TPanel 186 | Left = 0 187 | Top = 0 188 | Width = 884 189 | Height = 50 190 | Margins.Left = 0 191 | Margins.Top = 0 192 | Margins.Right = 0 193 | Margins.Bottom = 0 194 | Align = alTop 195 | BevelOuter = bvNone 196 | TabOrder = 2 197 | object btnSearch: TButton 198 | AlignWithMargins = True 199 | Left = 799 200 | Top = 14 201 | Width = 75 202 | Height = 27 203 | Cursor = crHandPoint 204 | Margins.Left = 2 205 | Margins.Top = 14 206 | Margins.Right = 10 207 | Margins.Bottom = 9 208 | Align = alRight 209 | Caption = 'Search' 210 | TabOrder = 0 211 | OnClick = btnSearchClick 212 | ExplicitTop = 11 213 | end 214 | object edtSearch: TEdit 215 | AlignWithMargins = True 216 | Left = 10 217 | Top = 15 218 | Width = 787 219 | Height = 25 220 | Margins.Left = 10 221 | Margins.Top = 15 222 | Margins.Right = 0 223 | Margins.Bottom = 10 224 | Align = alClient 225 | AutoSize = False 226 | TabOrder = 1 227 | OnKeyDown = edtSearchKeyDown 228 | end 229 | end 230 | object StatusBar1: TStatusBar 231 | Left = 0 232 | Top = 542 233 | Width = 884 234 | Height = 19 235 | Panels = < 236 | item 237 | Width = 50 238 | end 239 | item 240 | Width = 50 241 | end> 242 | end 243 | end 244 | -------------------------------------------------------------------------------- /Src/OpenExternal/C4D.Wizard.OpenExternal.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.OpenExternal; 2 | 3 | interface 4 | 5 | uses 6 | C4D.Wizard.Types; 7 | 8 | type 9 | TC4DWizardOpenExternal = class 10 | private 11 | FGuid: string; 12 | FDescription: string; 13 | FPath: string; 14 | FParameters: string; 15 | FKind: TC4DWizardOpenExternalKind; 16 | FOrder: Integer; 17 | FShortcut: string; 18 | FVisible: Boolean; 19 | FVisibleInToolBarUtilities: Boolean; 20 | FIconHas: Boolean; 21 | FGuidMenuMaster: string; 22 | FCreated: Boolean; 23 | public 24 | property Guid: string read FGuid write FGuid; 25 | property Description: string read FDescription write FDescription; 26 | property Path: string read FPath write FPath; 27 | property Parameters: string read FParameters write FParameters; 28 | property Kind: TC4DWizardOpenExternalKind read FKind write FKind; 29 | property Order: Integer read FOrder write FOrder; 30 | property Shortcut: string read FShortcut write FShortcut; 31 | property Visible: Boolean read FVisible write FVisible; 32 | property VisibleInToolBarUtilities: Boolean read FVisibleInToolBarUtilities write FVisibleInToolBarUtilities; 33 | property IconHas: Boolean read FIconHas write FIconHas; 34 | property GuidMenuMaster: string read FGuidMenuMaster write FGuidMenuMaster; 35 | property Created: Boolean read FCreated write FCreated; 36 | procedure Clear; 37 | constructor Create; 38 | end; 39 | 40 | implementation 41 | 42 | constructor TC4DWizardOpenExternal.Create; 43 | begin 44 | Self.Clear; 45 | end; 46 | 47 | procedure TC4DWizardOpenExternal.Clear; 48 | begin 49 | FGuid := ''; 50 | FDescription := ''; 51 | FPath := ''; 52 | FParameters := ''; 53 | FKind := TC4DWizardOpenExternalKind.None; 54 | FOrder := 0; 55 | FShortcut := ''; 56 | FVisible := False; 57 | FVisibleInToolBarUtilities := False; 58 | FIconHas := False; 59 | FGuidMenuMaster := ''; 60 | FCreated := False; 61 | end; 62 | 63 | end. 64 | -------------------------------------------------------------------------------- /Src/ProcessDelphi/C4D.Wizard.ProcessDelphi.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.ProcessDelphi; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes; 8 | 9 | type 10 | TC4DWizardProcessDelphi = class 11 | private 12 | class procedure RunCommandInternal(const ACommand: string); 13 | public 14 | class procedure RunCommand(const ACommand: string); overload; 15 | class procedure RunCommand(const ACommands: array of string); overload; 16 | end; 17 | 18 | implementation 19 | 20 | uses 21 | C4D.Wizard.dprocess, 22 | C4D.Wizard.Utils; 23 | 24 | class procedure TC4DWizardProcessDelphi.RunCommand(const ACommand: string); 25 | var 26 | LStrings: TStrings; 27 | LItem: string; 28 | begin 29 | if(ACommand.Trim.IsEmpty)then 30 | Exit; 31 | 32 | LStrings := TStringList.Create; 33 | try 34 | TC4DWizardUtils.ExplodeList(ACommand, '#', LStrings); 35 | for LItem in LStrings do 36 | begin 37 | if(LItem.Trim.IsEmpty)then 38 | Continue; 39 | 40 | Self.RunCommandInternal(LItem); 41 | end; 42 | finally 43 | LStrings.Free; 44 | end; 45 | end; 46 | 47 | class procedure TC4DWizardProcessDelphi.RunCommand(const ACommands: array of string); 48 | var 49 | LItem: string; 50 | begin 51 | if(High(ACommands) < 0)then 52 | Exit; 53 | 54 | for LItem in ACommands do 55 | Self.RunCommandInternal(LItem); 56 | end; 57 | 58 | class procedure TC4DWizardProcessDelphi.RunCommandInternal(const ACommand: string); 59 | var 60 | LOutPut: AnsiString; 61 | begin 62 | C4D.Wizard.dprocess.RunCommand('cmd', ['/c', ACommand], LOutPut, [poNoConsole]); 63 | end; 64 | 65 | end. 66 | -------------------------------------------------------------------------------- /Src/ProcessDelphi/C4D.Wizard.dpipes.pas: -------------------------------------------------------------------------------- 1 | { Freepascal pipes unit converted to Delphi. 2 | 3 | License: FPC Modified LGPL (okay to use in commercial projects) 4 | 5 | Changes to the code marked with "L505" in comments } 6 | 7 | { 8 | This file is part of the Free Pascal run time library. 9 | Copyright (c) 1999-2000 by Michael Van Canneyt 10 | 11 | Implementation of pipe stream. 12 | 13 | See the file COPYING.FPC, included in this distribution, 14 | for details about the copyright. 15 | 16 | This program is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 | 20 | **********************************************************************} 21 | 22 | unit C4D.Wizard.dpipes; 23 | 24 | interface 25 | 26 | uses 27 | system.types, 28 | sysutils, 29 | Classes; 30 | 31 | type 32 | EPipeError = Class(EStreamError); 33 | EPipeSeek = Class(EPipeError); 34 | EPipeCreation = Class(EPipeError); 35 | 36 | { TInputPipeStream } 37 | 38 | TInputPipeStream = Class(THandleStream) 39 | Private 40 | FPos: Int64; 41 | function GetNumBytesAvailable: DWord; 42 | procedure WriteNotImplemented; // L505 43 | procedure FakeSeekForward(Offset: Int64; const Origin: TSeekOrigin; 44 | const Pos: Int64); // L505 45 | procedure DiscardLarge(Count: Int64; const MaxBufferSize: Longint); // L505 46 | procedure Discard(const Count: Int64); // L505 47 | 48 | protected 49 | function GetPosition: Int64; // override; //L505 50 | procedure InvalidSeek; // override; //L505 51 | public 52 | destructor Destroy; override; 53 | Function Write(Const Buffer; Count: Longint): Longint; Override; 54 | function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override; 55 | Function Read(Var Buffer; Count: Longint): Longint; Override; 56 | property NumBytesAvailable: DWord read GetNumBytesAvailable; 57 | end; 58 | 59 | TOutputPipeStream = Class(THandleStream) 60 | Private 61 | procedure ReadNotImplemented; // L505 62 | procedure InvalidSeek; // L505 63 | Public 64 | destructor Destroy; override; 65 | function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override; 66 | Function Read(Var Buffer; Count: Longint): Longint; Override; 67 | end; 68 | 69 | Function CreatePipeHandles(Var Inhandle, OutHandle: THandle; APipeBufferSize: Cardinal = 1024): Boolean; 70 | Procedure CreatePipeStreams(Var InPipe: TInputPipeStream; 71 | Var OutPipe: TOutputPipeStream); 72 | 73 | Const 74 | EPipeMsg = 'Failed to create pipe.'; 75 | ENoSeekMsg = 'Cannot seek on pipes'; 76 | 77 | Implementation 78 | 79 | {$IFDEF MACOS} // L505 80 | {$I pipes_macos.inc} 81 | {$ENDIF} 82 | 83 | {$IFDEF MSWINDOWS} // L505 84 | {$I pipes_win.inc} 85 | {$ENDIF} 86 | 87 | 88 | Procedure CreatePipeStreams(Var InPipe: TInputPipeStream; 89 | Var OutPipe: TOutputPipeStream); 90 | Var 91 | Inhandle, OutHandle: THandle; 92 | begin 93 | if CreatePipeHandles(Inhandle, OutHandle) then 94 | begin 95 | InPipe:=TInputPipeStream.Create(Inhandle); 96 | OutPipe:=TOutputPipeStream.Create(OutHandle); 97 | end 98 | Else 99 | Raise EPipeCreation.Create(EPipeMsg) 100 | end; 101 | 102 | destructor TInputPipeStream.Destroy; 103 | begin 104 | PipeClose(Handle); 105 | inherited; 106 | end; 107 | 108 | // L505 109 | procedure TInputPipeStream.DiscardLarge(Count: Int64; const MaxBufferSize: Longint); 110 | var 111 | Buffer: array of Byte; 112 | begin 113 | if Count=0 then 114 | Exit; 115 | if Count>MaxBufferSize then 116 | SetLength(Buffer, MaxBufferSize) 117 | else 118 | SetLength(Buffer, Count); 119 | while (Count>=Length(Buffer)) do 120 | begin 121 | ReadBuffer(Buffer[0], Length(Buffer)); 122 | Dec(Count, Length(Buffer)); 123 | end; 124 | if Count>0 then 125 | ReadBuffer(Buffer[0], Count); 126 | end; 127 | 128 | // L505 129 | procedure TInputPipeStream.Discard(const Count: Int64); 130 | const 131 | CSmallSize =255; 132 | CLargeMaxBuffer =32*1024; // 32 KiB 133 | var 134 | Buffer: array[1..CSmallSize] of Byte; 135 | begin 136 | if Count=0 then 137 | Exit; 138 | if Count<=SizeOf(Buffer) then 139 | ReadBuffer(Buffer, Count) 140 | else 141 | DiscardLarge(Count, CLargeMaxBuffer); 142 | end; 143 | 144 | // L505 145 | procedure TInputPipeStream.FakeSeekForward(Offset: Int64; const Origin: TSeekOrigin; const Pos: Int64); 146 | //var 147 | // Buffer: Pointer; 148 | // BufferSize, i: LongInt; 149 | begin 150 | if Origin=soBeginning then 151 | Dec(Offset, Pos); 152 | if (Offset<0) or (Origin=soEnd) then 153 | InvalidSeek; 154 | if Offset>0 then 155 | Discard(Offset); 156 | end; 157 | 158 | // L505 159 | procedure TInputPipeStream.WriteNotImplemented; 160 | begin 161 | raise EStreamError.CreateFmt('Cannot write to this stream, not implemented', []); 162 | end; 163 | 164 | // L505 165 | procedure TOutputPipeStream.ReadNotImplemented; 166 | begin 167 | raise EStreamError.CreateFmt('Cannot read from this stream, not implemented', []); 168 | end; 169 | 170 | Function TInputPipeStream.Write(Const Buffer; Count: Longint): Longint; 171 | begin 172 | WriteNotImplemented; 173 | Result := 0; 174 | end; 175 | 176 | Function TInputPipeStream.Read(Var Buffer; Count: Longint): Longint; 177 | begin 178 | Result:=Inherited Read(Buffer, Count); 179 | Inc(FPos, Result); 180 | end; 181 | 182 | function TInputPipeStream.Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; 183 | begin 184 | FakeSeekForward(Offset, Origin, FPos); 185 | Result:=FPos; 186 | end; 187 | 188 | destructor TOutputPipeStream.Destroy; 189 | begin 190 | PipeClose(Handle); 191 | inherited; 192 | end; 193 | 194 | Function TOutputPipeStream.Read(Var Buffer; Count: Longint): Longint; 195 | begin 196 | ReadNotImplemented; 197 | Result := 0; 198 | end; 199 | 200 | procedure TOutputPipeStream.InvalidSeek; 201 | begin 202 | raise EStreamError.CreateFmt('Invalid seek in TProcess', []); 203 | end; 204 | 205 | function TOutputPipeStream.Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; 206 | begin 207 | Result:=0; { to silence warning mostly } 208 | InvalidSeek; 209 | end; 210 | 211 | end. 212 | -------------------------------------------------------------------------------- /Src/ProcessDelphi/pipes_win.inc: -------------------------------------------------------------------------------- 1 | { Freepascal pipes unit converted to Delphi (needed for TProcess) 2 | 3 | License: FPC Modified LGPL (okay to use in commercial projects) 4 | 5 | Changes to the code marked with "L505" in comments } 6 | 7 | { 8 | This file is part of the Free Pascal run time library. 9 | Copyright (c) 1998 by Michael Van Canneyt 10 | 11 | Win part of pipe stream. 12 | 13 | See the file COPYING.FPC, included in this distribution, 14 | for details about the copyright. 15 | 16 | This program is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 | 20 | **********************************************************************} 21 | uses 22 | windows; //L505 23 | 24 | // L505 25 | type 26 | PSecurityAttributes = ^TSecurityAttributes; 27 | TSecurityAttributes = record 28 | nLength : DWORD; 29 | lpSecurityDescriptor : Pointer; 30 | bInheritHandle : BOOL; 31 | end; 32 | 33 | Const piInheritablePipe : TSecurityAttributes = ( 34 | nlength:SizeOF(TSecurityAttributes); 35 | lpSecurityDescriptor:Nil; 36 | Binherithandle:True); 37 | piNonInheritablePipe : TSecurityAttributes = ( 38 | nlength:SizeOF(TSecurityAttributes); 39 | lpSecurityDescriptor:Nil; 40 | Binherithandle:False); 41 | 42 | 43 | PipeBufSize = 1024; 44 | 45 | 46 | Function CreatePipeHandles (Var Inhandle,OutHandle : THandle; APipeBufferSize : Cardinal = PipeBufSize) : Boolean; 47 | begin 48 | // L505 49 | // Result := CreatePipe(@Inhandle,@OutHandle,@piNonInheritablePipe,APipeBufferSize); 50 | Result := CreatePipe(Inhandle,OutHandle,@piNonInheritablePipe,APipeBufferSize); 51 | //writeln('DEBUG: createpipe result: ', result); 52 | end; 53 | 54 | Function TInputPipeStream.GetNumBytesAvailable: DWord; 55 | begin 56 | if not PeekNamedPipe(Handle, nil, 0, nil, @Result, nil) then 57 | Result := 0; 58 | end; 59 | 60 | function TInputPipeStream.GetPosition: Int64; 61 | begin 62 | Result:=FPos; 63 | end; 64 | 65 | procedure TInputPipeStream.InvalidSeek; 66 | begin 67 | Raise EPipeSeek.Create(ENoSeekMsg); 68 | end; 69 | 70 | procedure PipeClose(const FHandle: THandle); inline; 71 | begin 72 | FileClose(FHandle); 73 | end; 74 | -------------------------------------------------------------------------------- /Src/Reopen/C4D.Wizard.Reopen.Controller.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Reopen.Controller; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | C4D.Wizard.Types, 8 | C4D.Wizard.Reopen.Interfaces, 9 | Vcl.Forms, 10 | Vcl.Controls; 11 | 12 | type 13 | TC4DWizardReopenController = class(TInterfacedObject, IC4DWizardReopenController) 14 | private 15 | FC4DWizardReopenData: TC4DWizardReopenData; 16 | protected 17 | function GetC4DWizardReopenData: TC4DWizardReopenData; 18 | procedure OpenInGitHubDesktop; 19 | procedure ViewInRemoteRepository; 20 | procedure ViewInformationRemoteRepository; 21 | procedure EditInformations; 22 | function GetPathFolderGit: string; 23 | public 24 | class function New(AFilePath: string): IC4DWizardReopenController; overload; 25 | class function New(AC4DWizardReopenData: TC4DWizardReopenData): IC4DWizardReopenController; overload; 26 | constructor Create(AFilePath: string); overload; 27 | constructor Create(AC4DWizardReopenData: TC4DWizardReopenData); overload; 28 | end; 29 | 30 | implementation 31 | 32 | uses 33 | C4D.Wizard.Utils, 34 | C4D.Wizard.Reopen.Model, 35 | C4D.Wizard.Reopen.View.Edit, 36 | C4D.Wizard.Utils.Git; 37 | 38 | class function TC4DWizardReopenController.New(AFilePath: string): IC4DWizardReopenController; 39 | begin 40 | Result := Self.Create(AFilePath); 41 | end; 42 | 43 | class function TC4DWizardReopenController.New(AC4DWizardReopenData: TC4DWizardReopenData): IC4DWizardReopenController; 44 | begin 45 | Result := Self.Create(AC4DWizardReopenData); 46 | end; 47 | 48 | constructor TC4DWizardReopenController.Create(AFilePath: string); 49 | begin 50 | Self.Create(TC4DWizardReopenModel.New.ReadFilePathInIniFile(AFilePath)); 51 | end; 52 | 53 | constructor TC4DWizardReopenController.Create(AC4DWizardReopenData: TC4DWizardReopenData); 54 | begin 55 | FC4DWizardReopenData := AC4DWizardReopenData; 56 | end; 57 | 58 | function TC4DWizardReopenController.GetC4DWizardReopenData: TC4DWizardReopenData; 59 | begin 60 | Result := FC4DWizardReopenData; 61 | end; 62 | 63 | function TC4DWizardReopenController.GetPathFolderGit: string; 64 | begin 65 | Result := FC4DWizardReopenData.FolderGit.Trim; 66 | if(Result.IsEmpty)then 67 | TC4DWizardUtils.ShowMsgAndAbort('Folder .git not informed in settings'); 68 | 69 | Result := TC4DWizardUtilsGit.GetPathFolderGitConfig(Result); 70 | if(Result.IsEmpty)then 71 | TC4DWizardUtils.ShowMsgAndAbort('Folder .git not found'); 72 | end; 73 | 74 | procedure TC4DWizardReopenController.OpenInGitHubDesktop; 75 | begin 76 | TC4DWizardUtilsGit.OpenInGitHubDesktop(Self.GetPathFolderGit); 77 | end; 78 | 79 | procedure TC4DWizardReopenController.ViewInRemoteRepository; 80 | begin 81 | TC4DWizardUtilsGit.ViewInRemoteRepository(Self.GetPathFolderGit); 82 | end; 83 | 84 | procedure TC4DWizardReopenController.ViewInformationRemoteRepository; 85 | begin 86 | TC4DWizardUtilsGit.ViewInformationRemoteRepository(Self.GetPathFolderGit); 87 | end; 88 | 89 | procedure TC4DWizardReopenController.EditInformations; 90 | begin 91 | if(FC4DWizardReopenData.FilePath.Trim.IsEmpty)then 92 | TC4DWizardUtils.ShowMsgAndAbort('File path not informed'); 93 | 94 | C4DWizardReopenViewEdit := TC4DWizardReopenViewEdit.Create(nil); 95 | try 96 | C4DWizardReopenViewEdit.C4DWizardReopenData := FC4DWizardReopenData; 97 | if(C4DWizardReopenViewEdit.ShowModal <> mrOk)then 98 | Exit; 99 | FC4DWizardReopenData := C4DWizardReopenViewEdit.C4DWizardReopenData; 100 | finally 101 | FreeAndNil(C4DWizardReopenViewEdit); 102 | end; 103 | 104 | Screen.Cursor := crHourGlass; 105 | try 106 | TC4DWizardReopenModel.New.EditDataInIniFile(FC4DWizardReopenData); 107 | finally 108 | Screen.Cursor := crDefault; 109 | end; 110 | end; 111 | 112 | end. 113 | -------------------------------------------------------------------------------- /Src/Reopen/C4D.Wizard.Reopen.Interfaces.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Reopen.Interfaces; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | C4D.Wizard.Types; 8 | 9 | type 10 | IC4DWizardReopenModel = interface 11 | ['{7BF9A8FC-96B1-4B2C-9A47-591163844A4C}'] 12 | procedure WriteFilePathInIniFile(AFilePath: string; 13 | AFavorite: TC4DWizardFavorite; 14 | ANotifyEvent: TC4DWizardFileNotification = TC4DWizardFileNotification.None); 15 | function ReadFilePathInIniFile(AFilePath: string): TC4DWizardReopenData; 16 | procedure ReadIniFile(AProc: TProc); 17 | function ReadIniFileIfExistGuidGroup(AGuidGroup: string): Boolean; 18 | procedure RemoveFilePathInIniFile(AFilePath: string); 19 | procedure EditDataInIniFile(AC4DWizardReopenData: TC4DWizardReopenData); 20 | end; 21 | 22 | IC4DWizardReopenController = interface 23 | ['{2C57A960-7801-47B2-B8CC-D4C70F29FE6E}'] 24 | function GetC4DWizardReopenData: TC4DWizardReopenData; 25 | procedure OpenInGitHubDesktop; 26 | procedure ViewInRemoteRepository; 27 | procedure ViewInformationRemoteRepository; 28 | procedure EditInformations; 29 | function GetPathFolderGit: string; 30 | end; 31 | 32 | implementation 33 | 34 | end. 35 | -------------------------------------------------------------------------------- /Src/Reopen/C4D.Wizard.Reopen.SaveAs.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Reopen.SaveAs; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | ToolsAPI, 9 | C4D.Wizard.Types, 10 | C4D.Wizard.LogFIle; 11 | 12 | type 13 | TC4DWizardReopenSaveAs = class(TNotifierObject, IOTAModuleNotifier) 14 | private 15 | FIOTAModule: IOTAModule; 16 | FNotifierIndex: Integer; 17 | FFileNameOld: string; 18 | protected 19 | procedure ModuleRenamed(const NewName: string); 20 | function CheckOverwrite: Boolean; 21 | public 22 | class function New(AFileName: string): IOTAModuleNotifier; 23 | constructor Create(AFileName: string); 24 | destructor Destroy; override; 25 | end; 26 | 27 | implementation 28 | 29 | uses 30 | C4D.Wizard.Utils.OTA, 31 | C4D.Wizard.Reopen.Model, 32 | C4D.Wizard.Reopen.Interfaces; 33 | 34 | class function TC4DWizardReopenSaveAs.New(AFileName: string): IOTAModuleNotifier; 35 | begin 36 | Result := Self.Create(AFileName); 37 | end; 38 | 39 | constructor TC4DWizardReopenSaveAs.Create(AFileName: string); 40 | begin 41 | inherited Create; 42 | FIOTAModule := TC4DWizardUtilsOTA.GetModule(AFileName); 43 | FFileNameOld := FIOTAModule.FileName; 44 | FNotifierIndex := FIOTAModule.AddNotifier(Self); 45 | end; 46 | 47 | destructor TC4DWizardReopenSaveAs.Destroy; 48 | begin 49 | if(FNotifierIndex >= 0)then 50 | FIOTAModule.RemoveNotifier(FNotifierIndex); 51 | 52 | inherited Destroy; 53 | end; 54 | 55 | function TC4DWizardReopenSaveAs.CheckOverwrite: Boolean; 56 | begin 57 | Result := True; 58 | end; 59 | 60 | procedure TC4DWizardReopenSaveAs.ModuleRenamed(const NewName: string); 61 | var 62 | LC4DWizardReopenModel: IC4DWizardReopenModel; 63 | LC4DWizardReopenData: TC4DWizardReopenData; 64 | begin 65 | try 66 | LC4DWizardReopenModel := TC4DWizardReopenModel.New; 67 | LC4DWizardReopenData := LC4DWizardReopenModel.ReadFilePathInIniFile(FFileNameOld); 68 | if(LC4DWizardReopenData.FilePath.Trim.IsEmpty)then 69 | Exit; 70 | 71 | LC4DWizardReopenModel.RemoveFilePathInIniFile(FFileNameOld); 72 | LC4DWizardReopenModel.WriteFilePathInIniFile(NewName, TC4DWizardFavorite.None); 73 | LC4DWizardReopenData.FilePath := NewName; 74 | LC4DWizardReopenData.Name := ExtractFileName(NewName); 75 | LC4DWizardReopenModel.EditDataInIniFile(LC4DWizardReopenData); 76 | finally 77 | FFileNameOld := NewName; 78 | end; 79 | end; 80 | 81 | end. 82 | -------------------------------------------------------------------------------- /Src/Reopen/C4D.Wizard.Reopen.View.Edit.dfm: -------------------------------------------------------------------------------- 1 | object C4DWizardReopenViewEdit: TC4DWizardReopenViewEdit 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [biSystemMenu] 5 | Caption = 'Code4D - Edit Informations' 6 | ClientHeight = 330 7 | ClientWidth = 658 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | KeyPreview = True 15 | OldCreateOrder = False 16 | Position = poScreenCenter 17 | OnCreate = FormCreate 18 | OnDestroy = FormDestroy 19 | OnKeyDown = FormKeyDown 20 | OnShow = FormShow 21 | PixelsPerInch = 96 22 | TextHeight = 13 23 | object Panel9: TPanel 24 | Left = 0 25 | Top = 0 26 | Width = 658 27 | Height = 295 28 | Align = alClient 29 | BevelOuter = bvNone 30 | ParentBackground = False 31 | TabOrder = 0 32 | DesignSize = ( 33 | 658 34 | 295) 35 | object Label1: TLabel 36 | Left = 32 37 | Top = 45 38 | Width = 45 39 | Height = 13 40 | Caption = 'Nickname' 41 | end 42 | object Label2: TLabel 43 | Left = 32 44 | Top = 97 45 | Width = 25 46 | Height = 13 47 | Caption = 'Color' 48 | end 49 | object Bevel1: TBevel 50 | AlignWithMargins = True 51 | Left = 0 52 | Top = 291 53 | Width = 658 54 | Height = 1 55 | Margins.Left = 0 56 | Margins.Top = 0 57 | Margins.Right = 0 58 | Align = alBottom 59 | Shape = bsTopLine 60 | ExplicitTop = 158 61 | ExplicitWidth = 441 62 | end 63 | object Label4: TLabel 64 | Left = 32 65 | Top = 207 66 | Width = 49 67 | Height = 13 68 | Caption = 'Folder .git' 69 | end 70 | object Label3: TLabel 71 | Left = 32 72 | Top = 153 73 | Width = 29 74 | Height = 13 75 | Caption = 'Group' 76 | end 77 | object Bevel2: TBevel 78 | AlignWithMargins = True 79 | Left = 32 80 | Top = 25 81 | Width = 594 82 | Height = 1 83 | Margins.Left = 32 84 | Margins.Top = 0 85 | Margins.Right = 32 86 | Margins.Bottom = 0 87 | Align = alTop 88 | Shape = bsTopLine 89 | ExplicitLeft = 0 90 | ExplicitTop = 158 91 | ExplicitWidth = 441 92 | end 93 | object edtNickname: TEdit 94 | Left = 32 95 | Top = 60 96 | Width = 596 97 | Height = 21 98 | Anchors = [akLeft, akTop, akRight] 99 | TabOrder = 0 100 | end 101 | object ColorBox1: TColorBox 102 | Left = 32 103 | Top = 112 104 | Width = 596 105 | Height = 22 106 | NoneColorColor = clNone 107 | Anchors = [akLeft, akTop, akRight] 108 | DropDownCount = 20 109 | TabOrder = 1 110 | end 111 | object edtFolderGit: TEdit 112 | Left = 32 113 | Top = 223 114 | Width = 567 115 | Height = 21 116 | Anchors = [akLeft, akTop, akRight] 117 | TabOrder = 2 118 | end 119 | object btnFolderGit: TButton 120 | Left = 602 121 | Top = 222 122 | Width = 25 123 | Height = 23 124 | Cursor = crHandPoint 125 | Hint = 'Search folder' 126 | Anchors = [akTop, akRight] 127 | Caption = '...' 128 | Font.Charset = DEFAULT_CHARSET 129 | Font.Color = clWindowText 130 | Font.Height = -12 131 | Font.Name = 'Tahoma' 132 | Font.Style = [fsBold] 133 | ParentFont = False 134 | ParentShowHint = False 135 | ShowHint = True 136 | TabOrder = 3 137 | OnClick = btnFolderGitClick 138 | end 139 | object cBoxGroup: TComboBox 140 | Left = 32 141 | Top = 168 142 | Width = 596 143 | Height = 21 144 | Margins.Left = 10 145 | Margins.Top = 15 146 | Margins.Right = 0 147 | Margins.Bottom = 0 148 | Style = csDropDownList 149 | Anchors = [akLeft, akTop, akRight] 150 | DropDownCount = 30 151 | TabOrder = 4 152 | end 153 | object mmFilePath: TMemo 154 | AlignWithMargins = True 155 | Left = 32 156 | Top = 8 157 | Width = 594 158 | Height = 17 159 | Margins.Left = 32 160 | Margins.Top = 0 161 | Margins.Right = 32 162 | Margins.Bottom = 0 163 | Align = alTop 164 | BorderStyle = bsNone 165 | ReadOnly = True 166 | TabOrder = 5 167 | end 168 | object Panel2: TPanel 169 | Left = 0 170 | Top = 0 171 | Width = 658 172 | Height = 8 173 | Align = alTop 174 | BevelOuter = bvNone 175 | ParentBackground = False 176 | TabOrder = 6 177 | end 178 | end 179 | object Panel1: TPanel 180 | Left = 0 181 | Top = 295 182 | Width = 658 183 | Height = 35 184 | Align = alBottom 185 | BevelEdges = [beLeft, beRight, beBottom] 186 | BevelOuter = bvNone 187 | Padding.Left = 2 188 | Padding.Top = 2 189 | Padding.Right = 2 190 | Padding.Bottom = 2 191 | ParentBackground = False 192 | TabOrder = 1 193 | object btnConfirm: TButton 194 | AlignWithMargins = True 195 | Left = 430 196 | Top = 2 197 | Width = 110 198 | Height = 31 199 | Cursor = crHandPoint 200 | Margins.Left = 0 201 | Margins.Top = 0 202 | Margins.Bottom = 0 203 | Align = alRight 204 | Caption = 'Confirm' 205 | TabOrder = 0 206 | OnClick = btnConfirmClick 207 | end 208 | object btnClose: TButton 209 | AlignWithMargins = True 210 | Left = 543 211 | Top = 2 212 | Width = 110 213 | Height = 31 214 | Cursor = crHandPoint 215 | Margins.Left = 0 216 | Margins.Top = 0 217 | Margins.Bottom = 0 218 | Align = alRight 219 | Caption = 'Close' 220 | TabOrder = 1 221 | OnClick = btnCloseClick 222 | end 223 | end 224 | end 225 | -------------------------------------------------------------------------------- /Src/Reopen/C4D.Wizard.Reopen.View.Edit.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Reopen.View.Edit; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, 7 | System.SysUtils, 8 | System.StrUtils, 9 | System.Classes, 10 | Vcl.Graphics, 11 | Vcl.Controls, 12 | Vcl.Forms, 13 | Vcl.ExtCtrls, 14 | Vcl.StdCtrls, 15 | C4D.Wizard.Types; 16 | 17 | type 18 | TC4DWizardReopenViewEdit = class(TForm) 19 | Panel9: TPanel; 20 | Panel1: TPanel; 21 | btnConfirm: TButton; 22 | btnClose: TButton; 23 | Label1: TLabel; 24 | edtNickname: TEdit; 25 | Label2: TLabel; 26 | Bevel1: TBevel; 27 | ColorBox1: TColorBox; 28 | Label4: TLabel; 29 | edtFolderGit: TEdit; 30 | btnFolderGit: TButton; 31 | cBoxGroup: TComboBox; 32 | Label3: TLabel; 33 | Bevel2: TBevel; 34 | mmFilePath: TMemo; 35 | Panel2: TPanel; 36 | procedure FormCreate(Sender: TObject); 37 | procedure btnCloseClick(Sender: TObject); 38 | procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 39 | procedure btnConfirmClick(Sender: TObject); 40 | procedure FormShow(Sender: TObject); 41 | procedure btnFolderGitClick(Sender: TObject); 42 | procedure FormDestroy(Sender: TObject); 43 | private 44 | FC4DWizardReopenData: TC4DWizardReopenData; 45 | procedure GroupClear; 46 | procedure GroupLoad; 47 | procedure FillFields; 48 | public 49 | property C4DWizardReopenData: TC4DWizardReopenData read FC4DWizardReopenData write FC4DWizardReopenData; 50 | end; 51 | 52 | var 53 | C4DWizardReopenViewEdit: TC4DWizardReopenViewEdit; 54 | 55 | implementation 56 | 57 | uses 58 | C4D.Wizard.Consts, 59 | C4D.Wizard.Utils, 60 | C4D.Wizard.Utils.OTA, 61 | C4D.Wizard.Groups, 62 | C4D.Wizard.Groups.Model; 63 | 64 | {$R *.dfm} 65 | 66 | 67 | procedure TC4DWizardReopenViewEdit.FormCreate(Sender: TObject); 68 | begin 69 | Constraints.MinHeight := Self.Height; 70 | Constraints.MinWidth := Self.Width; 71 | Self.ModalResult := mrCancel; 72 | TC4DWizardUtilsOTA.IDEThemingAll(TC4DWizardReopenViewEdit, Self); 73 | end; 74 | 75 | procedure TC4DWizardReopenViewEdit.FormDestroy(Sender: TObject); 76 | begin 77 | Self.GroupClear; 78 | end; 79 | 80 | procedure TC4DWizardReopenViewEdit.FormShow(Sender: TObject); 81 | begin 82 | Self.FillFields; 83 | Self.GroupLoad; 84 | end; 85 | 86 | procedure TC4DWizardReopenViewEdit.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 87 | begin 88 | case(Key)of 89 | VK_F4: 90 | if(ssAlt in Shift)then 91 | Key := 0; 92 | VK_ESCAPE: 93 | if(Shift = [])then 94 | btnClose.Click; 95 | end; 96 | end; 97 | 98 | procedure TC4DWizardReopenViewEdit.FillFields; 99 | var 100 | LFolderGit: string; 101 | begin 102 | mmFilePath.Lines.Text := FC4DWizardReopenData.FilePath; 103 | ColorBox1.Selected := TC4DWizardUtils.StringToColorDef(FC4DWizardReopenData.Color); 104 | 105 | edtNickname.Text := FC4DWizardReopenData.Nickname; 106 | if(Trim(edtNickname.Text).IsEmpty)then 107 | edtNickname.Text := TC4DWizardUtils.GetNameFileNoExtension(FC4DWizardReopenData.FilePath); 108 | 109 | edtFolderGit.Text := FC4DWizardReopenData.FolderGit; 110 | //CASO NAO INFORMADO AINDA E ENCONTRE A PASTA DO GIT, JA ADD 111 | if(Trim(edtFolderGit.Text).IsEmpty)then 112 | begin 113 | LFolderGit := ExtractFilePath(FC4DWizardReopenData.FilePath); 114 | LFolderGit := IncludeTrailingPathDelimiter(LFolderGit + TC4DConsts.NAME_FOLDER_GIT); 115 | if(DirectoryExists(LFolderGit))then 116 | edtFolderGit.Text := LFolderGit; 117 | end; 118 | end; 119 | 120 | procedure TC4DWizardReopenViewEdit.btnConfirmClick(Sender: TObject); 121 | begin 122 | FC4DWizardReopenData.Nickname := edtNickname.Text; 123 | FC4DWizardReopenData.Color := ColorToString(ColorBox1.Selected); 124 | FC4DWizardReopenData.FolderGit := Trim(edtFolderGit.Text); 125 | if(cBoxGroup.ItemIndex >= 0)then 126 | FC4DWizardReopenData.GuidGroup := TC4DWizardGroups(cBoxGroup.Items.Objects[cBoxGroup.ItemIndex]).Guid; 127 | Self.Close; 128 | Self.ModalResult := mrOK; 129 | end; 130 | 131 | procedure TC4DWizardReopenViewEdit.GroupClear; 132 | var 133 | I: Integer; 134 | LC4DWizardReopenGroups: TC4DWizardGroups; 135 | begin 136 | for I := Pred(cBoxGroup.Items.Count) downto 0 do 137 | begin 138 | LC4DWizardReopenGroups := TC4DWizardGroups(cBoxGroup.Items.Objects[I]); 139 | LC4DWizardReopenGroups.Free; 140 | end; 141 | cBoxGroup.Items.Clear; 142 | end; 143 | 144 | procedure TC4DWizardReopenViewEdit.GroupLoad; 145 | var 146 | LItemIndexDefault: Integer; 147 | begin 148 | Self.GroupClear; 149 | LItemIndexDefault := -1; 150 | TC4DWizardGroupsModel.New.ReadIniFile( 151 | procedure(AC4DWizardGroups: TC4DWizardGroups) 152 | var 153 | LC4DWizardGroups: TC4DWizardGroups; 154 | LItemIndex: Integer; 155 | begin 156 | LC4DWizardGroups := TC4DWizardGroups.Create; 157 | LC4DWizardGroups.Guid := AC4DWizardGroups.Guid; 158 | LC4DWizardGroups.Name := AC4DWizardGroups.Name + IfThen(AC4DWizardGroups.DefaultGroup, '*', ''); 159 | LC4DWizardGroups.DefaultGroup := AC4DWizardGroups.DefaultGroup; 160 | LItemIndex := cBoxGroup.Items.AddObject(LC4DWizardGroups.Name, LC4DWizardGroups); 161 | if(FC4DWizardReopenData.GuidGroup = LC4DWizardGroups.Guid)then 162 | LItemIndexDefault := LItemIndex; 163 | end 164 | ); 165 | if(LItemIndexDefault >= 0)then 166 | cBoxGroup.ItemIndex := LItemIndexDefault; 167 | end; 168 | 169 | procedure TC4DWizardReopenViewEdit.btnFolderGitClick(Sender: TObject); 170 | var 171 | LDefaultFolder: string; 172 | LHasFolder: Boolean; 173 | begin 174 | LDefaultFolder := edtFolderGit.Text; 175 | LHasFolder := True; 176 | if(LDefaultFolder.Trim.IsEmpty)then 177 | begin 178 | LDefaultFolder := ExtractFilePath(FC4DWizardReopenData.FilePath); 179 | LHasFolder := False; 180 | end; 181 | edtFolderGit.Text := TC4DWizardUtils.SelectFolder(LDefaultFolder, LHasFolder); 182 | end; 183 | 184 | procedure TC4DWizardReopenViewEdit.btnCloseClick(Sender: TObject); 185 | begin 186 | Self.Close; 187 | Self.ModalResult := mrCancel; 188 | end; 189 | 190 | end. 191 | -------------------------------------------------------------------------------- /Src/ReplaceFiles/C4D.Wizard.ReplaceFiles.Interfaces.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.ReplaceFiles.Interfaces; 2 | 3 | interface 4 | 5 | uses 6 | C4D.Wizard.Types; 7 | 8 | type 9 | IC4DWizardReplaceFilesModel = interface 10 | ['{CE4BE3EA-48D9-4270-BE7A-C34402D75944}'] 11 | function ResetValues: IC4DWizardReplaceFilesModel; 12 | function WholeWordOnly(AValue: Boolean): IC4DWizardReplaceFilesModel; 13 | function DisplayAccountant(AValue: Boolean): IC4DWizardReplaceFilesModel; 14 | function CaseSensitive(AValue: Boolean): IC4DWizardReplaceFilesModel; 15 | function ShowMessages(AValue: Boolean): IC4DWizardReplaceFilesModel; 16 | function SearchFor(AValue: string): IC4DWizardReplaceFilesModel; 17 | function ReplaceBy(AValue: string): IC4DWizardReplaceFilesModel; 18 | function GetCountReplace: Integer; 19 | function GetCountArqReplace: Integer; 20 | function GetCountError: Integer; 21 | function GetGroupNameMsg: string; 22 | procedure ReplaceInFile(AInfoFile: TC4DWizardInfoFile); 23 | end; 24 | 25 | implementation 26 | 27 | end. 28 | -------------------------------------------------------------------------------- /Src/Translate/C4D.Wizard.Translate.View.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Src/Translate/C4D.Wizard.Translate.View.pas -------------------------------------------------------------------------------- /Src/Types/C4D.Wizard.Types.ABMenuAction.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Types.ABMenuAction; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | VCL.Menus, 9 | VCL.ActnList; 10 | 11 | type 12 | TABMenuAction = class(TCustomAction) 13 | private 14 | FMenuItem: TMenuItem; 15 | protected 16 | procedure Notification(AComponent: TComponent; Operation: TOperation); override; 17 | property MenuItem: TMenuItem read FMenuItem write FMenuItem; 18 | public 19 | destructor Destroy; override; 20 | procedure ExecuteTarget(Target: TObject); override; 21 | function HandlesTarget(Target: TObject): Boolean; override; 22 | end; 23 | 24 | function GetMenuItemOfSender(Sender: TObject): TMenuItem; 25 | 26 | implementation 27 | 28 | function GetMenuItemOfSender(Sender: TObject): TMenuItem; 29 | begin 30 | Result := nil; 31 | if(Sender.ClassType.ClassName = TMenuItem.ClassName)then 32 | Result := TMenuItem(Sender) 33 | else if(Sender.ClassType.ClassName = TABMenuAction.ClassName)then 34 | Result := TABMenuAction(Sender).MenuItem 35 | end; 36 | 37 | {TABMenuAction} 38 | destructor TABMenuAction.Destroy; 39 | begin 40 | if(Assigned(FMenuItem))then 41 | FMenuItem.RemoveFreeNotification(Self); 42 | inherited; 43 | end; 44 | 45 | procedure TABMenuAction.ExecuteTarget(Target: TObject); 46 | begin 47 | if(Assigned(FMenuItem))then 48 | FMenuItem.Click; 49 | end; 50 | 51 | function TABMenuAction.HandlesTarget(Target: TObject): Boolean; 52 | begin 53 | Result := True; 54 | end; 55 | 56 | procedure TABMenuAction.Notification(AComponent: TComponent; Operation: TOperation); 57 | begin 58 | if(Operation = opRemove) and (AComponent = FMenuItem)then 59 | FMenuItem := nil; 60 | end; 61 | 62 | end. 63 | -------------------------------------------------------------------------------- /Src/Types/C4D.Wizard.Types.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Types; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | System.TypInfo; 9 | 10 | type 11 | TC4DWizardMenuContextList = procedure(const MenuContextList: IInterfaceList) of object; 12 | TProcReplaceLine = reference to procedure(const ANumLine: Integer; const AStrLineOld, AStrLineNew: string); 13 | 14 | {$SCOPEDENUMS ON} 15 | TC4DWizardEscope = (FileCurrent = 0, FilesInGroup = 1, FilesInProject = 2, FilesOpened = 3, FilesInDirectories = 4); 16 | TC4DExtensionsFiles = (None, PAS, DFM, FMX, DPR, DPK, DPROJ, ZIP, BMP, INI, ALL); 17 | TC4DExtensionsOfFiles = set of TC4DExtensionsFiles; 18 | TC4DWizardListUsesKind = (Normal, Directiva); 19 | TC4DWizardFavorite = (None, Yes, No); 20 | TC4DWizardFileNotification = (None, FileOpened, FileClosing); 21 | TC4DWizardOpenExternalKind = (None, Files, Folders, Links, Separators, CMD, MenuMasterOnly); 22 | TC4DWizardIcon = (Information, Question, Warning, Error, Success); 23 | TC4DButtons = (OK, OK_Cancel); 24 | TC4DBtnFocu = (OK, Cancel); 25 | TC4DMsgClear = (ALL, Compiler, Search, Tool); 26 | TC4DMsgsClear = set of TC4DMsgClear; 27 | TC4DTextIgnoreEscope = (None = 0, Line = 1, Word = 2); 28 | {$SCOPEDENUMS OFF} 29 | 30 | TC4DWizardInfoFile = record 31 | Path: string; 32 | LastAccess: TDateTime; 33 | end; 34 | 35 | TC4DWizardReopenData = record 36 | Favorite: Boolean; 37 | Nickname: string; 38 | Name: string; 39 | LastOpen: TDateTime; 40 | LastClose: TDateTime; 41 | FilePath: string; 42 | Color: string; 43 | FolderGit: string; 44 | GuidGroup: string; 45 | procedure Clear; 46 | end; 47 | 48 | TC4DWizardOpenExternalKindHelper = record helper for TC4DWizardOpenExternalKind 49 | function ToString: string; 50 | end; 51 | 52 | TC4DExtensionsFilesHelper = record helper for TC4DExtensionsFiles 53 | function ToString: string; 54 | function ToStringWithPoint: string; 55 | end; 56 | 57 | TC4DExtensionsOfFilesHelper = record helper for TC4DExtensionsOfFiles 58 | function ContainsStr(const AExtension: string): Boolean; 59 | end; 60 | 61 | implementation 62 | 63 | uses 64 | C4D.Wizard.Consts; 65 | 66 | { TC4DWizardReopenData } 67 | procedure TC4DWizardReopenData.Clear; 68 | begin 69 | Self.Favorite := False; 70 | Self.Nickname := ''; 71 | Self.Name := ''; 72 | Self.LastOpen := 0; 73 | Self.LastClose := 0; 74 | Self.FilePath := ''; 75 | Self.Color := 'clBlack'; 76 | Self.FolderGit := ''; 77 | Self.GuidGroup := ''; 78 | end; 79 | 80 | {TC4DWizardOpenExternalKindHelper} 81 | function TC4DWizardOpenExternalKindHelper.ToString: string; 82 | begin 83 | if(Self = TC4DWizardOpenExternalKind.CMD)then 84 | Exit(TC4DConsts.STR_CMD_COMMANDS) 85 | else if(Self = TC4DWizardOpenExternalKind.MenuMasterOnly)then 86 | Exit(TC4DConsts.STR_MENU_MASTER_ONLY); 87 | 88 | Result := GetEnumName(TypeInfo(TC4DWizardOpenExternalKind), Integer(Self)); 89 | end; 90 | 91 | { TC4DExtensionsFilesHelper } 92 | function TC4DExtensionsFilesHelper.ToString: string; 93 | begin 94 | Result := GetEnumName(TypeInfo(TC4DExtensionsFiles), Integer(Self)).ToLower; 95 | end; 96 | 97 | function TC4DExtensionsFilesHelper.ToStringWithPoint: string; 98 | begin 99 | Result := '.' + Self.ToString; 100 | end; 101 | 102 | { TC4DExtensionsOfFilesHelper } 103 | function TC4DExtensionsOfFilesHelper.ContainsStr(const AExtension: string): Boolean; 104 | var 105 | LExtension: string; 106 | begin 107 | Result := False; 108 | LExtension := AExtension.Trim.ToLower; 109 | if(LExtension = '.pas')then 110 | Result := TC4DExtensionsFiles.PAS in Self 111 | else if(LExtension = '.dfm')then 112 | Result := TC4DExtensionsFiles.DFM in Self 113 | else if(LExtension = '.fmx')then 114 | Result := TC4DExtensionsFiles.FMX in Self 115 | else if(LExtension = '.dpr')then 116 | Result := TC4DExtensionsFiles.DPR in Self 117 | else if(LExtension = '.dpk')then 118 | Result := TC4DExtensionsFiles.DPK in Self 119 | else if(LExtension = '.dproj')then 120 | Result := TC4DExtensionsFiles.DPROJ in Self 121 | else if(LExtension = '.zip')then 122 | Result := TC4DExtensionsFiles.ZIP in Self 123 | else if(LExtension = '.bmp')then 124 | Result := TC4DExtensionsFiles.BMP in Self 125 | else if(LExtension = '.ini')then 126 | Result := TC4DExtensionsFiles.INI in Self; 127 | end; 128 | 129 | end. 130 | -------------------------------------------------------------------------------- /Src/UsesOrganization/C4D.Wizard.UsesOrganization.ListOfUses.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.UsesOrganization.ListOfUses; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | C4D.Wizard.Interfaces; 9 | 10 | type 11 | TC4DWizardUsesOrganizationListOfUses = class(TInterfacedObject, IC4DWizardUsesOrganizationListOfUses) 12 | private 13 | [weak] 14 | FParent: IC4DWizardUsesOrganizationParams; 15 | FEnabled: Boolean; 16 | FUsesStr: string; 17 | FStringsFilters: string; 18 | FList: TStringList; 19 | FListStringsFilter: TStringList; 20 | procedure FillList; 21 | procedure FillListStringsFilter; 22 | protected 23 | function Enabled: Boolean; overload; 24 | function Enabled(const Value: Boolean): IC4DWizardUsesOrganizationListOfUses; overload; 25 | function List: TStringList; 26 | function UsesStr(const Value: string): IC4DWizardUsesOrganizationListOfUses; 27 | function StringsFiltersStr(const Value: string): IC4DWizardUsesOrganizationListOfUses; 28 | function StringsFiltersList: TStringList; 29 | function ContainsValue(const Value: string): Boolean; 30 | function End_: IC4DWizardUsesOrganizationParams; 31 | public 32 | class function New(const AParent: IC4DWizardUsesOrganizationParams): IC4DWizardUsesOrganizationListOfUses; 33 | constructor Create(const AParent: IC4DWizardUsesOrganizationParams); 34 | destructor Destroy; override; 35 | end; 36 | 37 | implementation 38 | 39 | uses 40 | C4D.Wizard.Utils; 41 | 42 | class function TC4DWizardUsesOrganizationListOfUses.New(const AParent: IC4DWizardUsesOrganizationParams): IC4DWizardUsesOrganizationListOfUses; 43 | begin 44 | Result := Self.Create(AParent); 45 | end; 46 | 47 | constructor TC4DWizardUsesOrganizationListOfUses.Create(const AParent: IC4DWizardUsesOrganizationParams); 48 | begin 49 | FParent := AParent; 50 | FList := TStringList.Create; 51 | FListStringsFilter := TStringList.Create; 52 | FUsesStr := ''; 53 | FStringsFilters := ''; 54 | end; 55 | 56 | destructor TC4DWizardUsesOrganizationListOfUses.Destroy; 57 | begin 58 | FListStringsFilter.Free; 59 | FList.Free; 60 | inherited; 61 | end; 62 | 63 | function TC4DWizardUsesOrganizationListOfUses.Enabled: Boolean; 64 | begin 65 | Result := FEnabled; 66 | end; 67 | 68 | function TC4DWizardUsesOrganizationListOfUses.Enabled(const Value: Boolean): IC4DWizardUsesOrganizationListOfUses; 69 | begin 70 | Result := Self; 71 | FEnabled := Value; 72 | end; 73 | 74 | function TC4DWizardUsesOrganizationListOfUses.UsesStr(const Value: string): IC4DWizardUsesOrganizationListOfUses; 75 | begin 76 | Result := Self; 77 | FUsesStr := Value.Trim; 78 | Self.FillList; 79 | end; 80 | 81 | procedure TC4DWizardUsesOrganizationListOfUses.FillList; 82 | begin 83 | FList.Clear; 84 | TC4DWizardUtils.ExplodeList(FUsesStr, ',', FList); 85 | end; 86 | 87 | function TC4DWizardUsesOrganizationListOfUses.StringsFiltersStr(const Value: string): IC4DWizardUsesOrganizationListOfUses; 88 | begin 89 | Result := Self; 90 | FStringsFilters := Value.Trim; 91 | Self.FillListStringsFilter; 92 | end; 93 | 94 | function TC4DWizardUsesOrganizationListOfUses.StringsFiltersList: TStringList; 95 | begin 96 | Result := FListStringsFilter; 97 | end; 98 | 99 | procedure TC4DWizardUsesOrganizationListOfUses.FillListStringsFilter; 100 | begin 101 | FListStringsFilter.Clear; 102 | TC4DWizardUtils.ExplodeList(FStringsFilters, ',', FListStringsFilter); 103 | end; 104 | 105 | function TC4DWizardUsesOrganizationListOfUses.List: TStringList; 106 | begin 107 | Result := FList; 108 | end; 109 | 110 | function TC4DWizardUsesOrganizationListOfUses.ContainsValue(const Value: string): Boolean; 111 | begin 112 | Result := False; 113 | if(FList.Count < 0)then 114 | Exit; 115 | 116 | Result := FList.IndexOf(Value) >= 0; 117 | end; 118 | 119 | function TC4DWizardUsesOrganizationListOfUses.End_: IC4DWizardUsesOrganizationParams; 120 | begin 121 | Result := FParent; 122 | end; 123 | 124 | end. 125 | -------------------------------------------------------------------------------- /Src/UsesOrganization/C4D.Wizard.UsesOrganization.Params.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.UsesOrganization.Params; 2 | 3 | interface 4 | 5 | uses 6 | C4D.Wizard.Interfaces, 7 | System.Classes, 8 | System.SysUtils, 9 | C4D.Wizard.UsesOrganization.ListOfUses; 10 | 11 | type 12 | TC4DWizardUsesOrganizationParams = class(TInterfacedObject, IC4DWizardUsesOrganizationParams) 13 | private 14 | [weak] 15 | FParent: IC4DWizardUsesOrganization; 16 | FOrderUsesInAlphabeticalOrder: Boolean; 17 | FOneUsesPerLine: Boolean; 18 | FOneUsesLineNumColBefore: Integer; 19 | FMaxCharactersPerLine: Integer; 20 | FGroupUnitsByNamespaces: Boolean; 21 | FLineBreakBetweenNamespaces: Boolean; 22 | FShowMessages: Boolean; 23 | FUsesToRemoveList: IC4DWizardUsesOrganizationListOfUses; 24 | FUsesToAddList: IC4DWizardUsesOrganizationListOfUses; 25 | protected 26 | function OrderUsesInAlphabeticalOrder: Boolean; overload; 27 | function OrderUsesInAlphabeticalOrder(Value: Boolean): IC4DWizardUsesOrganizationParams; overload; 28 | function OneUsesPerLine: Boolean; overload; 29 | function OneUsesPerLine(Value: Boolean): IC4DWizardUsesOrganizationParams; overload; 30 | function OneUsesLineNumColBefore: Integer; overload; 31 | function OneUsesLineNumColBefore(Value: Integer): IC4DWizardUsesOrganizationParams; overload; 32 | function MaxCharactersPerLine: Integer; overload; 33 | function MaxCharactersPerLine(Value: Integer): IC4DWizardUsesOrganizationParams; overload; 34 | function GroupUnitsByNamespaces: Boolean; overload; 35 | function GroupUnitsByNamespaces(Value: Boolean): IC4DWizardUsesOrganizationParams; overload; 36 | function LineBreakBetweenNamespaces: Boolean; overload; 37 | function LineBreakBetweenNamespaces(Value: Boolean): IC4DWizardUsesOrganizationParams; overload; 38 | function UsesToRemoveList: IC4DWizardUsesOrganizationListOfUses; 39 | function UsesToAddList: IC4DWizardUsesOrganizationListOfUses; 40 | function ShowMessages: Boolean; overload; 41 | function ShowMessages(Value: Boolean): IC4DWizardUsesOrganizationParams; overload; 42 | function End_: IC4DWizardUsesOrganization; 43 | public 44 | class function New(AParent: IC4DWizardUsesOrganization): IC4DWizardUsesOrganizationParams; 45 | constructor Create(AParent: IC4DWizardUsesOrganization); 46 | destructor Destroy; override; 47 | end; 48 | 49 | implementation 50 | 51 | class function TC4DWizardUsesOrganizationParams.New(AParent: IC4DWizardUsesOrganization): IC4DWizardUsesOrganizationParams; 52 | begin 53 | Result := Self.Create(AParent); 54 | end; 55 | 56 | constructor TC4DWizardUsesOrganizationParams.Create(AParent: IC4DWizardUsesOrganization); 57 | begin 58 | FParent := AParent; 59 | FUsesToRemoveList := TC4DWizardUsesOrganizationListOfUses.New(Self); 60 | FUsesToAddList := TC4DWizardUsesOrganizationListOfUses.New(Self); 61 | FOrderUsesInAlphabeticalOrder := False; 62 | FOneUsesPerLine := True; 63 | FOneUsesLineNumColBefore := 2; 64 | FMaxCharactersPerLine := 90; 65 | FGroupUnitsByNamespaces := False; 66 | FLineBreakBetweenNamespaces := False; 67 | FShowMessages := True; 68 | end; 69 | 70 | destructor TC4DWizardUsesOrganizationParams.Destroy; 71 | begin 72 | inherited; 73 | end; 74 | 75 | function TC4DWizardUsesOrganizationParams.OrderUsesInAlphabeticalOrder: Boolean; 76 | begin 77 | Result := FOrderUsesInAlphabeticalOrder; 78 | end; 79 | 80 | function TC4DWizardUsesOrganizationParams.OrderUsesInAlphabeticalOrder(Value: Boolean): IC4DWizardUsesOrganizationParams; 81 | begin 82 | Result := Self; 83 | FOrderUsesInAlphabeticalOrder := Value; 84 | end; 85 | 86 | function TC4DWizardUsesOrganizationParams.OneUsesPerLine: Boolean; 87 | begin 88 | Result := FOneUsesPerLine; 89 | end; 90 | 91 | function TC4DWizardUsesOrganizationParams.OneUsesPerLine(Value: Boolean): IC4DWizardUsesOrganizationParams; 92 | begin 93 | Result := Self; 94 | FOneUsesPerLine := Value; 95 | end; 96 | 97 | function TC4DWizardUsesOrganizationParams.OneUsesLineNumColBefore: Integer; 98 | begin 99 | Result := FOneUsesLineNumColBefore; 100 | end; 101 | 102 | function TC4DWizardUsesOrganizationParams.OneUsesLineNumColBefore(Value: Integer): IC4DWizardUsesOrganizationParams; 103 | begin 104 | Result := Self; 105 | FOneUsesLineNumColBefore := Value; 106 | end; 107 | 108 | function TC4DWizardUsesOrganizationParams.MaxCharactersPerLine: Integer; 109 | begin 110 | Result := FMaxCharactersPerLine; 111 | end; 112 | 113 | function TC4DWizardUsesOrganizationParams.MaxCharactersPerLine(Value: Integer): IC4DWizardUsesOrganizationParams; 114 | begin 115 | Result := Self; 116 | FMaxCharactersPerLine := Value; 117 | end; 118 | 119 | function TC4DWizardUsesOrganizationParams.GroupUnitsByNamespaces: Boolean; 120 | begin 121 | Result := FGroupUnitsByNamespaces; 122 | end; 123 | 124 | function TC4DWizardUsesOrganizationParams.GroupUnitsByNamespaces(Value: Boolean): IC4DWizardUsesOrganizationParams; 125 | begin 126 | Result := Self; 127 | FGroupUnitsByNamespaces := Value; 128 | end; 129 | 130 | function TC4DWizardUsesOrganizationParams.LineBreakBetweenNamespaces: Boolean; 131 | begin 132 | Result := FLineBreakBetweenNamespaces; 133 | end; 134 | 135 | function TC4DWizardUsesOrganizationParams.LineBreakBetweenNamespaces(Value: Boolean): IC4DWizardUsesOrganizationParams; 136 | begin 137 | Result := Self; 138 | FLineBreakBetweenNamespaces := Value; 139 | end; 140 | 141 | function TC4DWizardUsesOrganizationParams.UsesToRemoveList: IC4DWizardUsesOrganizationListOfUses; 142 | begin 143 | Result := FUsesToRemoveList; 144 | end; 145 | 146 | function TC4DWizardUsesOrganizationParams.UsesToAddList: IC4DWizardUsesOrganizationListOfUses; 147 | begin 148 | Result := FUsesToAddList; 149 | end; 150 | 151 | function TC4DWizardUsesOrganizationParams.ShowMessages: Boolean; 152 | begin 153 | Result := FShowMessages; 154 | end; 155 | 156 | function TC4DWizardUsesOrganizationParams.ShowMessages(Value: Boolean): IC4DWizardUsesOrganizationParams; 157 | begin 158 | Result := Self; 159 | FShowMessages := Value; 160 | end; 161 | 162 | function TC4DWizardUsesOrganizationParams.End_: IC4DWizardUsesOrganization; 163 | begin 164 | Result := FParent; 165 | end; 166 | 167 | end. 168 | -------------------------------------------------------------------------------- /Src/UsesOrganization/C4D.Wizard.UsesOrganization.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Src/UsesOrganization/C4D.Wizard.UsesOrganization.pas -------------------------------------------------------------------------------- /Src/Utils/C4D.Wizard.Utils.GetIniPositionStr.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Src/Utils/C4D.Wizard.Utils.GetIniPositionStr.pas -------------------------------------------------------------------------------- /Src/Utils/C4D.Wizard.Utils.Git.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Utils.Git; 2 | 3 | interface 4 | 5 | uses 6 | System.Sysutils, 7 | System.IniFiles; 8 | 9 | type 10 | TC4DWizardUtilsGit = class 11 | private 12 | public 13 | class function GetPathFolderGitConfig(const AFolderGit: string): string; 14 | class procedure OpenInGitHubDesktop(const AFolderGit: string); 15 | class function GetLinkRemoteRepository(const AFolderGit: string): string; 16 | class procedure ViewInRemoteRepository(const AFolderGit: string); 17 | class procedure ViewInformationRemoteRepository(const AFolderGit: string); 18 | class function GetNameCurrentBranchInGit(const AFolderGit: string): string; 19 | end; 20 | 21 | implementation 22 | 23 | uses 24 | C4D.Wizard.ProcessDelphi, 25 | C4D.Wizard.Consts, 26 | C4D.Wizard.Utils; 27 | 28 | class function TC4DWizardUtilsGit.GetPathFolderGitConfig(const AFolderGit: string): string; 29 | begin 30 | Result := AFolderGit.Trim; 31 | if(Result.IsEmpty)then 32 | Exit; 33 | 34 | Result := IncludeTrailingPathDelimiter(Result); 35 | Result := Result.Replace(TC4DConsts.NAME_FOLDER_GIT, EmptyStr); 36 | Result := Result + TC4DConsts.NAME_FOLDER_GIT; 37 | Result := IncludeTrailingPathDelimiter(Result); 38 | if(not DirectoryExists(Result))then 39 | Result := ''; 40 | end; 41 | 42 | class procedure TC4DWizardUtilsGit.OpenInGitHubDesktop(const AFolderGit: string); 43 | var 44 | LFolderGit: string; 45 | begin 46 | LFolderGit := IncludeTrailingPathDelimiter(AFolderGit.Replace(TC4DConsts.NAME_FOLDER_GIT, EmptyStr)); 47 | TC4DWizardProcessDelphi.RunCommand(['github ' + LFolderGit]); 48 | end; 49 | 50 | class function TC4DWizardUtilsGit.GetLinkRemoteRepository(const AFolderGit: string): string; 51 | var 52 | LFolderGit: string; 53 | LIniFile: TIniFile; 54 | begin 55 | LFolderGit := Self.GetPathFolderGitConfig(AFolderGit); 56 | if(LFolderGit.IsEmpty)then 57 | Exit; 58 | 59 | LIniFile := TIniFile.Create(LFolderGit + 'config'); 60 | try 61 | Result := LIniFile.Readstring('remote "origin"', 'url', EmptyStr); 62 | finally 63 | LIniFile.Free; 64 | end; 65 | end; 66 | 67 | class procedure TC4DWizardUtilsGit.ViewInRemoteRepository(const AFolderGit: string); 68 | var 69 | LFolderGit: string; 70 | LUrlRemote: string; 71 | begin 72 | LFolderGit := Self.GetPathFolderGitConfig(AFolderGit); 73 | if(LFolderGit.IsEmpty)then 74 | Exit; 75 | 76 | LUrlRemote := Self.GetLinkRemoteRepository(LFolderGit); 77 | LUrlRemote := LUrlRemote.Replace('.git', EmptyStr); 78 | if(not LUrlRemote.Trim.IsEmpty)then 79 | TC4DWizardUtils.OpenLink(LUrlRemote); 80 | end; 81 | 82 | class procedure TC4DWizardUtilsGit.ViewInformationRemoteRepository(const AFolderGit: string); 83 | var 84 | LFolderGit: string; 85 | LUrlRemote: string; 86 | LTextFile: TextFile; 87 | LLineText: string; 88 | LBranch: string; 89 | begin 90 | LFolderGit := Self.GetPathFolderGitConfig(AFolderGit); 91 | if(LFolderGit.IsEmpty)then 92 | Exit; 93 | 94 | LUrlRemote := Self.GetLinkRemoteRepository(LFolderGit); 95 | LUrlRemote := LUrlRemote.Replace('.git', EmptyStr); 96 | 97 | AssignFile(LTextFile, LFolderGit + 'HEAD'); 98 | try 99 | Reset(LTextFile); 100 | ReadLn(LTextFile, LLineText); 101 | finally 102 | CloseFile(LTextFile); 103 | end; 104 | 105 | LBranch := ''; 106 | if(not LLineText.Trim.IsEmpty)then 107 | LBranch := StringReplace(LLineText, 'ref: refs/heads/', '', [rfIgnoreCase, rfReplaceAll]); 108 | 109 | TC4DWizardUtils.ShowMsg(Format('%s %s Current Branch: %s', [LUrlRemote, sLineBreak, LBranch])); 110 | end; 111 | 112 | class function TC4DWizardUtilsGit.GetNameCurrentBranchInGit(const AFolderGit: string): string; 113 | var 114 | LFolderGit: string; 115 | LTextFile: TextFile; 116 | LLineText: string; 117 | begin 118 | Result := ''; 119 | 120 | LFolderGit := Self.GetPathFolderGitConfig(AFolderGit); 121 | if(LFolderGit.IsEmpty)then 122 | Exit; 123 | 124 | AssignFile(LTextFile, LFolderGit + 'HEAD'); 125 | try 126 | Reset(LTextFile); 127 | ReadLn(LTextFile, LLineText); 128 | finally 129 | CloseFile(LTextFile); 130 | end; 131 | 132 | if(not LLineText.Trim.IsEmpty)then 133 | Result := StringReplace(LLineText, 'ref: refs/heads/', '', [rfIgnoreCase, rfReplaceAll]); 134 | end; 135 | 136 | end. 137 | -------------------------------------------------------------------------------- /Src/Utils/C4D.Wizard.Utils.ListOfFilesInFolder.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Utils.ListOfFilesInFolder; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | C4D.Wizard.Types; 9 | 10 | type 11 | IC4DWizardUtilsListOfFilesInFolder = interface 12 | ['{843DF59B-4858-4223-B953-7E05A2BBE345}'] 13 | function FolderPath(const Value: string): IC4DWizardUtilsListOfFilesInFolder; 14 | function IncludeSubdirectories(const Value: Boolean): IC4DWizardUtilsListOfFilesInFolder; 15 | function ExtensionsOfFiles(Value: TC4DExtensionsOfFiles): IC4DWizardUtilsListOfFilesInFolder; 16 | procedure GetListOfFiles(out Result: TStrings); 17 | end; 18 | 19 | TC4DWizardUtilsListOfFilesInFolder = class(TInterfacedObject, IC4DWizardUtilsListOfFilesInFolder) 20 | private 21 | FFolderPath: string; 22 | FIncludeSubdirectories: Boolean; 23 | FExtensionsOfFiles: TC4DExtensionsOfFiles; 24 | FStrResult: TStrings; 25 | procedure GetListOfFilesInternal(const AFolderPath: string); 26 | protected 27 | function FolderPath(const Value: string): IC4DWizardUtilsListOfFilesInFolder; 28 | function IncludeSubdirectories(const Value: Boolean): IC4DWizardUtilsListOfFilesInFolder; 29 | function ExtensionsOfFiles(Value: TC4DExtensionsOfFiles): IC4DWizardUtilsListOfFilesInFolder; 30 | procedure GetListOfFiles(out Result: TStrings); 31 | public 32 | class function New: IC4DWizardUtilsListOfFilesInFolder; 33 | constructor Create; 34 | end; 35 | 36 | implementation 37 | 38 | 39 | class function TC4DWizardUtilsListOfFilesInFolder.New: IC4DWizardUtilsListOfFilesInFolder; 40 | begin 41 | Result := Self.Create; 42 | end; 43 | 44 | constructor TC4DWizardUtilsListOfFilesInFolder.Create; 45 | begin 46 | FIncludeSubdirectories := True; 47 | FExtensionsOfFiles := [TC4DExtensionsFiles.ALL]; 48 | end; 49 | 50 | function TC4DWizardUtilsListOfFilesInFolder.FolderPath(const Value: string): IC4DWizardUtilsListOfFilesInFolder; 51 | begin 52 | Result := Self; 53 | FFolderPath := Value; 54 | end; 55 | 56 | function TC4DWizardUtilsListOfFilesInFolder.IncludeSubdirectories(const Value: Boolean): IC4DWizardUtilsListOfFilesInFolder; 57 | begin 58 | Result := Self; 59 | FIncludeSubdirectories := Value; 60 | end; 61 | 62 | function TC4DWizardUtilsListOfFilesInFolder.ExtensionsOfFiles(Value: TC4DExtensionsOfFiles): IC4DWizardUtilsListOfFilesInFolder; 63 | begin 64 | Result := Self; 65 | FExtensionsOfFiles := Value; 66 | end; 67 | 68 | procedure TC4DWizardUtilsListOfFilesInFolder.GetListOfFiles(out Result: TStrings); 69 | begin 70 | FStrResult := Result; 71 | Self.GetListOfFilesInternal(FFolderPath); 72 | end; 73 | 74 | procedure TC4DWizardUtilsListOfFilesInFolder.GetListOfFilesInternal(const AFolderPath: string); 75 | var 76 | LFolderPath: string; 77 | LSearchRec: TSearchRec; 78 | LRet: Integer; 79 | LName: string; 80 | LSubDirectoryPath: string; 81 | begin 82 | LFolderPath := IncludeTrailingPathDelimiter(AFolderPath); 83 | if(LFolderPath.IsEmpty)then 84 | Exit; 85 | 86 | if(not DirectoryExists(LFolderPath))then 87 | Exit; 88 | 89 | LRet := FindFirst(LFolderPath + '*.*', faAnyFile, LSearchRec); 90 | try 91 | while(LRet = 0)do 92 | begin 93 | LName := LSearchRec.Name; 94 | //SE HE UMA PASTA 95 | if(LSearchRec.Attr and faDirectory = faDirectory)then 96 | begin 97 | if(LName <> '.')and(LName <> '..')then 98 | begin 99 | if(FIncludeSubdirectories)then 100 | begin 101 | LSubDirectoryPath := LFolderPath + LName; 102 | Self.GetListOfFilesInternal(LSubDirectoryPath); 103 | end; 104 | end; 105 | end 106 | else if(FExtensionsOfFiles.ContainsStr(ExtractFileExt(LName)))then 107 | FStrResult.Add(LFolderPath + LName); 108 | 109 | LRet := FindNext(LSearchRec); 110 | end; 111 | finally 112 | System.SysUtils.FindClose(LSearchRec); 113 | end; 114 | end; 115 | 116 | end. 117 | -------------------------------------------------------------------------------- /Src/Utils/C4D.Wizard.Utils.OTA.BinaryPath.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Utils.OTA.BinaryPath; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Classes, 8 | System.Variants, 9 | Winapi.Windows, 10 | ToolsAPI, 11 | Vcl.Forms; 12 | 13 | type 14 | IC4DWizardUtilsOTABinaryPath = interface 15 | ['{C644F013-A9CC-49BF-9DA8-9748D94C7539}'] 16 | function GetBinaryPathOfProject(AIOTAProject: IOTAProject): string; 17 | end; 18 | 19 | TC4DWizardUtilsOTABinaryPath = class(TInterfacedObject, IC4DWizardUtilsOTABinaryPath) 20 | private 21 | FIOTAProject: IOTAProject; 22 | FOutName: string; 23 | procedure ExploreExe; 24 | protected 25 | function GetBinaryPathOfProject(AIOTAProject: IOTAProject): string; 26 | public 27 | class function New: IC4DWizardUtilsOTABinaryPath; 28 | constructor Create; 29 | end; 30 | 31 | implementation 32 | 33 | uses 34 | C4D.Wizard.Utils.CnWizard; 35 | 36 | class function TC4DWizardUtilsOTABinaryPath.New: IC4DWizardUtilsOTABinaryPath; 37 | begin 38 | Result := Self.Create; 39 | end; 40 | 41 | constructor TC4DWizardUtilsOTABinaryPath.Create; 42 | begin 43 | // 44 | end; 45 | 46 | function TC4DWizardUtilsOTABinaryPath.GetBinaryPathOfProject(AIOTAProject: IOTAProject): string; 47 | begin 48 | Result := ''; 49 | FOutName := ''; 50 | FIOTAProject := AIOTAProject; 51 | Self.ExploreExe; 52 | Result := FOutName; 53 | end; 54 | 55 | {$DEFINE DELPHIXE_UP} 56 | 57 | procedure TC4DWizardUtilsOTABinaryPath.ExploreExe; 58 | var 59 | LDir, LProjectFileName: string; 60 | {$IFNDEF DELPHIXE_UP} 61 | LOutExt, LIntermediaDir: string; 62 | LVal: Variant; 63 | {$ENDIF} 64 | begin 65 | if not Assigned(FIOTAProject) then 66 | Exit; 67 | 68 | LProjectFileName := FIOTAProject.GetFileName; 69 | if(LProjectFileName.Trim.IsEmpty)then 70 | Exit; 71 | 72 | LDir := CnOtaGetProjectOutputDirectory(FIOTAProject); 73 | if(LDir.Trim.IsEmpty)then 74 | Exit; 75 | 76 | {$IFDEF DELPHIXE_UP} 77 | if CnOtaGetActiveProjectOptions <> nil then 78 | FOutName := CnOtaGetActiveProjectOptions.TargetName; 79 | {$ELSE} 80 | try 81 | if CnOtaGetActiveProjectOption('GenPackage', LVal) and LVal then 82 | LOutExt := '.bpl'; 83 | except 84 | ; 85 | end; 86 | 87 | try 88 | if (LOutExt = '') and CnOtaGetActiveProjectOption('GenStaticLibrary', LVal) and LVal then 89 | LOutExt := '.lib'; 90 | except 91 | ; 92 | end; 93 | 94 | try 95 | if (LOutExt = '') and CnOtaGetActiveProjectOption('GenDll', LVal) and LVal then 96 | LOutExt := '.dll'; 97 | except 98 | ; 99 | end; 100 | 101 | if LOutExt = '' then 102 | LOutExt := '.exe'; 103 | 104 | {$IFDEF IDE_CONF_MANAGER} 105 | if not IsDelphiRuntime then 106 | begin 107 | {$IFDEF BDS2009_UP} 108 | if CnOtaGetActiveProjectOptionsConfigurations <> nil then 109 | begin 110 | if CnOtaGetActiveProjectOptionsConfigurations.GetActiveConfiguration <> nil then 111 | begin 112 | LIntermediaDir := MakePath(CnOtaGetActiveProjectOptionsConfigurations.GetActiveConfiguration.GetName); 113 | end; 114 | end; 115 | {$ELSE} 116 | try 117 | if CnOtaGetActiveProjectOption('UnitOutputDir', LVal) then 118 | LIntermediaDir := MakePath(VarToStr(LVal)); 119 | except 120 | ; 121 | end; 122 | {$ENDIF} 123 | end; 124 | {$ENDIF} 125 | FOutName := MakePath(LDir) + LIntermediaDir + _CnChangeFileExt(_CnExtractFileName(LProjectFileName), LOutExt); 126 | {$ENDIF} 127 | end; 128 | 129 | end. 130 | -------------------------------------------------------------------------------- /Src/Utils/C4D.Wizard.Utils.OTA.Codex.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Utils.OTA.Codex; 2 | 3 | {******************************************************************************} 4 | { Unit Note: } 5 | { This file is partly derived from Codex expert for Delphi IDE } 6 | { } 7 | { Codex author: } 8 | { https://github.com/DelphiWorlds/Codex } 9 | {******************************************************************************} 10 | 11 | interface 12 | 13 | uses 14 | System.SysUtils, 15 | System.Classes, 16 | Vcl.Forms, 17 | Vcl.ActnList, 18 | ToolsAPI; 19 | 20 | type 21 | TC4DWizardUtilsOTACodex = class 22 | public 23 | class function ExecuteIDEAction(const AActionName: string): Boolean; 24 | class function FindActionGlobal(const AActionName: string; out AAction: TCustomAction): Boolean; 25 | class function FindComponentGlobal(const AComponentName: string; out AComponent: TComponent): Boolean; 26 | class function FindComponentRecurse(const AParent: TComponent; const AComponentName: string; 27 | out AComponent: TComponent): Boolean; 28 | end; 29 | 30 | implementation 31 | 32 | class function TC4DWizardUtilsOTACodex.ExecuteIDEAction(const AActionName: string): Boolean; 33 | var 34 | LAction: TCustomAction; 35 | begin 36 | Result := False; 37 | if Self.FindActionGlobal(AActionName, LAction) then 38 | begin 39 | LAction.Execute; 40 | Result := True; 41 | end; 42 | end; 43 | 44 | class function TC4DWizardUtilsOTACodex.FindActionGlobal(const AActionName: string; 45 | out AAction: TCustomAction): Boolean; 46 | var 47 | LComponent: TComponent; 48 | begin 49 | Result := False; 50 | if Self.FindComponentGlobal(AActionName, LComponent) and (LComponent is TCustomAction) then 51 | begin 52 | AAction := TCustomAction(LComponent); 53 | Result := True; 54 | end; 55 | end; 56 | 57 | class function TC4DWizardUtilsOTACodex.FindComponentGlobal(const AComponentName: string; 58 | out AComponent: TComponent): Boolean; 59 | var 60 | I: Integer; 61 | begin 62 | Result := False; 63 | for I := 0 to Pred(Screen.FormCount) do 64 | begin 65 | if Self.FindComponentRecurse(Screen.Forms[I], AComponentName, AComponent) then 66 | begin 67 | Result := True; 68 | Break; 69 | end; 70 | end; 71 | if not Result then 72 | begin 73 | for I := 0 to Pred(Screen.DataModuleCount) do 74 | begin 75 | if Self.FindComponentRecurse(Screen.DataModules[I], AComponentName, AComponent) then 76 | begin 77 | Result := True; 78 | Break; 79 | end; 80 | end; 81 | end; 82 | end; 83 | 84 | class function TC4DWizardUtilsOTACodex.FindComponentRecurse(const AParent: TComponent; 85 | const AComponentName: string; out AComponent: TComponent): Boolean; 86 | var 87 | I: Integer; 88 | begin 89 | AComponent := AParent.FindComponent(AComponentName); 90 | Result := AComponent <> nil; 91 | if not Result then 92 | begin 93 | for I := 0 to AParent.ComponentCount - 1 do 94 | begin 95 | if Self.FindComponentRecurse(AParent.Components[I], AComponentName, AComponent) then 96 | begin 97 | Result := True; 98 | Break; 99 | end; 100 | end; 101 | end; 102 | end; 103 | 104 | end. 105 | -------------------------------------------------------------------------------- /Src/Utils/C4D.Wizard.Utils.StringList.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.Utils.stringList; 2 | 3 | interface 4 | 5 | uses 6 | System.Classes, 7 | System.StrUtils, 8 | System.SysUtils; 9 | 10 | type 11 | TC4DWizardUtilsstringList = class 12 | public 13 | class function SortTrim(List: TStringList; Index1, Index2: Integer): Integer; static; 14 | class function SortNamespaces(List: TStringList; Index1, Index2: Integer): Integer; static; 15 | end; 16 | 17 | implementation 18 | 19 | class function TC4DWizardUtilsstringList.SortTrim(List: TStringList; Index1, Index2: Integer): Integer; 20 | var 21 | LStr1: string; 22 | LStr2: string; 23 | begin 24 | LStr1 := List[Index1].Trim; 25 | LStr2 := List[Index2].Trim; 26 | Result := CompareStr(LStr1, LStr2) 27 | end; 28 | 29 | class function TC4DWizardUtilsstringList.SortNamespaces(List: TStringList; Index1, Index2: Integer): Integer; 30 | var 31 | LStr1: string; 32 | LStr2: string; 33 | begin 34 | LStr1 := List[Index1].Trim; 35 | LStr2 := List[Index2].Trim; 36 | Result := -1; 37 | if(ContainsStr(LStr1, '.') = ContainsStr(LStr2, '.'))then 38 | Result := CompareStr(LStr1, LStr2) 39 | else if(ContainsStr(LStr1, '.'))then 40 | Result := 1; 41 | end; 42 | 43 | end. 44 | -------------------------------------------------------------------------------- /Src/Utils/C4D.Wizard.Utils.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Code4Delphi/Code4D-Wizard/07dab728f4b9592550fbf4e3a2859d7242382af5/Src/Utils/C4D.Wizard.Utils.pas -------------------------------------------------------------------------------- /Src/View/C4D.Wizard.View.About.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.View.About; 2 | 3 | interface 4 | 5 | uses 6 | System.Classes, 7 | System.SysUtils, 8 | ToolsAPI, 9 | Vcl.Controls, 10 | Vcl.ExtCtrls, 11 | Vcl.Forms, 12 | Vcl.Graphics, 13 | Vcl.Imaging.pngimage, 14 | Vcl.StdCtrls, 15 | Vcl.Dialogs, 16 | Winapi.Windows, 17 | C4D.Wizard.Consts, 18 | C4D.Wizard.Utils, 19 | C4D.Wizard.Utils.OTA; 20 | 21 | type 22 | TC4DWizardViewAbout = class(TForm) 23 | pnBody: TPanel; 24 | Bevel1: TBevel; 25 | mmMensagem: TMemo; 26 | Panel2: TPanel; 27 | pnBackSite: TPanel; 28 | lbSiteCode4Delphi: TLabel; 29 | imgLogoC4D: TImage; 30 | pnBackGithub: TPanel; 31 | lbGitHubCode4Delphi: TLabel; 32 | imgGithub: TImage; 33 | pnButtons: TPanel; 34 | btnOK: TButton; 35 | btnTeste: TButton; 36 | Panel1: TPanel; 37 | lbDonateToCode4Delphi: TLabel; 38 | imgDonate: TImage; 39 | procedure FormShow(Sender: TObject); 40 | procedure btnOKClick(Sender: TObject); 41 | procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 42 | procedure lbSiteCode4DelphiClick(Sender: TObject); 43 | procedure lbSiteCode4DelphiMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); 44 | procedure lbSiteCode4DelphiMouseLeave(Sender: TObject); 45 | procedure lbGitHubCode4DelphiClick(Sender: TObject); 46 | procedure FormCreate(Sender: TObject); 47 | procedure btnTesteClick(Sender: TObject); 48 | procedure lbDonateToCode4DelphiClick(Sender: TObject); 49 | private 50 | 51 | public 52 | 53 | end; 54 | 55 | var 56 | C4DWizardViewAbout: TC4DWizardViewAbout; 57 | 58 | implementation 59 | 60 | {$R *.dfm} 61 | 62 | 63 | procedure TC4DWizardViewAbout.FormCreate(Sender: TObject); 64 | begin 65 | TC4DWizardUtilsOTA.IDEThemingAll(TC4DWizardViewAbout, Self); 66 | end; 67 | 68 | procedure TC4DWizardViewAbout.FormShow(Sender: TObject); 69 | begin 70 | Self.Caption := 'About Code4Delphi Wizard ' + TC4DConsts.SEMANTIC_VERSION; 71 | 72 | mmMensagem.Lines.Clear; 73 | mmMensagem.Lines.Add(TC4DConsts.ABOUT_COPY_RIGHT); 74 | mmMensagem.Lines.Add(TC4DConsts.ABOUT_DESCRIPTION); 75 | mmMensagem.Lines.Add(TC4DConsts.SEMANTIC_VERSION_LB); 76 | mmMensagem.Lines.Add(TC4DConsts.WIZARD_LICENSE); 77 | end; 78 | 79 | procedure TC4DWizardViewAbout.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 80 | begin 81 | case(Key)of 82 | VK_F4: 83 | if(ssAlt in Shift)then 84 | Key := 0; 85 | VK_ESCAPE: 86 | if(Shift = [])then 87 | btnOK.Click; 88 | end; 89 | end; 90 | 91 | procedure TC4DWizardViewAbout.btnOKClick(Sender: TObject); 92 | begin 93 | Self.Close; 94 | end; 95 | 96 | procedure TC4DWizardViewAbout.lbSiteCode4DelphiClick(Sender: TObject); 97 | begin 98 | TC4DWizardUtils.OpenLink('http://www.code4delphi.com.br'); 99 | end; 100 | 101 | procedure TC4DWizardViewAbout.lbGitHubCode4DelphiClick(Sender: TObject); 102 | begin 103 | TC4DWizardUtils.OpenLink('https://github.com/code4delphi'); 104 | end; 105 | 106 | procedure TC4DWizardViewAbout.lbDonateToCode4DelphiClick(Sender: TObject); 107 | begin 108 | TC4DWizardUtils.OpenLink('https://pag.ae/7ZhEY1xKr'); 109 | end; 110 | 111 | procedure TC4DWizardViewAbout.lbSiteCode4DelphiMouseLeave(Sender: TObject); 112 | begin 113 | //*SEVERAL 114 | TLabel(Sender).Font.Color := TC4DWizardUtilsOTA.ActiveThemeColorDefaul; 115 | TLabel(Sender).Font.Style := TLabel(Sender).Font.Style - [fsUnderline]; 116 | end; 117 | 118 | procedure TC4DWizardViewAbout.lbSiteCode4DelphiMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); 119 | begin 120 | //*SEVERAL 121 | TLabel(Sender).Font.Color := clRed; 122 | TLabel(Sender).Font.Style := TLabel(Sender).Font.Style + [fsUnderline]; 123 | end; 124 | 125 | procedure TC4DWizardViewAbout.btnTesteClick(Sender: TObject); 126 | begin 127 | // 128 | end; 129 | 130 | end. 131 | -------------------------------------------------------------------------------- /Src/View/C4D.Wizard.View.Dialog.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.View.Dialog; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, 7 | System.SysUtils, 8 | System.Classes, 9 | Vcl.Graphics, 10 | Vcl.Controls, 11 | Vcl.Forms, 12 | Vcl.StdCtrls, 13 | Vcl.ExtCtrls, 14 | Vcl.ImgList, 15 | Vcl.Dialogs, 16 | C4D.Wizard.Types, 17 | Vcl.ClipBrd, 18 | Vcl.Menus, 19 | System.ImageList; 20 | 21 | type 22 | TC4DWizardViewDialog = class(TForm) 23 | pnButtons: TPanel; 24 | btnOK: TButton; 25 | pnTop: TPanel; 26 | pnDetailsLabel: TPanel; 27 | pnDetails: TPanel; 28 | mmDetails: TMemo; 29 | lbViewDetails: TLabel; 30 | btnCancel: TButton; 31 | pnImg: TPanel; 32 | ImageList1: TImageList; 33 | imgImageMsg: TImage; 34 | Panel1: TPanel; 35 | lbMsg: TLabel; 36 | Bevel1: TBevel; 37 | Bevel2: TBevel; 38 | lbViewDetails02: TLabel; 39 | PopupMenu1: TPopupMenu; 40 | Copy1: TMenuItem; 41 | N1: TMenuItem; 42 | ShowAll1: TMenuItem; 43 | procedure FormCreate(Sender: TObject); 44 | procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 45 | procedure btnOKClick(Sender: TObject); 46 | procedure FormShow(Sender: TObject); 47 | procedure btnCancelClick(Sender: TObject); 48 | procedure FormClose(Sender: TObject; var Action: TCloseAction); 49 | procedure lbViewDetailsClick(Sender: TObject); 50 | procedure Copy1Click(Sender: TObject); 51 | procedure ShowAll1Click(Sender: TObject); 52 | private 53 | FMsg: string; 54 | FDetails: string; 55 | FButtons: TC4DButtons; 56 | FIcon: TC4DWizardIcon; 57 | FBtnFocu: TC4DBtnFocu; 58 | procedure DefaultValues; 59 | procedure ConfHeightForm; 60 | procedure ConfButtons; 61 | public 62 | property Msg: string write FMsg; 63 | property Details: string write FDetails; 64 | property Icon: TC4DWizardIcon write FIcon; 65 | property Buttons: TC4DButtons write FButtons; 66 | property BtnFocu: TC4DBtnFocu write FBtnFocu; 67 | end; 68 | 69 | var 70 | C4DWizardViewDialog: TC4DWizardViewDialog; 71 | 72 | implementation 73 | 74 | uses 75 | C4D.Wizard.Utils.OTA; 76 | 77 | {$R *.dfm} 78 | 79 | procedure TC4DWizardViewDialog.FormCreate(Sender: TObject); 80 | begin 81 | Self.DefaultValues; 82 | TC4DWizardUtilsOTA.IDEThemingAll(TC4DWizardViewDialog, Self); 83 | Self.Constraints.MinHeight := pnTop.Height + (pnButtons.Height * 2) + 3; 84 | Self.Constraints.MinWidth := Self.Width; 85 | end; 86 | 87 | procedure TC4DWizardViewDialog.FormShow(Sender: TObject); 88 | begin 89 | imgImageMsg.Picture := nil; 90 | ImageList1.GetIcon(Integer(FIcon), imgImageMsg.Picture.Icon); 91 | 92 | Self.ModalResult := mrCancel; 93 | Self.ConfButtons; 94 | lbMsg.Caption := FMsg; 95 | mmDetails.Visible := False; 96 | mmDetails.Lines.Clear; 97 | mmDetails.Lines.Add(FDetails); 98 | Self.ConfHeightForm; 99 | end; 100 | 101 | procedure TC4DWizardViewDialog.FormClose(Sender: TObject; var Action: TCloseAction); 102 | begin 103 | Self.DefaultValues; 104 | end; 105 | 106 | procedure TC4DWizardViewDialog.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 107 | begin 108 | case(Key)of 109 | VK_F4: 110 | if(ssAlt in Shift)then 111 | Key := 0; 112 | VK_ESCAPE: 113 | if(Shift = [])then 114 | begin 115 | if(btnCancel.Visible)then 116 | btnCancel.Click 117 | else 118 | Self.Close; 119 | end; 120 | end; 121 | end; 122 | 123 | procedure TC4DWizardViewDialog.DefaultValues; 124 | begin 125 | FMsg := ''; 126 | FDetails := ''; 127 | FButtons := TC4DButtons.OK; 128 | FIcon := TC4DWizardIcon.Information; 129 | end; 130 | 131 | procedure TC4DWizardViewDialog.ConfHeightForm; 132 | begin 133 | pnDetailsLabel.Visible := True; 134 | pnDetails.Visible := True; 135 | if(FDetails.Trim.IsEmpty)then 136 | begin 137 | pnDetailsLabel.Visible := False; 138 | pnDetails.Visible := False; 139 | end; 140 | Self.Height := 0; 141 | end; 142 | 143 | procedure TC4DWizardViewDialog.Copy1Click(Sender: TObject); 144 | begin 145 | Clipboard.AsText := lbMsg.Caption; 146 | end; 147 | 148 | procedure TC4DWizardViewDialog.ConfButtons; 149 | begin 150 | btnCancel.Visible := FButtons = TC4DButtons.OK_Cancel; 151 | btnOK.SetFocus; 152 | if(btnCancel.Visible)and(FBtnFocu = TC4DBtnFocu.Cancel)then 153 | btnCancel.SetFocus; 154 | end; 155 | 156 | procedure TC4DWizardViewDialog.lbViewDetailsClick(Sender: TObject); 157 | begin 158 | try 159 | if(mmDetails.Visible)then 160 | begin 161 | mmDetails.Visible := False; 162 | lbViewDetails02.Caption := '>>'; 163 | Self.Height := Self.Constraints.MinHeight; 164 | end 165 | else 166 | begin 167 | mmDetails.Visible := True; 168 | lbViewDetails02.Caption := '<<'; 169 | Self.Height := Self.Constraints.MinHeight * 2; 170 | end; 171 | except 172 | end; 173 | Self.Refresh; 174 | Self.Repaint; 175 | end; 176 | 177 | procedure TC4DWizardViewDialog.ShowAll1Click(Sender: TObject); 178 | begin 179 | ShowMessage(lbMsg.Caption); 180 | end; 181 | 182 | procedure TC4DWizardViewDialog.btnCancelClick(Sender: TObject); 183 | begin 184 | Self.Close; 185 | Self.ModalResult := mrCancel; 186 | end; 187 | 188 | procedure TC4DWizardViewDialog.btnOKClick(Sender: TObject); 189 | begin 190 | Self.Close; 191 | Self.ModalResult := mrOK; 192 | end; 193 | 194 | end. 195 | -------------------------------------------------------------------------------- /Src/View/C4D.Wizard.View.Memo.dfm: -------------------------------------------------------------------------------- 1 | object C4DWizardViewMemo: TC4DWizardViewMemo 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [biSystemMenu] 5 | Caption = 'Code4D Wizard' 6 | ClientHeight = 351 7 | ClientWidth = 839 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Tahoma' 13 | Font.Style = [] 14 | KeyPreview = True 15 | OldCreateOrder = False 16 | Position = poScreenCenter 17 | OnCreate = FormCreate 18 | OnKeyDown = FormKeyDown 19 | PixelsPerInch = 96 20 | TextHeight = 13 21 | object pnMemo: TPanel 22 | Left = 0 23 | Top = 0 24 | Width = 839 25 | Height = 316 26 | Align = alClient 27 | BevelKind = bkTile 28 | BevelOuter = bvNone 29 | Color = clWindow 30 | ParentBackground = False 31 | TabOrder = 0 32 | object mmMessage: TMemo 33 | AlignWithMargins = True 34 | Left = 10 35 | Top = 10 36 | Width = 815 37 | Height = 292 38 | Margins.Left = 10 39 | Margins.Top = 10 40 | Margins.Right = 10 41 | Margins.Bottom = 10 42 | Align = alClient 43 | BorderStyle = bsNone 44 | Font.Charset = ANSI_CHARSET 45 | Font.Color = clWindowText 46 | Font.Height = -11 47 | Font.Name = 'Courier New' 48 | Font.Style = [fsBold] 49 | ParentFont = False 50 | ScrollBars = ssVertical 51 | TabOrder = 0 52 | OnKeyDown = mmMessageKeyDown 53 | ExplicitLeft = 18 54 | ExplicitTop = 9 55 | end 56 | end 57 | object pnButtons: TPanel 58 | Left = 0 59 | Top = 316 60 | Width = 839 61 | Height = 35 62 | Align = alBottom 63 | BevelEdges = [beLeft, beRight, beBottom] 64 | BevelKind = bkTile 65 | BevelOuter = bvNone 66 | Color = clWindow 67 | Padding.Left = 2 68 | Padding.Top = 2 69 | Padding.Right = 2 70 | Padding.Bottom = 2 71 | ParentBackground = False 72 | TabOrder = 1 73 | object btnOK: TButton 74 | Left = 723 75 | Top = 2 76 | Width = 110 77 | Height = 29 78 | Cursor = crHandPoint 79 | Align = alRight 80 | Caption = 'OK' 81 | TabOrder = 0 82 | OnClick = btnOKClick 83 | ExplicitTop = 1 84 | end 85 | end 86 | end 87 | -------------------------------------------------------------------------------- /Src/View/C4D.Wizard.View.Memo.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.View.Memo; 2 | 3 | interface 4 | 5 | uses 6 | System.Classes, 7 | System.SysUtils, 8 | Vcl.Controls, 9 | Vcl.ExtCtrls, 10 | Vcl.Forms, 11 | Vcl.StdCtrls, 12 | Winapi.Windows; 13 | 14 | type 15 | TC4DWizardViewMemo = class(TForm) 16 | pnMemo: TPanel; 17 | pnButtons: TPanel; 18 | btnOK: TButton; 19 | mmMessage: TMemo; 20 | procedure btnOKClick(Sender: TObject); 21 | procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 22 | procedure FormCreate(Sender: TObject); 23 | procedure mmMessageKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 24 | private 25 | protected 26 | public 27 | end; 28 | 29 | implementation 30 | 31 | uses 32 | C4D.Wizard.Utils.OTA; 33 | 34 | {$R *.dfm} 35 | 36 | 37 | procedure TC4DWizardViewMemo.FormCreate(Sender: TObject); 38 | begin 39 | TC4DWizardUtilsOTA.IDEThemingAll(TC4DWizardViewMemo, Self); 40 | end; 41 | 42 | procedure TC4DWizardViewMemo.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 43 | begin 44 | case Key of 45 | VK_F4: 46 | if ssAlt in Shift then 47 | Key := 0; 48 | VK_ESCAPE: 49 | if Shift = [] then 50 | btnOK.Click; 51 | end; 52 | end; 53 | 54 | procedure TC4DWizardViewMemo.mmMessageKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 55 | begin 56 | if (Key = $41) and (Shift = [ssCtrl]) then 57 | mmMessage.SelectAll; 58 | end; 59 | 60 | procedure TC4DWizardViewMemo.btnOKClick(Sender: TObject); 61 | begin 62 | Self.Close; 63 | end; 64 | 65 | end. 66 | -------------------------------------------------------------------------------- /Src/VsCodeIntegration/C4D.Wizard.VsCodeIntegration.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.VsCodeIntegration; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | ToolsAPI; 8 | 9 | type 10 | TC4DWizardVsCodeIntegration = class 11 | private 12 | class procedure RunCommandInstallExtension(const AIdentifierExtension: string); 13 | public 14 | class procedure Open; 15 | class procedure InstallDelphiLSP; 16 | class procedure InstallGithubCopilot; 17 | class procedure InstallSupermaven; 18 | end; 19 | 20 | implementation 21 | 22 | uses 23 | C4D.Wizard.Utils, 24 | C4D.Wizard.Utils.OTA, 25 | C4D.Wizard.ProcessDelphi; 26 | 27 | class procedure TC4DWizardVsCodeIntegration.Open; 28 | var 29 | LIOTAModuleServices: IOTAModuleServices; 30 | LIOTAModule: IOTAModule; 31 | LIOTASourceEditor: IOTASourceEditor; 32 | LIOTAEditView: IOTAEditView; 33 | LFileNameModule: string; 34 | LIOTAProject: IOTAProject; 35 | LFilePathProject: string; 36 | LCursorPos: TOTAEditPos; 37 | LCommand: string; 38 | begin 39 | LIOTAModuleServices := TC4DWizardUtilsOTA.GetIOTAModuleServices; 40 | 41 | LIOTAModule := LIOTAModuleServices.CurrentModule; 42 | if LIOTAModule = nil then 43 | TC4DWizardUtils.ShowMsgAndAbort('No current module'); 44 | 45 | if not Supports(LIOTAModule.CurrentEditor, IOTASourceEditor, LIOTASourceEditor) then 46 | TC4DWizardUtils.ShowMsgAndAbort('Feature not currently supported'); 47 | 48 | LIOTAEditView := LIOTASourceEditor.GetEditView(0); 49 | if LIOTAEditView = nil then 50 | TC4DWizardUtils.ShowMsgAndAbort('Editor view cannot be located'); 51 | 52 | LIOTAProject := LIOTAModuleServices.GetActiveProject; 53 | if LIOTAProject = nil then 54 | TC4DWizardUtils.ShowMsgAndAbort('No active projects were found'); 55 | LFilePathProject := ExtractFilePath(LIOTAProject.FileName); 56 | 57 | LFileNameModule := TC4DWizardUtilsOTA.GetFileNameDprOrDpkIfDproj(LIOTAModule); 58 | 59 | TC4DWizardUtilsOTA.SaveAllModifiedModules; 60 | 61 | LCursorPos := LIOTAEditView.CursorPos; 62 | //REFERENCE: https://code.visualstudio.com/docs/editor/command-line 63 | LCommand := Format('"code -n %s -g %s:%d:%d"', [LFilePathProject, LFileNameModule, LCursorPos.Line, LCursorPos.Col]); 64 | TC4DWizardProcessDelphi.RunCommand([LCommand]); 65 | end; 66 | 67 | class procedure TC4DWizardVsCodeIntegration.InstallDelphiLSP; 68 | begin 69 | Self.RunCommandInstallExtension('embarcaderotechnologies.delphilsp'); 70 | end; 71 | 72 | class procedure TC4DWizardVsCodeIntegration.InstallGithubCopilot; 73 | begin 74 | Self.RunCommandInstallExtension('github.copilot'); 75 | end; 76 | 77 | class procedure TC4DWizardVsCodeIntegration.InstallSupermaven; 78 | begin 79 | Self.RunCommandInstallExtension('supermaven.supermaven'); 80 | end; 81 | 82 | class procedure TC4DWizardVsCodeIntegration.RunCommandInstallExtension(const AIdentifierExtension: string); 83 | var 84 | LCommand: string; 85 | begin 86 | if AIdentifierExtension.Trim.IsEmpty then 87 | Exit; 88 | 89 | LCommand := Format('"code --install-extension %s --force"', [AIdentifierExtension]); 90 | TC4DWizardProcessDelphi.RunCommand([LCommand]); 91 | 92 | TC4DWizardUtils.ShowMsg('Extension installation pushed to VS Code!'); 93 | end; 94 | 95 | end. 96 | -------------------------------------------------------------------------------- /Src/WaitingScreen/C4D.Wizard.WaitingScreen.View.dfm: -------------------------------------------------------------------------------- 1 | object C4DWizardWaitingScreenView: TC4DWizardWaitingScreenView 2 | Left = 0 3 | Top = 0 4 | BorderIcons = [] 5 | Caption = 'Wait for loading' 6 | ClientHeight = 68 7 | ClientWidth = 431 8 | Color = clBtnFace 9 | Font.Charset = ANSI_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'Segoe UI' 13 | Font.Style = [] 14 | FormStyle = fsStayOnTop 15 | OldCreateOrder = False 16 | Position = poScreenCenter 17 | OnCreate = FormCreate 18 | OnKeyDown = FormKeyDown 19 | OnShow = FormShow 20 | PixelsPerInch = 96 21 | TextHeight = 13 22 | object pnBody: TPanel 23 | Left = 0 24 | Top = 0 25 | Width = 431 26 | Height = 68 27 | Align = alClient 28 | BevelOuter = bvNone 29 | ParentBackground = False 30 | TabOrder = 0 31 | object lbMsg: TLabel 32 | Left = 0 33 | Top = 0 34 | Width = 28 35 | Height = 17 36 | Align = alClient 37 | Alignment = taCenter 38 | Caption = 'xxxx' 39 | Font.Charset = ANSI_CHARSET 40 | Font.Color = clWindowText 41 | Font.Height = -13 42 | Font.Name = 'Segoe UI Semibold' 43 | Font.Style = [fsBold] 44 | ParentFont = False 45 | Layout = tlCenter 46 | end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /Src/WaitingScreen/C4D.Wizard.WaitingScreen.View.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.WaitingScreen.View; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | System.Variants, 8 | System.Classes, 9 | Winapi.Windows, 10 | Vcl.Graphics, 11 | Vcl.Controls, 12 | Vcl.Forms, 13 | Vcl.Dialogs, 14 | Vcl.ExtCtrls, 15 | Vcl.StdCtrls; 16 | 17 | type 18 | TC4DWizardWaitingScreenView = class(TForm) 19 | pnBody: TPanel; 20 | lbMsg: TLabel; 21 | procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 22 | procedure FormShow(Sender: TObject); 23 | procedure FormCreate(Sender: TObject); 24 | private 25 | FMsg: string; 26 | public 27 | property Msg: string read FMsg write FMsg; 28 | end; 29 | 30 | implementation 31 | 32 | uses 33 | C4D.Wizard.Utils.OTA; 34 | 35 | {$R *.dfm} 36 | 37 | 38 | const 39 | C_MSG_DEFAULT = 'Wait for loading...'; 40 | 41 | procedure TC4DWizardWaitingScreenView.FormCreate(Sender: TObject); 42 | begin 43 | TC4DWizardUtilsOTA.IDEThemingAll(TC4DWizardWaitingScreenView, Self); 44 | FMsg := ''; 45 | end; 46 | 47 | procedure TC4DWizardWaitingScreenView.FormShow(Sender: TObject); 48 | begin 49 | lbMsg.Caption := C_MSG_DEFAULT; 50 | if(not FMsg.Trim.IsEmpty)then 51 | lbMsg.Caption := FMsg; 52 | 53 | Self.BringToFront; 54 | end; 55 | 56 | procedure TC4DWizardWaitingScreenView.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 57 | begin 58 | if(Key = VK_F4)and(ssAlt in Shift)then 59 | Key := 0; 60 | end; 61 | 62 | end. 63 | -------------------------------------------------------------------------------- /Src/WaitingScreen/C4D.Wizard.WaitingScreen.pas: -------------------------------------------------------------------------------- 1 | unit C4D.Wizard.WaitingScreen; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, 7 | C4D.Wizard.WaitingScreen.View; 8 | 9 | type 10 | TC4DWizardWaitingScreen = class 11 | private 12 | FC4DWizardViewWaitingScreen: TC4DWizardWaitingScreenView; 13 | constructor Create; 14 | public 15 | destructor Destroy; override; 16 | class function GetInstance: TC4DWizardWaitingScreen; 17 | procedure Show(const AMsg: string = ''); 18 | procedure Close; 19 | end; 20 | 21 | implementation 22 | 23 | var 24 | Instance: TC4DWizardWaitingScreen; 25 | 26 | class function TC4DWizardWaitingScreen.GetInstance: TC4DWizardWaitingScreen; 27 | begin 28 | if(not Assigned(Instance))then 29 | Instance := Self.Create; 30 | Result := Instance; 31 | end; 32 | 33 | constructor TC4DWizardWaitingScreen.Create; 34 | begin 35 | 36 | end; 37 | 38 | destructor TC4DWizardWaitingScreen.Destroy; 39 | begin 40 | inherited; 41 | end; 42 | 43 | procedure TC4DWizardWaitingScreen.Show(const AMsg: string = ''); 44 | begin 45 | if(not Assigned(FC4DWizardViewWaitingScreen))then 46 | FC4DWizardViewWaitingScreen := TC4DWizardWaitingScreenView.Create(nil); 47 | FC4DWizardViewWaitingScreen.Msg := AMsg; 48 | FC4DWizardViewWaitingScreen.Show; 49 | end; 50 | 51 | procedure TC4DWizardWaitingScreen.Close; 52 | begin 53 | FC4DWizardViewWaitingScreen.Close; 54 | FreeAndNil(FC4DWizardViewWaitingScreen); 55 | end; 56 | 57 | initialization 58 | 59 | finalization 60 | if(Assigned(Instance))then 61 | FreeAndNil(Instance); 62 | 63 | end. 64 | --------------------------------------------------------------------------------