📄 c-customize3.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> Customization </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-customize.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-customize2.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-customize4.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="88676">9.3 Customizing the Tools Menu</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="88677"> </a>You can add entries to the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu to allow easy access to additional tools. Before you add any commands in this part of the menu, Tornado displays the placeholder <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">No Custom Tools</font></b> as a disabled menu entry. The <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Customize</font></b> command in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu allows you to add (or remove) entries at the end of the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu. </p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H3"><i><a name="85841">9.3.1 The Customize Tools Dialog Box</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84503"> </a>Click <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Customize</font></b> in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu to open the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Customize Tools</font></b> dialog box (<a href="c-customize3.html#84516">Figure 9-11</a>).<div class="frame"><h4 class="EntityTitle"><a name="84516"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 9-11: Customize Tools Dialog Box</font></a></h4><dl class="margin"><div class="Anchor"><a name="84513"> </a><img class="figure" border="0" src="images/c-customize7.gif"></div></dl></div></p><dd><p class="Body"><a name="84517"> </a>The <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Menu Contents</font></b> list box in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Customize Tools</font></b> dialog box shows all custom commands currently in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu. When you select any item in this list, you can edit its attributes in the three text boxes near the bottom of the dialog box.</p><dd><p class="Body"><a name="86046"> </a>The <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Customize Tools</font></b> dialog box has the following buttons:</p></dl><dl class="margin"><dd><div class="Item"><a name="84521"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Add</font></b></div><dl class="margin"><dd><div class="Indent"><a name="85038"> </a>Activates the list and check boxes at the bottom of the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Customize Tools</font></b> dialog box and enters <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">New Tool</font></b> in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Menu Text</font></b> list box. Replace <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">New Tool</font></b> with the command description; when you click <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">OK</font></b>, the new menu item appears in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu. </div><br></dl><dd><div class="Item"><a name="84522"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Remove</font></b> </div><dl class="margin"><dd><div class="Indent"><a name="85040"> </a>Deletes the selected menu item from the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu. </div><br></dl><dd><div class="Item"><a name="84523"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Move Up</font></b> </div><dl class="margin"><dd><div class="Indent"><a name="85042"> </a>Moves the selected menu item up one line in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Menu Contents</font></b> list box and changes the displayed order on the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu.</div><br></dl><dd><div class="Item"><a name="84524"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Move Down</font></b> </div><dl class="margin"><dd><div class="Indent"><a name="85044"> </a>Moves the selected menu item down one line in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Menu Contents</font></b> list box and changes the displayed order on the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu.</div><br></dl><dd><div class="Item"><a name="84525"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">OK</font></b></div><dl class="margin"><dd><div class="Indent"><a name="85048"> </a>Applies your changes to the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu.</div><br></dl><dd><div class="Item"><a name="84526"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Cancel</font></b></div><dl class="margin"><dd><div class="Indent"><a name="85046"> </a>Discards your changes without modifying the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu.</div><br></dl></dl><dl class="margin"><dd><p class="Body"><a name="84527"> </a>The three text boxes near the bottom of the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Customize Tools</font></b> dialog box allow you to specify or change the attributes of a custom command.</p></dl><dl class="margin"><dd><div class="Item"><a name="84528"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Menu Text</font></b> </div><dl class="margin"><dd><div class="Indent"><a name="85050"> </a>Contains the name of the custom command, as it appears in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tools</font></b> menu.</div><br></dl><dd><div class="Item"><a name="84529"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tool Command</font></b> </div><dl class="margin"><dd><div class="Indent"><a name="85053"> </a>Specifies the instructions to execute your command. You can place anything here that you could execute at the command prompt or in a batch file. Click the button at the right of the box to see a pop-up menu including a browse option and a list of macros which allow you to capture Tornado context in your commands. See <a href="c-customize3.html#85848"><i class="title">Macros for Customized Menu Commands</i></a> for explanations of these macros. </div><br></dl><dd><div class="Item"><a name="84536"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Working Directory</font></b> </div><dl class="margin"><dd><div class="Indent"><a name="85055"> </a>Use this field to specify where (in what directory) to run the custom command. You can edit the directory name in place, or click the button at the right of this field to bring up a menu similar to the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Tool Command</font></b> menu. It includes a directory browser where you can search for the right directory and the same list of macros. To use the Tornado working directory, leave this field blank.</div><br></dl></dl><dl class="margin"><dd><p class="Body"><a name="84552"> </a>At the bottom of the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Customize Tools</font></b> dialog box are the following check boxes:</p><dl class="margin"><b class="BulletHead"><li><a name="84553"> </a><font face="Helvetica, sans-serif" size="-1" class="sans"><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Prompt for Arguments</font></b></font></li></b></dl><dl class="margin"><dd><div class="Indent"><a name="84554"> </a>When this box is checked, Tornado prompts for command arguments using a dialog box, when you click the new command. The command line is displayed in a window where you can add additional information. (See <a href="c-customize3.html#86067">Figure 9-12</a>.)</div><br></dl><dd><p class="Body"><a name="89258"> </a><div class="frame"><h4 class="EntityTitle"><a name="86067"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 9-12: Command Line Arguments Dialog Box</font></a></h4><dl class="margin"><div class="Anchor"><a name="86069"> </a><img class="figure" border="0" src="images/c-customizea1.gif"></div></dl></div></p><dl class="margin"><b class="BulletHead"><li><a name="87530"> </a><font face="Helvetica, sans-serif" size="-1" class="sans"><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Redirect to Child Window</font></b></font></li></b></dl><dl class="margin"><dd><div class="Indent"><a name="87531"> </a>When this box is checked, Tornado redirects the output of your command to a child window--a window contained within the Tornado application window. Otherwise, the command runs independently, either as a console application or a Windows application.</div><br></dl><dl class="margin"><b class="BulletHead"><li><a name="84555"> </a><font face="Helvetica, sans-serif" size="-1" class="sans"><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Close Window On Exit</font></b></font></li></b></dl><dl class="margin"><dd><div class="Indent"><a name="84556"> </a>When this box is checked, Tornado closes the window associated with your tool when the command is done. This only applies when you also check the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Redirect to Child Window</font></b><b> </b>box to redirect command output to a child window.</div><br></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="85848">Macros for Customized Menu Commands</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85851"> </a>The pop-up menu opened by the buttons to the right of the text boxes provides several macros for your use in custom menu commands. These macros allow you to write custom commands that are sensitive to the context in the editor, or to the global Tornado context. For example, there are macros for the full path of the file in the active editor window, and for useful fragments of that file's name. <a href="c-customize3.html#86220">Table 9-3</a> lists macros for editor context; in this table, the phrase <i class="term">active file</i> refers to the file that is open in the active editor window (or selected in the project facility if no editor window is open). <p class="table"><h4 class="EntityTitle"><a name="86220"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 9-3: Menu-Customization Macros for Editor Context</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="86281"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Menu Entry</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="86226"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Macro</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="86228"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Description</font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="86230"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Example</font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86283"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">File path</font></b> </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86232"> </a><b>$filepath</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86234"> </a>Full path to the active file.</div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86236"> </a><b class="file">c:\tornado\zap.c</b></div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86285"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Dir name</font></b> </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86238"> </a><b>$filedir</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86240"> </a>Directory containing the active file.</div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86243"> </a><b class="file">c:\tornado </b></div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86287"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">File nam</font></b>e </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86245"> </a><b>$filename</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86247"> </a>Name of the active file, without path information.</div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86249"> </a><b class="file">zap.c</b></div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="86289"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Base name</font></b> </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86251"> </a><b>$basename</b></div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86253"> </a>Name of the active file, without the file extension.</div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="86255"> </a><b class="file">zap </b></div></td><td width="10"> </td></tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -