A number of improvements to TFireMonkeyContainer have been checked in over the past day.
New to TFireMonkeyContainer? It is a small open-source VCL component to host a FireMonkey form inside a VCL form, as though it was a normal component. Read more about TFireMonkeyContainer here.
- Support for the VCL drag-drop system: You can drag and drop over the TFireMonkeyContainer when it is hosting a FMX form, and the host VCL container will get VCL drag/drop events.
- A new property, FireMonkeyFormHandle: This returns the window handle of the hosted form, if one is being hosted.
- C++ support fixes: a class constructor and class destructor were replaced with code in the unit’s initialization and finalization section. This is because using a class constructor gives an ‘unsupported language feature’ warning when building with C++ library support.
- XE2 and XE3 support: The component was originally written in XE2, but when XE4 was released it was upgraded and support for older versions of FireMonkey dropped. Thanks to a contribution from Ilya S, this has been restored. You can now use TFireMonkeyContainer in XE2, XE3, XE4, XE5 and XE6.
- Package dependencies: The designtime package included FMXContainer.pas, whereas it should have omitted that file and required the runtime package. This will also allow you to use FMXContainer.pas in another installed package at the same time. Thanks to Paul Thornton for pointing this out.
- New packages for each version: Until now, there had been one runtime and one designtime package in the code. This was getting unwieldy, especially after adding XE2 and XE3 support, and so I bit the bullet and made specific designtime and runtime packages for each IDE version, XE2-XE6.
The file layout for packages and demo code was rearranged to be cleaner too.
- Demo for XE4 and above only: The example project (one VCL form and a 2D and 3D FMX form on a tab each inside it) is for XE4 and above only. Opening it in XE3 or XE2 will give errors with missing components. The TFireMonkeyContainer component still works in those versions; it’s only the demo that is for new IDE versions only.
- Known bug – text input: In previous versions, edit and memo components could be typed in, but did not display a cursor position, making them difficult to use, but possible. In this version no key presses make it to the controls at all. This is probably related to the fix to enable drag/drop support and the complex relationship between the FMX form, VCL form, FMX application window, and VCL application. Until this is fixed, if you need to have user input in a FMX form hosted in a VCL form, I’d suggest using a VCL control at that point. Please let me know if this causes you any significant problems and I’ll try to devote some more time to solving it.
Thankyou to those who have made contributions to this project.