Using SoftBench Class Graph/Editor

Using SoftBench Class Graph/Editor in Your Work

Creating New Components

You can create new classes and class members by choosing one of the selections under the "Edit" menu. The actions you take depend on what you have chosen. Any files created in the process of adding components become part of your current project.

"Edit: Create Class…" prompts you for the name of the new class. By default, SoftBench Class Graph/Editor places the new class declaration in a new header file named classname.H. You may specify a different header file. SoftBench Class Graph/Editor displays the new class near the middle of the graph. You may move it to a more convenient location by dragging it with the middle mouse button.

All other choices under "Edit" act on a specified class. You must select the class you want to edit before choosing any of these choices. (The popup menu also provides these choices when a class is selected.) "Edit: Create Member Function…" and "Edit: Create Data Member…" add members to the class. SoftBench Class Graph/Editor prompts you for information about the new member.

"Edit: Create Member Function…" allows you to specify all properties of the new function. You can specify the signature (return type, name, and parameter list) and other properties (public, private, virtual, static, const). You can also specify a definition for the function, or only a declaration. See SoftBench Online Help for a more complete explanation.

You can add an inheritance relationship to the selected class by choosing "Edit: Add Base Class". The mouse pointer changes to a small "class" icon with an arrow pointing away from it. Select the desired base class.

SoftBench Class Graph/Editor also provides convenient shortcuts for creating classes and inheritance relationships:

To create a class, hold down the Ctrl key and click the middle mouse button where you want the class created.

To create an inheritance relationship, hold down the Ctrl key and the middle mouse button, and drag the mouse pointer from the base class to the derived class.

Modifying Existing Components

Select the component you want to modify. For member functions and data members you must first display the contents of the desired class. Select the class, press the right mouse button, and select "Show

Chapter 5

139