rich-edit-range

Generic Function

Package: common-graphics

Arguments: text-edit-pane &key (format :rich-text) (start 0) (end most-positive-fixnum) (return-crlf t)

This function returns a string for window (identified by text-edit-pane) from character position start to end. If start and end are not supplied, the entire contents are returned. If format is :rich-text (the default), then a rich-text string is returned. If it is :text, then a plain-text string is returned.

If end is not greater than start, then an empty string is returned. If format is :rich-text, this empty string is a special two-character string consisting of an open curly brace followed by a close curly brace. Otherwise it is the usual zero-length null string. The special empty string for rich text is the value of *empty-rtf-string*, and is used because it works as a valid rich text string with the rich-edit-control, while the standard lisp null string does not.

If return-crlf is true (the default), any line breaks in the control will be represented by CR/LF's (a carriage return character followed by a linefeed character) in the string that is returned. If return-crlf is nil, then the returned string will contain single LF's instead. The trade-off is that single LF's are the newline convention in Allegro, but the Windows multi-line text editing control (used in CG for both rich-edit-pane and text-edit-pane windows) internally uses CR/LF's. Returning CR/LF's may be necessary if your application requires that character positions in a string obtained from a text control need to match the internal positions used by functions such as get-selection and set-selection.

The setf function sets the text in window from start to end to be string. If start and end are not specified, the entire contents of window are replaced. If format is :rich-text (the default), then string should be a rich-text string, which will be inserted using its own formatting. If it is :text, then string should be a plain-text string, which will be inserted using the formatting at the current position of the text-edit-pane.

When format is :rich-text, string may be the value of *empty-rtf-string* to indicate a rich text string with no contents.

See also rich-edit-selected-range and its setf.

See About Rich Text Editing in Common Graphics in cgide.htm.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.