Question

I have an extension for a tabControl downloaded, im a newbie at delphi could somebody please tell me how i can make use of it in my current project.

I have downloaded the following file and saved it as FMX.Extensions.UX.TabControl in my project folder from here and added it to my uses on project1.

TabControl Extension

i have a project1 with a tabcontrol and a few simple items on each tab, can somebody help me in learning how to use this extension, i have no idea where to go from here.

Kind Regards

UPDATE:

I added this to my includes under form1.

{$R *.fmx}
{$I 'FMX.Extensions.UX.TabControl.pas'}

But now when i try to compile the project in delphi XE5 i get the errors.

[dcc32 Error] FMX.Extensions.UX.TabControl.pas(1): E2029 Declaration expected but 'UNIT' found
[dcc32 Error] FMX.Extensions.UX.TabControl.pas(53): E2003 Undeclared identifier: 'TIntAnimation'
[dcc32 Error] FMX.Extensions.UX.TabControl.pas(54): E2007 Constant or type identifier expected
[dcc32 Error] FMX.Extensions.UX.TabControl.pas(65): E2029 Declaration expected but 'IMPLEMENTATION' found
[dcc32 Fatal Error] FMX.Extensions.UX.TabControl.pas(65): E2226 Compilation terminated; too many errors
Was it helpful?

Solution

You need to first install the UX package. You can find it under Packages/ FMX.Extensions.UX.dproj. To install, open the package in the Delphi IDE then right click and select install.

You should also remove the line you added to the form ({$I 'FMX.Extensions.UX.TabControl.pas'}).

Disclaimer: I am the author of this component.

OTHER TIPS

To add a Delphi unit to you project you need to add it to one of the uses clauses in each unit file where it will be referenced.

The structure of a unit file is:

unit <unitname>;

interface
uses <files>;

//interface declarations

implementation
uses <files>;

//code here

end.

Each uses statement takes a comma separated list of unit names, so for you this would be

uses FMX.Extensions.UX.TabControl;

As a general rule you should place the units in the uses statement of the implementation section unless anything in your interface section references it, in which case us that in your interface section. Units referenced in your interface section can lead to issues with circular unit references.

Depending on where you save the file you may also need to add it's location to your library, either under Tools/Options/Delphi Options/Library/Library Path (for all projects) or Project/Options/Delphi Compiler/Search Path (current project only).

(I would recommend saving third party code in it's own folder so you have a record of what code comes from where).

The code you are including adds components which are used at design time. These components need registering with the IDE, which @norgepaul has explained how to do. If you use these components at design time then Delphi will add them to your uses clause for the form for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top