📄 apc.htm
字号:
workspace, so you won't use this menu item very often.</P>
<P><B>File Save (Ctrl+S)  </B>Use this item to save the file that has focus
at the moment; if no file has focus, the item is grayed. There is a Save button on
the Standard toolbar as well.</P>
<P><B>File Save As  </B>Use this item to save a file and change its name
at the same time. It saves the file that has focus at the moment; if no file has
focus, the item is grayed.</P>
<P><B>File Save All  </B>This item saves all the files that are currently
open. All files are saved just before a compile and when the application is closed,
but if you aren't compiling very often and are making a lot of changes, it's a good
idea to save all your files every 15 minutes or so. (You can do it less often if
the idea of losing that amount of work doesn't bother you.)</P>
<P><B>File Page Setup  </B>This item opens the Page Setup dialog box, shown
in Figure C.21. Here you specify the header, footer, and margins--left, right, top,
and bottom. The header and footer can contain any text including one or more special
fields, which you add by clicking the arrow next to the edit box or entering the
codes yourself. The codes are</P>
<UL>
<LI><I>Filename</I>. The name of the file being printed (&f).
<P>
<LI><I>Page Number</I>. The current page number (&p).
<P>
<LI><I>Current Time</I>. The time the page was printed (&t).
<P>
<LI><I>Current Date</I>. The date the page was printed (&d).
<P>
<LI><I>Left Align</I>. Align this portion to the left (&l).
<P>
<LI><I>Right Align</I>. Align this portion to the right (&c).
<P>
<LI><I>Center</I>. Center this portion (this is the default alignment) (&c).
</UL>
<P><A HREF="javascript:popUp('xcuvc21.gif')"><B>FIG. C.21</B></A><B> </B><I>The Page
Setup dialog box lays out your printed pages the way you want.</I></P>
<P><I><BR>
</I><B>File Print (Ctrl+P)  </B>Choosing this item prints the file with
focus according to your Page Setup settings. (The item is grayed if no file has focus.)
The Print dialog box, shown in Figure C.22, has you confirm the printer you want
to print on. If you have some text highlighted, the Selection radio button is enabled.
Choosing it lets you print just the selected text; otherwise, only the All radio
button is enabled, which prints the entire file. If you forget to set the headers,
footers, and margins before choosing File, Print, the Setup button opens the Page
Setup dialog box discussed in the previous section. There is no way to print only
certain pages or to cancel printing after it has started.</P>
<P><A HREF="javascript:popUp('xcuvc22.gif')"><B>FIG. C.22</B></A><B> </B><I>The Print
dialog box confirms your choice to print a file.</I></P>
<P><B>Recent Files and Recent Workspaces  </B>The recent files and workspaces
items, between Print and Exit, each lead to a cascading menu. The items on the secondary
menus are the names of files and workspaces that have been opened most recently,
up to the last four of each. These are real time-savers if you work on several projects
at once. Whenever you want to open a file, before you click that toolbar button and
prepare to point and click your way to the file, think first whether it might be
on the File menu. Menus aren't always the slower way to go.</P>
<P><B>File Exit  </B>Probably the most familiar Windows menu item of all,
this closes Developer Studio. You can also click the X in the top-right corner or
double-click what used to be the system menu in the top left. If you have made changes
without saving, you get a chance to save each file on your way out.
<H3><A NAME="Heading21"></A>Edit</H3>
<P>The Edit menu, shown in Figure C.23, collects actions related to changing text
in a source file.</P>
<P><B>Edit Undo (Ctrl+Z)  </B>The Undo item reverses whatever you just
did. Most operations, like text edits and deleting text, can be undone. When Undo
is disabled, it is an indication that nothing needs to be undone or you cannot undo
the last operation.</P>
<P><A HREF="javascript:popUp('xcuvc23.gif')"><B>FIG. C.23</B></A><B> </B><I>The Edit
menu holds items that change the text in a file.</I></P>
<P>There is an Undo button on the Standard toolbar. Clicking the arrow next to the
button displays a stack (reverse order list from most recent to least recent) of
operations that can be undone. You must select a contiguous range of undo items including
the first, second, and so on. You cannot pick and choose.</P>
<P><B>Edit Redo (Ctrl+Y)  </B>As you undo actions, the name given to the
operations move from the Undo to the Redo list (Redo is next to Undo on the toolbar).
If you undo a little too much, choose Edit, Redo to un-undo them (if that makes sense).</P>
<P><B>Edit Cut (Ctrl+X)  </B>This item cuts the currently highlighted text
to the Clipboard. That means a copy of it goes to the Clipboard, and the text itself
is deleted from your file. The Cut button (represented as scissors) is on the Standard
toolbar.</P>
<P><B>Edit Copy (Ctrl+C)  </B>Editing buttons on the toolbar are grouped
next to the scissors (Cut). Edit, Copy copies the currently selected text or item
to the Windows Clipboard.</P>
<P><B>Edit Paste (Ctrl+V)  </B>Choosing this item copies the Clipboard
contents at the cursor or replaces the highlighted text with the Clipboard contents
if any text is highlighted. The Paste item and button are disabled if there is nothing
in the Clipboard in a format appropriate for pasting to the focus window. In addition
to text, you can copy and paste menu items, dialog box items, and other resources.
The Paste button is on the Standard toolbar.</P>
<P><B>Edit Delete (Delete)  </B>Edit, Delete clears the selected text or
item. If what you deleted is undeletable, the Undo button is enabled, and the last
operation is added to the Undo button combo box. Deleted material does not go to
the Clipboard and cannot be retrieved except by undoing the delete.</P>
<P><B>Edit Select All (Ctrl+A)  </B>This item selects everything in the
file with focus that can be selected. For example, if a text file has focus, the
entire file is selected. If a dialog box has focus, every control on it is selected.</P>
<P>To select many items on a dialog box, you can click the first item and then Ctrl+click
each remaining item. It is often faster to use Edit, Select All to select everything
and then Ctrl+click to deselect the few items you do not want highlighted.</P>
<P><B>Edit Find (Ctrl+F)  </B>The Find dialog box shown in Figure C.24
enables you to search for text within the file that currently has the focus. Enter
a word or phrase into the Find What edit box. The following check boxes set the options
for the search:</P>
<UL>
<LI><I>Match Whole Word Only</I>. If this is checked, table in the Find What box
matches only table, not suitable or tables.
<P>
<LI><I>Match Case</I>. If this is checked, Chapter in the Find What box matches only
Chapter, not chapter or CHAPTER. Uppercase and lowercase must match.
<P>
<LI><I>Regular Expression</I>. The Find What box is treated as a regular expression
if this box is checked.
<P>
<LI><I>Search All Open Documents</I>. Expands your search to all the documents you
have open at the moment.
<P>
<LI><I>Direction</I>. Choose the Up radio button to search backwards and the Down
radio button to search forwards through the file.
</UL>
<P><A HREF="javascript:popUp('xcuvc24.gif')"><B>FIG. C.24</B></A><B> </B><I>The Find
dialog box is used to find a string within the file that has focus.</I></P>
<BLOCKQUOTE>
<P>
<HR>
<strong>TIP:</strong> If you highlight a block of text before selecting Edit, Find, that
text is put into the Find What box for you. If no text is highlighted, the word or
identifier under the cursor is put into the Find What box.
<HR>
</BLOCKQUOTE>
<P>A typical use for the Find dialog box is to enter some text and click the Find
Next button until you find the precise occurrence of the text for which you are searching.
You may want to combine the Find feature with bookmarks (discussed a little later
in this section) and put a bookmark on each line that has an occurrence of the string.
Click the Mark All button in the Find dialog box to add temporary, unnamed bookmarks
on match lines; they are indicated with a blue oval in the margin.</P>
<P>There is a Find edit box on the Standard toolbar. Enter the text you want to search
for in the box and press Enter to search forward. Regular expressions are used if
you have turned them on using the Find dialog box. To repeat a search, click in the
search box and press Enter. You may wish to add the Find Next or Find Previous buttons
to the Standard toolbar using the Tools, Customize menu item described later in this
chapter.</P>
<BLOCKQUOTE>
<P>
<HR>
<B>Regular Expressions</B></P>
<P>Many of the find and replace operations within Developer Studio can be made more
powerful with regular expressions. For example, if you want to search for a string
only at the end of a line, or one of several similar strings, you can do so by constructing
an appropriate regular expression, entering it in the Find dialog box, and instructing
Developer Studio to use regular expressions for the search. A regular expression
is some text combined with special characters that represent things that can't be
typed, such as "the end of a line" or "any number" or "three
capital letters."</P>
<P>When regular expressions are being used, some characters give up their usual meaning
and instead stand in for one or more other characters. Regular expressions in Developer
Studio are built from ordinary characters mixed in with these special entries, shown
in Table C.1.</P>
<P>You don't have to type these in if you have trouble remembering them. Next to
the Find What box is an arrowhead pointing to the right. Click there to open a shortcut
menu of all these fields, and click any one of them to insert it into the Find What
box. (You need to be able to read these symbols to understand what expression you
are building, and there's no arrowhead on the toolbar's Find box.) Remember to select
the Regular Expressions box so that these regular expressions are evaluated properly.</P>
<P>Here are some examples of regular expressions:</P>
<UL>
<LI>^test$ matches only test alone on a line.<BR>
<BR>
<LI>doc[1234] matches doc1, doc2, doc3, or doc4 but not doc5.<BR>
<BR>
<LI>doc[1-4] matches the same strings as above but requires less typing.<BR>
<BR>
<LI>doc[^56] matches doca, doc1, and anything else that starts with doc and is not
doc5 or doc6.<BR>
<BR>
<LI>H\~e matches Hillo and Hxllo (and lots more) but not Hello. H[^e]llo has the
same effect.<BR>
<BR>
<LI>[xy]z matches xz and yz.<BR>
<BR>
<LI>New *York matches New York but also NewYork and New York.<BR>
<BR>
<LI>New +York matches New York and New York but not NewYork.<BR>
<BR>
<LI>New.*k matches Newk, Newark, and New York, plus lots more.<BR>
<BR>
<LI>\:n matches 0.123, 234, and 23.45 (among others) but not -1C.
<LI>World$ matches World at the end of a line, but World\$ matches only World$ anywhere
on a line.
</UL>
<P>
<HR>
</BLOCKQUOTE>
<H4>Table C.1  Regular Expression Entries</H4>
<P>
<TABLE BORDER="1">
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT"><B>Entry</B></TD>
<TD ALIGN="LEFT"><B>Matches</B></TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">^</TD>
<TD ALIGN="LEFT">Start of the line.</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">$</TD>
<TD ALIGN="LEFT">End of the line.</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">.</TD>
<TD ALIGN="LEFT">Any single character.</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">[]</TD>
<TD ALIGN="LEFT">Any one of the characters within the brackets (usee for a range, ^ for "except").</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">\~</TD>
<TD ALIGN="LEFT">Anything except the character that follows next.</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">*</TD>
<TD ALIGN="LEFT">Zero or more of the next character.</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">+</TD>
<TD ALIGN="LEFT">One or more of the next character.</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">{ }</TD>
<TD ALIGN="LEFT">Doesn't match specially, but saves part of the match string to be used in the replacement
string. Up to nine portions can be tagged like this.</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">[]</TD>
<TD ALIGN="LEFT">Either of the characters within the [].</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">\:a</TD>
<TD ALIGN="LEFT">A single letter or number.</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">\:b</TD>
<TD ALIGN="LEFT">Whitespace (tabs or spaces).</TD>
</TR>
<TR ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT">\:c</TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -