I'm working with Firemonkey in Delphi XE4 and I'm unable to create a new component using the menu item Component -> New Component.
Whether the component is a VCL or Firemonkey component or whether I create a package first the result is the same.
The Tool Palette in Delphi appears to be searched and gradually it closes leaving it empty of components and a component dialog box that says "No Items available" when it comes to selecting an ancestor component.
I have two separate installations of Delphi XE4 and the same symptoms appear on both.
It appears that Delphi believes that there are no suitable base components on which to build a new component.
Creating components is fairly straightforward in code.
- Create a unit.
- Add code for your component.
Add a Register procedure.
procedure Register;
begin
RegisterComponents('NewPage', [TMyComponent]);
end;
Add a declaration for Register in the implements section.
Add a call to RegisterFMXClasses in your initialization section.
implementation
uses FMX.Types;
...
initialization
RegisterFMXClasses([TMyComponent]);
end.
Create a package.
- Add the unit to the package.
- Right-click the package (in the top-right panel) and select Install.
(Note: It's usually best to create your component at run time whilst testing. You only need to do the package stuff once it's fairly stable).