How instruct to the Delphi IDE refresh the modified syntax highlight colors using OTA (Open Tools API)?

后端 未结 2 627
春和景丽
春和景丽 2021-01-11 12:46

I\'m writting a plugin to integrate the Delphi IDE Theme Editor with the Rad Studio IDE (the current version of this tool run as an external application) so far everything i

相关标签:
2条回答
  • 2021-01-11 13:32

    A slight hack that should have the desired effect would be to have your plugin bring up the Environment Options dialog, and have the operator close it manually. This causes the IDE to reinitialize its configuration based on the submitted settings.

    To do this, obtain a handle onto a Project (IOTAProject object) and call...

    AProject.ProjectOptions.EditOptions;

    Where AProject is defined as AProject: IOTAProject.

    I know this isn't the most elegant of solutions, but if it has the desired effect, at least it's somewhat practical.

    0 讨论(0)
  • 2021-01-11 13:33

    I'd say your best bet would be to snoop around coreide*.@Envoptions@TEnvironmentOptions@EditorSourceOptionsBeforeSave or coreide*.@Envoptions@TEnvironmentOptions@EditorSourceOptionsAfterSave

    These get called when the Ok button gets clicked. I'm not very good at reading assembly but from the looks of it the environment options are loaded from the registery during IDE initialization and any changes made are written back as needed but the IDE depends on the in memory instance of TEnvironmentOptions to be the authoritative representation of all environment options.

    coreide*.@Envoptions@TEnvironmentOptions@GetEdColors appears to be where the colors are retrieved from the environment options for editing by TEditorColor

    It's unfortunate none of these classes is exposed to the OTA or NTA.

    0 讨论(0)
提交回复
热议问题