Step 1 - Create the Projects (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Creating a FireMonkey Component (Delphi)


Start with a clean slate by closing all files in RAD Studio (File > Close All). Choose a location and name for a new folder to hold all the component files.

Package project

  1. Select File > New > Package - Delphi.
  2. Select File > Save Project As and navigate to the folder location. Create a new folder, navigate to it, and save the project as DialogButtonsPackage.
  3. Right-click the newly created project group in the Project Manager and select Save Project Group As. Save as DialogButtonsGroup in the same directory.

Component Skeleton

Choose Component > New Component to open the New Component wizard. In its pages:

  1. Choose FireMonkey for Delphi as the framework and personality.
  2. Select TStyledControl as the ancestor.
  3. Set the class name to TDialogButtonPanel. For the unit name, click the ellipsis, make sure you are in the component folder, and save the unit file name as DialogButtons.
  4. Choose Add unit to DialogButtonsPackage.dproj project and Finish.
  5. If prompted to Save DialogButtons As, click Save.
  6. If prompted to enable the FireMonkey framework, click Yes.

This creates a unit with the component class, and a Register procedure to add that class to the component palette. Make sure that the DialogButtons.pas file is added to the package. It should be visible in the project tree under the Contains node.

DialogButtons in project three.png

Work/Test Projects

  1. Right-click the project group and choose Add New Project.
  2. In the New Items dialog box, select Delphi Projects > Multi-Device Application > Blank Application.
  3. Select File > Save As, navigate to the component folder, and save the form unit as PanelTest.
  4. Select File > Save Project As, ensure you are saving in the component folder, and save the project as PanelTester.
  5. Right-click the project, select Add New > Multi-Device Form > HD Form. Save the unit as TestDialog.
  6. Right-click the project, select Add New > Multi-Device Form > HD Form. Save the unit as PanelDesign.

Next

See Also