Using the Class Explorer you can automate the creation of methods
To automate the creation of methods:
- Open the Delphi Class Explorer window by choosing ViewDelphi Class Explorer.
- In the Class Viewer pane, click a class or an interface into which you wish to add a new method.
- Click the right mouse button. In the appeared context menu choose the Add Method item. The Add Method dialog box appears.
- Into Method name type the name for the method to be added.
- In the Add to class combo box, select the class or interface to which you wish to add the method. By default, the class/interface currently selected in the Class Viewer pane is prompted. You can, however, change this to any other available class/interface selecting it from the drop-down list in the combo box. Select the @unitclass to add the method to the global scope. Notice that when you add a new method into an interface, then only the method declaring code is generated. (No implementation code is generated.)
- In the Arguments field, type in the list of arguments, if any. Arguments should be typed exactly as they appear between the parentheses in the method declaration.
- In the Method type group, select the type of the method. You can select among: function, procedure, constructor, and destructor.
- In the Return type combo box, select the type of the return value. 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 the visibility specifiers. The selected visibility specifier will be applied to the method being created.
- Click OK. Into the specified class/interface the code for the declaration and default implementation of the specified method will be inserted.