⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch09.htm

📁 delphi自学的好教材!特别适合刚刚起步学习delphi的人员!同样对使用者具有参考价值!
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Item</I></TD>		<TD ALIGN="LEFT"><I>Description</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Add New Project</TD>		<TD ALIGN="LEFT">Opens the Object Repository so that you can choose a new target. Targets include			applications, DLLs, forms, data modules, components, or any other object available			from the Object Repository.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Add Existing Project</TD>		<TD ALIGN="LEFT">Opens a project file from disk and adds it to the project group.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Save Project Group</TD>		<TD ALIGN="LEFT">Saves the project group. Project groups have a .bpg extension.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Save Project Group As</TD>		<TD ALIGN="LEFT">Saves the project group with a new name.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">View Project Group Source</TD>		<TD ALIGN="LEFT">Displays the project group source. The project group source is a special file (a			makefile) that contains references to all projects within the project group.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Toolbar</TD>		<TD ALIGN="LEFT">Toggles the Project Manager toolbar on and off.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Status Bar</TD>		<TD ALIGN="LEFT">Toggles the Project Manager status bar on and off.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Dockable</TD>		<TD ALIGN="LEFT">Specifies whether the Project Manager is dockable.</TD>	</TR></TABLE><BLOCKQUOTE>	<P><HR><strong>NOTE:</strong> The Toolbar, Status Bar, and Dockable menu items appear on each of	the Project Manager context menus. I won't mention them again when I discuss the	other Project Manager context menus. <HR></BLOCKQUOTE><P><B>The Project Context Menu</B></P><P>The project context menu is displayed when you right-click a project node in theProject Manager. Table 9.2 lists the context menu items specific to the project contextmenu.</P><P><H4>TABLE 9.2. THE PROJECT CONTEXT MENU ITEMS.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Item</I></TD>		<TD ALIGN="LEFT"><I>Description</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Add</TD>		<TD ALIGN="LEFT">Opens the Add to Project dialog box so that you can add a file to the project. The			same as choosing Project|Add to Project from the main menu or from the Delphi toolbar.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Remove File</TD>		<TD ALIGN="LEFT">Opens the Remove From Project dialog box so that you can remove a file from the project.			The same as choosing Project|Remove from Project from the main menu or from the Delphi			toolbar.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Save</TD>		<TD ALIGN="LEFT">Saves the project. The same as choosing File|Save from the Delphi main menu.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Options</TD>		<TD ALIGN="LEFT">Displays the Project Options dialog box for this project. The same as choosing Project|Options			from the Delphi main menu.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Activate</TD>		<TD ALIGN="LEFT">Makes this project the active project.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Compile</TD>		<TD ALIGN="LEFT">Compiles this project. The difference between compile and build was discussed on			Day 4.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Build</TD>		<TD ALIGN="LEFT">Builds this project.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">View Source</TD>		<TD ALIGN="LEFT">Displays the project source file. The same as choosing Project|View Source from the			Delphi main menu.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Close</TD>		<TD ALIGN="LEFT">Closes this project and all its files. If the project is part of a saved project			group, the project node icon will be grayed out. The project is still part of the			group but is not open in the IDE. If the project is part of the default project group,			the project is closed and removed from the default group.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Remove Project</TD>		<TD ALIGN="LEFT">Removes this project from the project group. The project is not deleted from your			hard drive, just removed from the project group. Same as clicking the Remove Selected			Project button on the Project Manager toolbar.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Build Sooner</TD>		<TD ALIGN="LEFT">Moves the project up in the project tree. Projects are built from the top of the			Project Manager down.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Build Later</TD>		<TD ALIGN="LEFT">Moves the project down in the project tree.</TD>	</TR></TABLE><BLOCKQUOTE>	<P><HR><strong>NOTE:</strong> The Project Manager context menus are even more diverse than represented	in this section. The project context menus contain additional items if the project	is a Batch File or a Package project. The differences are not significant, so I won't	go over those additional menu items. <HR></BLOCKQUOTE><P><B>The Unit Context Menu</B></P><P>The unit context menu is displayed when you right-click a unit node in the ProjectManager. Table 9.3 lists the unit context menu items.</P><P><H4>TABLE 9.3. THE UNIT CONTEXT MENU ITEMS.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Item</I></TD>		<TD ALIGN="LEFT"><I>Description</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Open</TD>		<TD ALIGN="LEFT">Displays the unit in the Code Editor (for standalone units) or Form Designer (if			the unit has an associated form).</TD>	</TR></TABLE><BR></P><P>Remove From Project removes the unit from the project. The Project Manager doesnot prompt you to remove the unit and there is no undo for this action. You an alwaysadd the unit back to the project if you remove a unit by accident.</P><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Save</TD>		<TD ALIGN="LEFT">Saves the unit. The same as choosing File|Save from the Delphi main menu.</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Save As</TD>		<TD ALIGN="LEFT">Opens the Save As dialog box so that you can save the unit with a new name. The same			as choosing File|Save As from the Delphi main menu.</TD>	</TR></TABLE></P><P><B>The File Context Menu</B></P><P>The file context menu is displayed when you right-click a node other than theproject group node, a project node, or a unit node (usually a .pas or .dfm file).This context menu has only one item. The Open menu item displays the selected nodein either the Code Editor or the Form Designer, depending on the type of the selectednode.</P><P><H4>The Project Manager Toolbar and Keyboard Commands</H4><P>In addition to the Project Manager context menus, the Project Manager has a toolbarto make working with the Project Manager easier. The Project Manager toolbar containsthree buttons:</P><UL>	<LI>The Add New Project button displays the Object Repository so that you can add	a new project to the project group. This is the same as clicking the Add New Project	menu item from the project context menu.	<P>	<LI>The Remove Selected Project button removes the selected project from the project	group. Use this button only to remove an entire project, not to remove a particular	form or file from a project.	<P>	<LI>The Activate Selected Project button makes the selected target the active project.</UL><P>Keyboard commands include the Delete key and the Insert key. When you press Delete,the selected node is removed. If a project node is selected, the project is removedfrom the project group. If a unit node is selected, the unit is removed from theproject to which the unit belongs. The Insert key behaves exactly the same as choosingAdd to Project from the project context menu.</P><BLOCKQUOTE>	<P><HR><strong>TIP:</strong> The Project Manager toolbar buttons can be either large or small.	By default, the Project Manager toolbar buttons are small. You can change the toolbar	button size by dragging the bottom of the toolbar either up (to show the small buttons)	or down (to show the large buttons). <HR></BLOCKQUOTE><H3><A NAME="Heading5"></A>Creating and Using Project Groups</H3><P>Project groups are a great benefit for complex projects, but using project groupsis not mandatory. You don't have to use project groups with every project. The ProjectManager has a default project group called ProjectGroup1 that is used when you don'tspecifically open or create a project group. Try this:</P><DL>	<DT></DT>	<DD><B>1. </B>Choose File|Close All to close any open projects or project groups.	<P>	<DT></DT>	<DD><B>2. </B>Choose File|New Application to create a new application.	<P>	<DT></DT>	<DD><B>3. </B>Choose View|Project Manager to display the Project Manager. The Project	Manager is displayed as shown in Figure 9.2.	<P></DL><P><A HREF="javascript:popUp('28670902.gif')"><B>FIGURE 9.2.</B></A><B> </B><I>TheProject Manager showing the default project group.</I></P><P>The project group called ProjectGroup1 is a temporary project group. When youchoose Save All from the File menu, you are prompted to save the project, but notthe project group. If you want to save the project group, you must explicitly saveit using the Save Project Group or Save Project Group As menu item from the ProjectManager context menu.</P><P><H4>Adding Units</H4><P>Adding existing units to your projects is as simple as clicking the Add To Projectbutton on the Project Manager toolbar or choosing Add To Project from the ProjectManager context menu.</P><BLOCKQUOTE>	<P><HR><strong>NOTE:</strong> 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. <HR></BLOCKQUOTE><H4>Removing Units</H4><P>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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -