首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何通过OpenTools API向Delphi添加目标平台

如何通过OpenTools API向Delphi添加目标平台
EN

Stack Overflow用户
提问于 2014-01-09 14:53:38
回答 1查看 879关注 0票数 0

在德尔菲(XE2 to XE5)中,如何以编程方式将目标平台添加到项目中?

所谓“以编程方式”,我指的是通过OpenTools API,而不是通过.dproj文件的转换。这将在IDE向导/专家中完成。

我已经查看了ToolsAPI单元,看起来您可以获得活动平台和支持的平台列表,但是添加新的目标平台是没有什么明显的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-01-09 21:09:12

看来这是可能的。你需要查看的单位是PlatformAPI。您需要的接口是:

代码语言:javascript
复制
  { Provides information on platform-specific information held by a project }
  IOTAProjectPlatforms160 = interface(IInterface)
    ['{E1C62726-BD51-4D4E-A2F2-9A8A59F272AE}']
    { Add an available platform to the project }
    procedure AddPlatform(const PlatformName: string);
    { Return the currently active platform key }
    function CurrentPlatform: string;
    { Return enabled state of the requested platform }
    function GetEnabled(const PlatformName: string): Boolean;
    { Return an array of strings representing the enabled platforms for a project }
    function GetEnabledPlatforms: TArray<string>;
    { Return the profile name associated with the specified platform }
    function GetProfile(const PlatformName: string): string;
    { Does the project support platform specified by PlatformName? }
    function GetSupported(const PlatformName: string): Boolean;
    { Return an array of strings representing the valid platforms for a project }
    function GetSupportedPlatforms: TArray<string>;
    { Set a platform as disabled for this project (cannot be made active) }
    procedure SetEnabled(const PlatformName: string; Value: Boolean);
    { Set the profile name for the specified platform. Pass an empty string to
      clear the profile }
    procedure SetProfile(const PlatformName, ProfileName: string);
    { Indicate the specified platform is supported or not }
    procedure SetSupported(const PlatformName: string; Value: Boolean);
    { Return whether or not the profile associated with PlatformName is the default profile
      for that platform }
    function UsingDefaultProfile(const PlatformName: string): Boolean;

    property EnabledPlatforms: TArray<string> read GetEnabledPlatforms;
    property Enabled[const PlatformName: string]: Boolean read GetEnabled write SetEnabled;
    property Profile[const PlatformName: string]: string read GetProfile write SetProfile;
    property Supported[const PlatformName: string]: Boolean read GetSupported write SetSupported;
    property SupportedPlatforms: TArray<string> read GetSupportedPlatforms;
  end;

AddPlatform方法似乎是你的人。

请注意,我没有尝试调用该方法。实际上,我所做的只是在tools API源文件夹中搜索word平台。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21023537

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档