英文:
How to get the project source folder in Lazarus? (ComponentEditor)
问题
在给出负面评价之前:我理解编译后的软件无法访问源代码。然而,这个问题是为了ComponentEditor而提出的。
在LCL和Linux下创建自定义组件,我现在正在创建编辑器,它需要访问项目的源代码文件夹来生成/管理元数据文件并将它们添加到资源(*.rc)中。
在Embarcadero-Delphi中,我可以使用ToolsAPI
单元中的GetActiveProject.fileName
来实现这一点。
在跨平台的LCL中,等同于GetActiveProject.fileName
以获取自定义组件编辑器中项目源代码目录的方法是什么?
Delphi示例:
ProjectDir := ExtractFilePath( GetActiveProject.fileName );
英文:
Before to downvote: I understand that a compiled software has no access to the sources. However, this question is intended for the ComponentEditor.
Creating a custom component under LCL & Linux, I am creating now the editor, which would need access to the sources folder of the project to generate/manage metadata files and add them to the resources (*.rc).
Under Embarcadero-Delphi, I can do this with GetActiveProject.fileName
from ToolsAPI
unit.
What is the cross-platform LCL equivalent to GetActiveProject.fileName
to get the project source directory in a custom component editor?
Example in Delphi:
ProjectDir := ExtractFilePath( GetActiveProject.fileName );
答案1
得分: 1
根据 https://www.freepascal.org/~michael/articles/lazide1/lazide1.pdf,Open Tools API 的等价物是 Lazarus IDE 接口。
在 https://www.freepascal.org/~michael/articles/lazide2/lazide2.pdf 中有更多关于它们的信息...
英文:
As explained at https://www.freepascal.org/~michael/articles/lazide1/lazide1.pdf the equivalent of Open Tools API are Lazarus IDE interface.
Here https://www.freepascal.org/~michael/articles/lazide2/lazide2.pdf more information about them...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论