★ wanayoo — archive 1999 http://codeforge.com/help/Editor.htmlNouvelle recherche | Portail wanayoo

SMED Editor 

Overview

C-Forge includes a full featured programmer's editor (SMED - short for Smart Editor) which supports the following features:

Client/Server Design

SMED is based on a Client/Server architecture. The current version creates a single management process for all the user's Editor Windows. This architecture is extremely quick and efficient. The sharing of resources between editor buffers results in the decreased use of memory and greatly improves editor start-ups times.

Saving Files

To save a file you are working on, select Save in the File menu. SMED is set to automatically save files. When the interval in Auto Save Delay text-box of the custom resources dialog is not zero, the changes you make to a file are saved in a recovery file based on the Auto Save Delay interval.

Returning to Previous Versions

To return a file to one of the previous versions select Revert to File from the File menu. SMED shows Revert to File dialog that allows selection one of the following versions: Select the version that you need and press Revert button.

Context Highlighting

Context Highlighting uses color and font styles to distinguish different parts of a file you are working on. Comments, reserved words, symbols, constants and preprocessor directives are shown in different colors so the code is more readable. SMED supports three different modes of context highlighting: Context Highlighting is turned on/off by Language Context Outlining option in Custom Resources dialog. The type of highlighting is specified by Custom All option in the Fonts dialog.

To change the font of a context:

  1. Select Custom Resources from the Options menu.
    SMED shows Custom Resources dialog.
  2. Select the button Set Fonts.
    SMED shows Fonts dialog.
  3. Select one of the six context types.
  4. In the left part of the dialog change the parameters of the font.
  5. To save the formatting for the current editing session select Set Fonts. To save the formatting for all the editors of the display, select Set Fonts in All Editors button.
  6. Select Dismiss Dialog or Save Customization button in Custom Resources dialog.

Automatic Indentation

There are four indentation modes available.

The WysiWyg indentation mode described at the next two images.

Now, source is indented correctly:

But after inserting opening brace, ALL following source is reindenting accroding to the indentation rules.

Note, that at the same moment, following functions are trying to occupy the true position:

The indentation mode is specified in the formatting section of the Custom Resources dialog.

Bookmark System

Bookmarks are used to mark the lines in a file, so they can be found easily.

To bookmark the current line press Shift + Enter. Setting a bookmark changes the background color of the line. The bookmarks can be also loaded to the Editor Window from the Log-window, if Correct Error(s) or Edit file was selected in File menu of the Log-window.

Bookmarks are attached to the lines, not the line numbers, so they are unaffected by deletes or inserts of lines.

Selecting Show Bookmarks Pane in the Options menu or pressing Show Bookmarks Info button opens the section at the bottom of the editor window that displays all the bookmarks of the current file.

The left part of the bookmarks window display the list of all the bookmarks of the current text. The right part shows the line of the current bookmark or the information about the errors if this bookmark was loaded from the Log-window.

To retrieve some bookmark in the text, select it in the list of the bookmarks.

The Clear Selection button deletes the currently selected bookmark. You can also delete selected bookmark in the text by pressing Shift + Delete. To delete all bookmarks select Clear All Bookmarks button.

You can browse through the bookmarks using Previous Bookmark and Next Bookmark items of the Search menu (Ctrl + PgUp/PgDown keys).

Finding text

To find a text:
  1. Select Search from the Search menu of the editor window.
    SMED shows Search dialog.
  2. In the Search Text box, enter the text you want to search for.
  3. Specify search options.
  4. Click Find Next button.
    SMED will highlight the first matching of the text.

    If the text is not found, and you start finding text not from beginning of file, SMED will show the following message:

    Select Yes to start searching from the beginning/end of the text.
    Select No, Go Back to return to the position that was current when Find Dialog was risen.
    Select No to close the dialog.

  5. To find the next matching select Search/Replace Next in the Search menu.

Replacing text

