Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Edit User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

6.3 Working with Text

6.3.1 Inserting Text at Current Location In Edit Control

To get the current selection in the control to replace the selected text or (if nothing is selected) to insert itself at the current caret location, use the following code:

Add a pCtrl->Clear() call right before the GetCaretPos() function so that any selected text will be removed before the new text is inserted.

6.3.2 Indenting Text

The only indention feature Objective Edit supports is AutoIndent, which allows the new line (when you hit the <Enter> key) to start with the same amount of white space as the previous line.

To enable this feature, call:

To disable it, call:

6.3.3 Line Highlighting

Objective Edit now provides a way to color highlight a line. Highlighting a line is very similar to adding a bookmark in that it acts by adding the data flag ID_SECEDIT_ITEMDATA_HIGHLIGHT to the line. You also need to define a color group for highlighting in the .ini file. Here is an example:

This color group only needs three lines:

  1. Foreground defines the foreground color of the highlighted line.

  2. Background defines the background color of the highlighted line.

  3. DisplayName has to be "Highlight" in order to be recognized by SECEditLangConfig.

A new command ID has been added for toggling the highlight flag: ID_SECEDIT_HIGHLIGHT_TOGGLE

6.3.4 Find and Replace

6.3.4.1 Regular Expressions

A regular expression is a pattern of text characters (such as the letters a through z, or special characters such as *) that describes a string to match when performing a search of text.

6.3.4.2 VBScript RegExp

Objective Edit's Find/Replace Dialog uses VBScript's Regular Expression (RegExp) object, which provides simple regular expression support.

In the function BOOL SECEditRegExp::Create(), the CreateDispatch(_T("VBScript.RegExp")) method serves as a connection to VBScript regular expressions. (In VBScript, the regular expression engine was implemented as a COM object so it could be called from sources outside VBScript.)

Search MSDN (http://msdn.microsoft.com/library/) for details on the VBScript RegExp object.


As discussed in Section 1.2.1.4, "HTML Output," Objective Edit depends on the Regex++ (regular expression) libraries. However, Regex++ is used for HTML output only--not the Find and Replace functionality.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.