[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


New Class Wizard

The New Class wizard is divided into the following steps:

1. Describe the name and location for the new class.

2. Specify base classes and methods for the new class.

3. List #include files for the new class.

4. Assign the new class to the project's build targets.

To use the New Class wizard, follow these steps:

1. Describe the name and location for the new class.

This section of the wizard, shown in Figure 7.11, lets you specify the name, declaration, and location for the new class. Other options are available to further describe the class.

This section includes the following parts:


Class Name

Enter a name for the class in this field.


Declaration File

This pop-up menu lets you specify the type of declaration file:

Depending on the option you choose, different fields become enabled below the Declaration File pop-up menu. The enabled fields for the New File option are shown in Figure 7.11, and the enabled fields for the Relative to class option are shown in Figure 7.12.

If you choose the New File option, type in the enabled field the path to which you want to save the file. Alternatively, click Set next to the field to save the file using a standard Save window.

If you choose the Relative to class option, the pop-up menu and the class field beside it become enabled, as shown in Figure 7.12. In the class field, type the name of the class you want to relate to the new class. Alternatively, click Set next to the class field, select a class in the window that opens, and then click Select. Next, use the pop-up menu to place the new class Before or After the class in the class field.


Namespace

In this field, type a namespace for the new class. Each name in the namespace should be unique.


Use separate file for member definitions

Enable this checkbox if you want to use a separate file to define the members of the new class. Type the path to the separate file in the field below the checkbox. Alternatively, click Existing to select the file using a standard dialog box. To create a new separate file, click New and save the new file to a location on your hard disk.

Choosing the Relative to class option:

2. Specify base classes and methods for the new class.

This section of the wizard, shown in Figure 7.13, lets you define base class, methods, and additional information for the new class.

This section includes the following parts:


Base Classes

Enter in this field a list of base classes for the new class. Some example base classes are provided.

New Class wizard - Base Class and Methods:

Generate Constructor and Destructor

Enable this checkbox to generate a constructor and destructor for the new class. After enabling this checkbox, the following options become available:


Namespaces required for base classes and constructor parameters (optional)

If you wish, you can enter in this field required namespaces for the base classes from the Base Classes field and the constructor parameters in the Generate Constructor and Destructor part of the wizard.

3. List #include files for the new class.

This section of the wizard, shown in Figure 7.14, lets you specify additional header #include files for the new class.

This section includes the following parts:


Include files that will automatically be added for base classes

This field shows you a list of #include files that will be automatically added to the base classes.


Additional header include files

Enter in this field a list of other #include files for the new class, in addition to those listed in the previous field. Separate each file in the list with a comma. Sample files are listed below the field.

New Class wizard - Include Files:

4. Assign the new class to the project's build targets.

This section of the wizard, shown in Figure 7.15, lets you assign the new class to particular build targets within the active project.

This section includes the following parts:


Project

This field shows you the path to the project whose build targets are listed in the next field.

New Class wizard - Targets:

Add files to targets

To assign the class to a specific build target, enable the checkbox next to the build target's name in this list. For example, in Figure 7.15, the new class is assigned to the generic build target.


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000