To replace some text with another text:
  1. Select Replace from the Search menu of the editor window.

  2. SMED shows Replace dialog
  3. In the Search Text box, enter the text you want to search for.
  4. In the Replace Text box, enter the replacement text.
  5. Specify search options.
  6. Click Replace Next button.

  7. SMED will highlight the first matching of the text and prompt you to confirm the replacement.
  8. If the text is not found, SMED will show the message similar to the message for the Find dialog.
  9. To find the next matching select Search/Replace Next in the Search menu.
  10. To replace all the matching select Replace All button.

Working with SymbolNavigator

Symbol Navigator allows symbol browsing within the confines of the module currently loaded into the editor and its includes. It allows you also to see the definition of symbols in context and to get the list of all the lines that include a certain symbol.

Working with the Symbol Navigator you should remember that a highlighted area is loaded to the Navigator. If nothing is highlighted, then the symbol you click on or the current symbol is loaded to the navigator.

To pop up the Symbol Navigator select Popup Symbol Navigator from the Tools menu, or click with the right mouse button on the text and select Popup Symbol Navigator in the pop-up menu.

To find a symbol definition select Show Symbol from the Tools menu or popup menu.

To see the definition in context select Show Symbol in Context from the Tools menu. In this case the part of the text that includes the definition of the selected symbol will be displayed in the Editor Window.

You can use internal Symbol Navigator to browse the symbols.

To view the definitions of two different symbols:

  1. Highlight the symbol in the text and select Show Symbol from the Tools menu to get its definition.
  2. Select Clone from the File menu to open the clone copy of the Symbol Navigator.
  3. Enter the another symbol to the Symbol: text-field of the SymbolNavigator and press Enter.
  4. You can walk through history of symbols using buttons with left & right arrows.

Drag'n'Scroll

Using the scroll-bars for the large files is not very effective because even a slight movement of the scroll box causes the considerable scrolling. So, in addition to regular scroll-bar SMED supports two Drag'n'Scroll modes that allow to grab the editor window and scroll text in the direction indicated by the current mouse position.

Accelerated scrolling is activated by using Ctrl+Shift and the middle mouse button. This action scrolls the screen continuously at the speed determined by the current distance and direction of the mouse pointer, relative to the center of the editor window.

UnAccelerrated scrolling is activated by using Shift and the middle mouse button. The screen is scrolled in the direction determined by the mouse pointer movement.

Block Selection

SMED supports two modes of block selection, line and rectangular. By default blocking is performed on a line-by-line basis. However, text can be selected as a rectangular block by pressing the Ctrl key and holding the left mouse button to regulate the size of the rectangle desired.

You can cut, copy, paste and move rectangular blocks the same way you work with regular blocks. You can paste a regular block as a rectangular block using Ctrl and middle mouse button.

Integration with the IDE

SMED is completely integrated with the IDE. Module and target build actions are available in the Actions menu and through accelerators. Errors generated by the build procedures are highlighted in red and appear as specialized bookmarks in the bookmark panel of the editor window.

Views

It is possible to split the editor window into multiple synchronized views of the same file. In this fashion two different parts of the file can be viewed at the same time.

 

To split the Editor Window select Split Current View from the View menu or press Split Current View button.

To withdraw the current view select Remove Current View from the File menu. Selecting Make One View button removes all the views except one.

Interactive Configuration

You can specify a number of SMED options in the Custom Resources dialog. To open it, select Custom Resources from the Options menu.

In addition, toolbar and status line can also be disabled from Options menu.

The editor window geometry is saved automatically.

Macro Record/Playback

To save a sequence of keystrokes as a macro:

1. Select the Macro from the Edit menu in the Editor Window.
SMED shows Editing Macros dialog.

2. Select Start Record button and perform a sequence of actions using the keyboard.
    Red flashing R letter at the status bar of the Editor window indicates the recording mode.

3. To stop recording, press Stop button at the status bar of the Editor window.
    SMED shows Name&Accelerator dialog.

4. Enter the name of a macro and its accelerator, then press OK button.

To run a macro, select its name from the Edit menu in the Editor Window or select the macro in the  Editing Macros dialog and press Execute Macro button.

 


Last modified: Thursday, 30-Sep-1999 01:43:55 MDT