Converting Delphi 7 property editor to Delphi XE2
Asked Answered
C

2

3

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.

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.

Edit

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 Fatal Error] ToolsAPI.pas(18): F1026 File not found: 'DockForm.dcu'

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

Cavort answered 7/1, 2012 at 20:43 Comment(6)
What problems are you having migrating your existing code?Radke
None of the design editor units are found, they're different in every version of delphi (as far as I know) and I know nothing about making design editors, other than I have one made for my project in D7.Cavort
The design-time units that are used in XE2 - DesignIntf, DesignEditors, DesignMenus, DesignWindows, etc - were introduced in D6, so they were in use in D7. Making a design-time property/component editor in XE2 is the same as in D7. Make a designtime-only package, add the DesignIDE package and your component's runtime package to its Requires list, code your editor class(es) as needed, and then register them via RegisterPropertyEditor(), RegisterComponentEditor(), etc inside your designtime package's exported Register() function. If you still have problems, show your code.Radke
If your property editor was properly written for Delphi 7, it should still compile perfectly in XE2. The last reorganization of VCL units for the design-time packages was in Delphi 6. Unit and package names haven't changed since. (Note I said VCL, as obviously FMX stuff didn't exist then.)Sf
And could I get an explanation for the vote to close? I'm pretty sure everyone upgrading to XE2 is going to want to know whether or not they will be having problems with upgrading, which I wasn't sure what to expect.Cavort
Jerry this is a perfectly good question. Not sure why the close votes.Cobb
A
4

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.

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. :)

Mike

Adowa answered 18/1, 2012 at 5:44 Comment(1)
That was it! Removed all 64bit references and it worked :D Guess I should have pointed out that I had 64bit option selected.Cavort
P
3

The DockForm.pas source code is available neither in Delphi XE nor in Delphi XE2.

You may try this accepted answer posted on SO applying to similar issue on Delphi 2010.

Presumably, it is compiled and included within some package already distributed with Delphi XE2.

Piotrowski answered 9/1, 2012 at 9:55 Comment(1)
+1. Add DesignIde.dcp to the requires section of your designtime package, and that's all you need to do.Cobb

© 2022 - 2024 — McMap. All rights reserved.