Code Editor Toolbar

When you are reviewing the code for a part of your model in the Source Code editor, you can access a wide range of display and editing functions from the editor toolbar.

Code Editor Toolbar

SourceTool

Toolbar Options

Icon/Option

Action

See also

Structure Tree

Click on this icon to show or hide the element hierarchy panel (the left panel of the Source Code editor).

 

 

Line Numbers

Click on this icon to show or hide the line numbers against the lines of code.

 

 

Source Code Engineering Properties

Click on the drop-down arrow to display a menu of options to select individual Source Code Engineering pages of the Options dialog, from which you can configure display and behavior options for source code engineering:

Syntax Highlighting Options
Code Editor Options
Code Engineering Options
Code Editor Key Bindings

 

 

 

Editor Language Properties

Options - Code Editors

Source Code Options

Code Editor Key Bindings

Editor Functions

Click on the drop-down arrow to display a menu providing access to a range of code editing functions:

Open Corresponding File (Ctrl+Shift+O) - opens the header or implementation file associated with the currently-open file
Go to Matching Brace (Ctrl+E) - for a selected opening or closing brace, highlights the corresponding closing or opening brace in the pair
Go to Line (Ctrl+G) - displays a dialog on which you select the number of the line to highlight; click on the OK button to move the cursor to that line
Cursor History Previous (Ctrl+-) - the Source Code viewer keeps a history of the previous 50 cursor positions, creating a record when the cursor is moved either more than 10 lines away from its previous position, or in a find-and-replace operation; the menu option moves the cursor to the position in the immediately-previous cursor history record
Cursor History Next (Ctrl+Shift+-) - if you have moved to an earlier cursor  position, this option moves the cursor to the position in the immediately-following cursor history record
Find (Ctrl+F) - displays a dialog in which you define a text string and search options to locate that text string in the code
Replace (Ctrl+R) - displays a dialog in which you define a text string and search options to locate that text string in the code and replace it with another text string; the dialog has options to locate and replace each occurrence as you decide, or to replace all occurrences immediately
Record Macro - records your next keystrokes to be saved as a macro
Stop Recording and Save Macro - stops recording the keystrokes and displays the Save Macro dialog on which you specify a name for the macro
Play Macro - displays the Open Macro dialog from which you select and execute a saved macro, to repeat the saved keystrokes
Toggle Line Comment (Ctrl+Shift+C) - comments out (//) or re-establishes the code for each full line in which text is highlighted
Toggle Stream Comment (Ctrl+Shift+X) - inserts a stream comment (/* */) at the cursor position (comments out only the highlighted characters and lines), or re-establishes the commented text as code
Toggle Whitespace Characters (Ctrl+Shift+W) - shows or hides the spacing characters: --> (tab space) and . (character space)
Toggle EOL Characters (Ctrl+Shift+L) - shows or hides the end-of-line characters: CR (carriage return) and LF (line feed)
Open Containing Folder - opens the file browser at the folder containing the code file; you can open other files in your default external editor for comparison and parallel work
 

 

 

 

Save Source and Resynchronize Class

 

Click on this icon to save the source code and resynchronize the code and the Class in the model.

 

Code Templates

 

Click on this icon to access the Code Templates Editor, to edit or create code templates for code generation.

Code Templates Editor

Find in Project Browser

For a selected line of code, click on this icon to highlight the corresponding structure in the Project Browser. If there is more than one possibility the Possible Matches dialog displays, listing the occurrences of the structure from which you can select the required one.

 

 

Search in Files

Click on this icon to search for the selected object name in associated files, and display the results of the search in the File Search window. You can refine and refresh the search by specifying criteria on the Find in Files window toolbar.

 

Search in Files

Search in Model

Click on this icon to search for the selected text throughout the model, and display the results of the search in the Model Search window.

 

Model Search

Go to Declaration

 

Click on this icon to locate the declaration of a symbol in the source code.

 

Go to Definition

Click on this icon to locate the definition of a symbol in the source code (applicable to languages such as C++ and Delphi, where symbols are declared and defined in separate files).

 

 

Autocomplete List

Click on this icon to display the autocompletion list of possible values; double-click on a value to select it.

 

 

Parameter Information

When the cursor is between the parentheses of an operation's parameter list, click on this icon to display the operation's signature, highlighting the current parameter.

 

 

Find Current Class in Project Browser

Click on this icon to display the name of the currently-selected Class in the code, and highlight that name in the Project Browser; if there is more than one possibility the Possible Matches dialog displays, listing the occurrences of the Class from which you can select the required one.

 

 

Find Member

Click on this icon to display the name of the currently-selected attribute or method in the code, and highlight that name in the Project Browser; if there is more than one possibility the Possible Matches dialog displays, listing the occurrences of the feature from which you can select the required one.

 

 

Notes

The Record Macro option disables Intelli-sense while the macro is being recorded
You can assign key strokes to execute the macro, instead of using the toolbar drop-down and Open Macro dialog

 

Learn more