Project groups are a great benefit for complex projects, but using project groups is not mandatory. You don't have to use project groups with every project. The Project Manager has a default project group called ProjectGroupl that is used when you don't specifically open or create a project group. Try this:
FIGURE 9.2. The Project Manager showing the default project group.
The project group called ProjectGroupl is a temporary project group. When you choose Save All from the File menu, you are prompted to save the project, but not the project group. If you want to save the project group, you must explicitly save it using the Save Project Group or Save Project Group As menu item from the Project Manager context menu.
Adding existing units to your projects is as simple as clicking the Add To Project button on the Project Manager toolbar or choosing Add To Project from the Project Manager context menu.
NOTE: You cannot add a unit to a project if a form with the same name already exists in the project. For example, if you have a form called MainForm and try to add a unit from another project that also has a form named MainForm, you get an error message from Delphi even if the filenames are different.
You use the Remove From Project option to remove files from the project. Alternatively, you can select the unit you want to remove and press the Delete key on the keyboard. Files removed from the project are not deleted from your hard drive, but are just removed from the project compile/link process.
CAUTION: Be careful when removing units from your projects. You must take care not to remove units that are referenced by other units in the project. If you remove units that are required by your project, a compiler error will result. Before removing a unit, be sure it is not used in your project. If you accidentally remove a needed unit from your project, you can add it back to the project with the Add To Project option as explained in the preceding section.
The Remove From Project dialog box enables multiple selection, so you can remove several units from a project at one time if you want.
To view a unit, form, or other file, just double-click the node representing the form or unit you want to view. You can also choose Open from the Project Manager context menu. The form or unit will be displayed in either the Form Designer or Code Editor, depending on the type of node you are viewing.
Was this article helpful?
What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.