광고
광고
26
Customizing the IDE
The CodeWarrior™ IDE enables you to customize menus, toolbars, and key bindings to suit your programming preferences. Use the Customize IDE Commands window— which consists of the Commands, Toolbar Items, and Key Bindings tabs—to build your customizations.
This chapter consists of these sections:
•
•
•
Customizing IDE Commands
You can customize the menu commands in the IDE’s menu bar, as well as control the appearance of specific menu commands, create new command groups to distinguish menu commands, and associate a command line (Windows, Solaris, and Linux) or a script or application (Mac OS) with a new menu command. The customized menu commands you create have access to IDE information, such as the current editor selection, the frontmost window, and the current project and its output file.
Select Edit > Commands & Key Bindings to access the Customize IDE Commands window.
shows the Customize IDE Commands window. Table 26.1
each button in the window. See the tasks in this chapter for more detailed information.
IDE 5.7 User’s Guide 333
Customizing the IDE
Customizing IDE Commands
Figure 26.1 Customize IDE Commands Window
Table 26.1 Customize IDE Commands Window Buttons
Button
New Group
New Command
Factory Settings
Revert
Export
Explanation
Click to add a new command group to the Commands list.
Click to add a new command setting within a group.
Click to restore default options for the current Customize IDE
Commands (Commands and Toolbar Items) lists.
Click to restore the most recently saved options for the current
Customize IDE Commands (Commands and Toolbar Items) lists.
Click to save a file that contains commands and key bindings to use later in the Customize IDE Commands lists.
334 IDE 5.7 User’s Guide
Customizing the IDE
Customizing IDE Commands
Table 26.1 Customize IDE Commands Window Buttons ( continued)
Button
Import
Save
Explanation
Click to open a file that contains commands and key bindings to use in the current Customize IDE Commands lists.
Click to save customizations to the Customize IDE Commands list.
Commands Tab
Click the Commands tab at the top of the Customize IDE Commands window to display the commands view. Use this view to modify existing menu commands, and to create and remove command groups and menu commands.
Modifying Existing Commands
You can use the Commands tab of the Customize IDE Commands window to examine and modify existing command groups and menu commands. This view includes a
Commands list. This hierarchical list organizes individual menu commands into command groups. Click the hierarchical control next to a command group to expand that group and view its contents.
To examine a particular item, select it in the Commands list. Information for the selected item appears on the right-hand side of the Customize IDE Commands window. This window provides this information for each selected item:
• Name—This field shows the name of the selected item. If the IDE does not permit you to change the name of the selected items, this field is grayed out.
• Appears in Menus—Enable this checkbox to display the selected item in the specified position in the CodeWarrior menu bar. For example, enabling this checkbox for a menu command allows that menu command to appear under the related command group in the menu bar. Disabling the checkbox prevents the menu command from appearing in the menu bar under the command group.
• Action—This section shows information about the action the selected item performs.
For default menu commands, this section shows the command type, such as
Command or Hierarchical Menu. For customized menu commands that you create, this section lets you specify a command line (Windows, Solaris, and Linux) or a script (Mac OS) that runs after you choose the customized menu command.
• Key Bindings—This area consists of the Key Bindings list, the New Binding button, and the Auto Repeat checkbox.
IDE 5.7 User’s Guide 335
Customizing the IDE
Customizing IDE Commands
Creating a New Command Group
To create a new command group for menu commands, follow these steps:
1. Click the New Group button.
The IDE creates a new command group called New Group, adds it to the Commands list, and displays its information in the Customize IDE Commands window.
2. Rename the new command group in the Name field.
3. Use the Appears in Menus checkbox to toggle the availability of the new command group in the IDE menu bar.
Select the Appears in Menus checkbox to display the new command group in the menu bar. Clear the checkbox if you do not want the command group to appear in the menu bar.
4. Click Save.
The IDE saves your new command group. If you selected the Appears in Menus checkbox, your new command group appears in the menu bar.
Creating a New Menu Command
To create a new menu command, follow these steps:
1. Select the command group you want to contain the new menu command.
You must select an existing command group in the Commands list.
2. Click the New Command button.
The IDE creates a new menu command named New Command and places it within the selected command group. The information for the new menu command appears in the Customize IDE Commands window.
3. Enter a name for the new menu command.
You can change the default name of New Command, as
shows. Enter a new name in the Name field of the Customize IDE Commands window.
4. Use the Appears in Menus checkbox to toggle the availability of the new command within its command group.
5. Define the desired Action for the new menu command.
6. Click Save.
The IDE saves your new menu command. If you enabled the Appears in Menus checkbox, the new menu command appears within the selected command group.
336 IDE 5.7 User’s Guide
Customizing the IDE
Customizing IDE Commands
Defining Command Actions (Windows)
shows Command Action fields, which let you associate an action with the new menu command:
Figure 26.2 Command Action Fields
• Execute—Enter in this field a command to run an application. Alternatively, click the ellipsis button next to the field to select the application using a standard dialog box.
• Arguments—Enter the arguments that the IDE must pass to the application specified in the Execute field. Alternatively, choose the desired arguments from the pop-up menu next to the field.
• Directory—Enter the working directory the IDE should use when it executes the application specified in the Execute field. Alternatively, choose the desired directory from the pop-up menu next to the field.
IDE 5.7 User’s Guide 337
Customizing the IDE
Customizing IDE Commands
Pre-Defined Variables in Command
Definitions
The IDE provides pre-defined variables for Windows, Solaris, and Linux (not Mac OS) to associate actions with commands. When you create a new command, you can use these pre-defined variables in command definitions to provide additional arguments that the
IDE passes to the application (which is specified in the Execute field).
NOTE
You can use variables that end with Dir as both argument and directory names.
shows a list of pre-defined argument variables;
defined directory variables.
Figure 26.3 Pre-Defined Argument Variables
338 IDE 5.7 User’s Guide
Figure 26.4 Pre-Defined Directory Variables
Customizing the IDE
Customizing IDE Commands
explains pre-defined variables for command-line arguments.
Table 26.2 Pre-Defined Variables in Command Definitions
Variable
%sourceFilePath
%sourceFileDir
%sourceFileName
%sourceLineNumber
%sourceSelection
%sourceSelUpdate
Command-line output
sourceFilePath is the frontmost editor window's full path.
sourceFileDir is the frontmost editor window's directory.
sourceFileName is the frontmost editor window's filename.
sourceLineNumber is the line number of the insertion point in the front window.
sourceSelection is the path to a temporary file containing the currently selected text.
sourceSelUpdate is like sourceSelection, except the IDE waits for the command to finish and updates the selected text with the contents of the file.
IDE 5.7 User’s Guide 339
Customizing the IDE
Customizing IDE Commands
Table 26.2 Pre-Defined Variables in Command Definitions ( continued)
Variable Command-line output
%projectFilePath
%projectFileDir
projectFilePath is the full path of the front project window.
projectFileDir is the directory of the front project window.
%projectFileName projectFileName is the filename of the front project window.
%projectSelectedFiles projectSelectedFiles passes the selected filenames in the project window.
%targetFilePath targetFilePath is the full path of the output file of the front project.
%targetFileDir targetFileDir is the directory of the output file of the front project.
%targetFileName
%currentTargetName
%symFilePath
%symFileDir
%symFileName
targetFileName is the filename of the output file of the front project.
currentTargetName passes the name of the current target of the frontmost window.
symFilePath is the full path to the symbolics file of the front project (can be the same as targetFile, such as CodeView).
symFileDir is the full directory to the symbolics file of the front project (can be the same as targetFile, such as CodeView)
symFileName is the full filename to the symbolics file of the front project (can be the same as targetFile, such as
CodeView)
340
Using a Pre-defined Variable
To use a pre-defined variable, follow these steps:
1. Create a new menu command.
The IDE creates a new menu command named New Command and places it within your selected command group. The information for the new menu command appears in the Customize IDE Commands window.
2. Enter a name for the new menu command.
3. Use the Appears in Menus checkbox to toggle the availability of the new command within its command group.
IDE 5.7 User’s Guide
Customizing the IDE
Customizing IDE Commands
4. Define the Action for the new menu command.
a. Enter in the Execute field a command line to run an application.
b. Next to the Arguments field, click on the arrow icon and select an argument listed in the pop-up menu.
c. Next to the Directory field, click on the arrow icon and select a directory listed in the pop-up menu.
5. Click Save.
The IDE saves your new menu command with the pre-defined variables. If you enabled the Appears in Menus checkbox, the new menu command appears within the selected command group.
Defining Command Actions (Mac OS)
After you create a new menu command, the Customize IDE Commands window shows the Run App/Script field. This field appears in the Action section of the window.
1. Click the Choose button next to the field to display a standard Open dialog box.
2. Use the dialog box to select an application or script.
The IDE launches this application or script each time you choose the menu command.
The path to the selected application or script appears in the Run App/Script field.
Deleting Command Groups and Menu Commands
You can delete the command groups and menu commands that you create for the IDE.
Once removed, the command groups no longer appear in the IDE’s menu bar, and the menu commands no longer activate their associated command lines (Windows), applications or scripts (Mac OS).
NOTE
If you need to temporarily remove your customized command groups and menu commands, consider exporting your settings. If you export your settings, you do not need to reconstruct them if you want them in the future.
To delete a command group or menu command, follow these steps:
1. Select the command group or menu command you wish to delete.
If necessary, click the hierarchical control next to a group to expand and view its contents.
IDE 5.7 User’s Guide 341
다운로드
광고