Step 1 - Create a New Component using the New Component Wizard

From Appmethod Topics
Jump to: navigation, search

Go Up to Creating a FireMonkey Primitive Control

  1. In the IDE, select Component > New Component.
  2. On the Ancestor Component page, select FMX.Objects.TShape as the ancestor component:
    AncestorCompn.png
  3. On the Component page, set TRegularPolygon as the name of the class, C:\Users\<your home directory>\My Documents\Appmethod\Projects\RegularPolygon.pas as the name of a file to create:
    TRegularPolygonCompPage.png
  4. On the Create Unit page, select Install to New Package.
    CreatUnit.png
  5. On the New Package page, set RegularPolygon as the name of the new package to generate:
    NewPackagePage.png
  6. The wizard can open the Save '<UnitFile>' As dialog box asking for the confirmation of the name and the path of the generated unit file. Check that C:\Users\<your home directory>\My Documents\Appmethod\Projects\RegularPolygon.pas is displayed. Carefully check that the shown path is correct!
    Confirm Unit File
  7. Now you have created your new package project. Select Yes to confirm that this package is for FireMonkey:
    ConfirmMessage.png
  8. The following message confirms that your new component is built, installed, and registered in Appmethod:
    SecondMessage.png
    Note: Remember the path of the created .BPL file.
  9. Create a new FireMonkey HD Application:
    1. Right-click the project group in the Project Manager and select Add New Project from the context menu.
    2. Select Object Pascal Projects > FireMonkey Desktop Application from the New Items dialog box, and click OK.
      SelectingFMXHD.png
    3. Select HD Desktop Application, and click OK.
      SelectingFMXHD2.png
  10. Save your new FireMonkey HD Application as TestRegularPolygon.dproj and save the Unit as TestRegularPolygonUnit.pas. Save the project group as RegularPolygonProjectGroup.groupproj by right-clicking the project group item in the Project Manager and selecting Save Project Group As from the context menu. Notice that the command first sequentially shows dialog boxes asking to save each project in the project group and in the end it shows the dialog box for saving the project group.
  11. Now you see the TRegularPolygon component on the Tool Palette when Form1 is shown in the Form Designer. However, when you drop TRegularPolygon onto the Form Designer, you may notice that TRegularPolygon does not yet display anything. This is because you have not implemented anything yet.
    IDEWithFullPackage.png
  12. Next, you implement the TRegularPolygon component.

Next