将Delphi 7属性编辑器转换为Delphi XE2

问题描述:

首先,我从未从头开始编写属性编辑器,但是在另一个问题。请参阅此处接受的答案。这是在Delphi 7中使用的,现在我已经开始使用XE2,并且必须确保我的属性编辑器与 7和XE2都兼容。

First of all, I have never written a property editor from scratch, but had some help with one in another question. Refer to the accepted answer there. This was in Delphi 7, and now I have started using XE2 and I have to make sure my property editor is compatible with both 7 and XE2.

本质上是一个集合编辑器,不同之处在于每个集合项在父窗体中都有自己的命名组件。自7以来,XE2中的属性编辑器有什么新变化,因为这是一个巨大的版本跳转?

It's essentially a collection editor, with the difference that each collection item has its own named component in the parent form. Is there anything new about the property editors in XE2 since 7, since it is a huge version jump?

我不想为不同的单元制作完整的副本版本。我想将所有可能的版本保存在一个单元中。

I do NOT want to make a complete copy of my unit for different versions. I want to maintain all possible versions in one unit.

编辑

它似乎Delphi XE2具有与Delphi 7相同的属性编辑器,但是我面临的问题是,尽管我在程序包中包含 DesignIDE ,但找不到任何东西,因此我必须将 ToolsAPI 文件夹添加到我的库路径中。

It appears that Delphi XE2 has the same property editors as Delphi 7, but the issue I was facing was that although I was including DesignIDE in my package, it could not find anything, so I had to add the ToolsAPI folder to my library path.

但是,在此之后我有一个新问题。

However, now I have a new issue after this.

[DCC致命错误] ToolsAPI.pas(18):F1026找不到文件:'DockForm.dcu'

我迷失了整个BPL软件包的概念,并要求其他软件包等等。

I'm lost in the whole concept of BPL packages and requiring others, etc.

DesignIntf​​,DesignEditor,DesignMenus,DesignWindows是DesignIDE.bpl的一部分,可在\Embarcadero\RAD_Studio\9.0\lib\win32\release\designide.dcp中找到。但是没有没有用于64位的designide.dcp ,这就是为什么在编译引用这些单元的64位程序包时会引发错误的原因。

DesignIntf, DesignEditors, DesignMenus, DesignWindows are part of DesignIDE.bpl and is found in \Embarcadero\RAD_Studio\9.0\lib\win32\release\designide.dcp. But there is no designide.dcp for 64bit which is why it throws an error when compiling a 64bit package that references these units.

没有64位版本的DesignIDE,因为它用于设计时程序包,而设计时程序包仅是32位(请记住,Delphi IDE仍然只有32位)。因此,始终将设计时间包设置为32位,而不是64位。 :)

There is no 64bit version of DesignIDE because it is for a design time package and design time packages are 32 bit only (remember Delphi IDE is still only 32 bits). So always set your design time package as 32bit, not 64bit. :)

迈克