Using the Class Explorer you can automate the creation of fields
To automate the creation of fields:
- Open the Delphi Class Explorer window by choosing ViewDelphi Class Explorer.
- In the Class Viewer pane, click a class into which you wish to add a new field.
- Click the right mouse button. In the appeared context menu choose the Add Field item. The Add Field dialog box appears.
- Into Field name type the name of the field to be added.
- In the Add to class combo box, select the class to which you wish to add the field. By default, the class currently selected in the Class Viewer pane is prompted. You can, however, change this to any other available class selecting it from the drop-down list in the combo box. Select the @unitclass to add the field to the global scope.
- In the Type combo box, select the type of the field. You can select one of the predefined types from the drop-down list in the combo box or you can type in any other existing type.
- In the Visibility group, select one of the visibility specifiers. The selected visibility specifier will be applied to the field being created.
- Click OK. The code declaring the field with the specified properties will be inserted into the specified class.