In the Berlin Update 2 IDE. I'm working on a multi-device app I'm creating.

In the Berlin Update 2 IDE. I'm working on a multi-device app I'm creating.

When I add a TPanel to the form, even though my target platform is set to OS X, the IDE adds Vcl.Controls and Vcl.ExtCtrls to the uses.

Of course I don't want them in an OS X app.

Any suggestions on how to avoid accidentally adding a VCL-only component to a form intended for OS X?

Edit: Ohhhh! I just tried adding the form to my application and got the message "Unit "name" is incompatible with the FMX framework used by the project"

Yes, this is a VCL form which I stripped all components. How does the IDE determine the "gender" of a form (i.e. whether it's VCL or FMX?)???? I was planning to open VCL forms in this new project and manually redesign them. Sounds like I need to go the "other direction" - create an empty FMX form and then drop in the VCL form's code (removing all the component names from the section above private. And then finally manually adding the components.

Any suggestions?

Comments

  1. Tom Field "When I add a TPanel to the form, even though my target platform is set to OS X, the IDE adds Vcl.Controls and Vcl.ExtCtrls to the uses." This can't be right. Do you observe this in a new and clean project?

    The IDE determines what kind of form is required by the type of project you choose to create (eg. multi-device project). In more technical terms, there is a flag in the dpr file I think which defines the type of project.

    I remember there were a few hacks around regarding how to use/import VLC forms in FMX but never really tried them. A big name was something called Midas but recently I haven't seen any updates/development around this.

    ReplyDelete
  2. Your .dproj file tells you what kind of application it is (FMX or VCL) in the FrameworkType delement and the IDE should respond to that correctly. Can you check out if your .dproj is correct.

    ReplyDelete
  3. Jeroen Wiert Pluimers Thanks for the suggestion. The dproj was correctly set. David pointed out the problem: $R *.dfm in the code.

    ReplyDelete

Post a Comment