livius2 / Virtual-TreeView

Pending port of Virtual Treeview to Firemonkey (FMX)
http://www.jam-software.de/virtual-treeview/
37 stars 5 forks source link

Property Position.X does not exists #7

Closed ChristophSchneiderTrihow closed 5 years ago

ChristophSchneiderTrihow commented 5 years ago

I try to use TVirtualStringTree in a FMX project under Delphi 10.2 Tokyo.

After putting TVirtualStringTree on a FMX form I get the following exception while loading the resource of the form: Property Position.X does not exists.

In the call stack I can see that some methods of the VCL are involved which are probably the root cause of this issue:

System.Classes.PropertyNotFound('Position.X') System.Classes.TReader.PropertyError('Position.X') System.Classes.TReader.ReadProperty($4292050) System.Classes.TReader.ReadDataInner($4292050) ... System.Classes.TComponent.ReadState(???) .. Vcl.Controls.TControl.ReadState($435F490) .. FMX.Forms.TCommonCustomForm.Create(???) .. FMX.Forms.TApplication.RealCreateForms

I assume that the component is not yet fully ready for Firemonkey.

Steps to reproduce:

  1. Build and install Packages\RAD Studio 10.2 FMX\VirtualTreeViewFMX.groupproj
  2. Create a new empty FMX application in Delphi 10.2
  3. Put a VirtualStringTree component on the form.
  4. Run the application > Exception before the constructor of the form is called!
livius2 commented 5 years ago

Did you added VT_FMX in Project\Options\Conditional Defines? If not add it and build the project You also need to have VT source in Project\Options the search path for me it is U:\Github\Virtual-TreeView\Source for you it is different. Also remember that you can not have VirtualTree VCL installed if you need to use VT FMX as drop component form the Delphi IDE palette.

Is your problem resolved?

ChristophSchneiderTrihow commented 5 years ago

Thank you, adding VT_FMX as conditional defines in the project settings solved my issue!

BTW: I had a similar problematic in my own cross platform library FB4D an I have built-in a compiler message if a comparable conditional is missing. I hope Embarcadero add a such define in the future automatically to each project.