Last year, we showed how you can copy tools from one project to another ("Copying a Tool to Another Project," June 1994). That tip involved configuring the Borland C++ 4.0 Integrated Development Environment (IDE) to save and read Project Description Language (PDL) files, and then copying a tool's description from one PDL file to another.
Unfortunately, it's easy to make a mistake when you're
editing the PDL files for a project, thereby making it impossible
for the IDE to load the information. Instead, you can configure
the IDE to automatically copy tools from a currently open project
to new projects. In this article, we'll show how your new
projects can inherit IDE tools and style sheets from an existing
project.
To configure IDE tool and style sheet inheritance, you'll
need to add a special setting to the IDE's configuration
file, BCW.INI. In this file, you'll add the line
inherit=1
to the section marked [Project]. After making this change, you don't need to close the IDE for the change to take effect. The IDE reads this portion of the configuration file each time it closes or opens a project.
The next time you create a new project, that project will inherit the style sheets and IDE tools from the current project. (If you don't have a project open when you create a new project, the new project will inherit the style sheets and tools from the default project file.) To see how this technique works, let's work through a simple example.
To begin, launch the IDE and choose Open... from the File menu. In the Open A File dialog box, enter \WINDOWS\BCW.INI and click OK.
When the editing window for the BCW.INI file appears, locate the project section. (The project section of the configuration file begins with [Project].) Insert a line at the beginning of the project section and enter inherit=1 on that line. When you finish, the project section should resemble the one that appears in Figure A.
Figure A - You'll insert the inherit=1 statement in the project section of the configuration file.
Choose Save from the File menu. Then, double-click on the BCW.INI editing window's System menu icon.
When the BCW.INI window disappears, choose New Project... from the Project menu. In the New Project dialog box, enter \STYLE\STYLE.IDE and click OK. When the new project window appears, choose Tools... from the Options menu.
In the Tools dialog box, click New..., and then enter Dummy in the Name and Menu Text entry fields of the Tool Options dialog box. Enter \DOS\COMMAND.COM in the Path entry field. Click OK to create this tool. When the Tools dialog box reappears, click Close to return to the IDE main window.
To confirm that the new IDE tool exists in this project, click on the Tool menu. You should see the word Dummy appear at the top of the menu.
Now, create a new project that will inherit the Dummy tool by
choosing New Project... from the Project menu. In the
New Project dialog box, enter the name \TOOL\TOOL.IDE and
click OK. When the new project window appears, click on the Tool
menu to confirm that this project inherited the Dummy tool from
the STYLE.IDE project that was open when you created this project,
as shown in Figure B.
Figure B - When you display the Tool menu, you'll see the Dummy tool that you created in the STYLES.IDE project.
Custom tools and style sheets are powerful tools you can use to
customize the IDE. By configuring the IDE to inherit current tools
and style sheets when you create new projects, you won't
have to worry about corrupting a project's PDL files just
to transfer a tool or style sheet.
Copyright (c) 1996 The Cobb Group, a division of Ziff-Davis Publishing Company. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff-Davis Publishing Company is prohibited. The Cobb Group and The Cobb Group logo are trademarks of Ziff-Davis Publishing Company.