All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

NextPrevUpTopContentsIndex

rich-text-pane

Class
Summary

A text pane with extended formatting.

Package

capi

Superclasses

simple-pane

Initargs

:character-format

A plist.

:paragraph-format

A plist.

:change-callback

A function called when a change is made.

:protected-callback

A function determining whether the user may edit a protected part of the text, on Microsoft Windows.

:filename

A file to display.

:text

A string or nil.

:text-limit

An integer.

Accessors

rich-text-pane-change-callback
rich-text-pane-limit
rich-text-pane-text

Description

The class rich-text-pane provides a text editor which supports character and paragraph formatting of its text.

character-format is the default character format. It is a plist which is interpreted in the same way as the attributes-plist argument of set-rich-text-pane-character-format. The default value of character-format is nil.

paragraph-format is the default paragraph format. It is a plist which is interpreted in the same way as the attributes-plist argument of set-rich-text-pane-paragraph-format. The default value of paragraph-format is nil.

change-callback , if non-nil, is a function of two arguments: the pane itself, and a keyword denoting the type of change. This second argument is either :text or :selection. The default value of change-callback is nil.

protected-callback , if supplied, is called when the user tries to modify protected text. (Text is protected by setting the protected attribute, see set-rich-text-pane-character-format.) protected-callback must be a function of four arguments: the pane itself, bounding indexes of the protected text, and a boolean which is true when the change would affect the selection. If the change would affect just a single character, this last argument is nil. If protected-callback returns nil, then the change is not performed. If protected-callback is not supplied, then the user cannot modify protected text. protected-callback is supported only on Microsoft Windows.

filename , if non-nil, should be a string or pathname naming a file to display in the pane. filename takes precedence over text if both are non-nil.

text , if non-nil, should be a string which is displayed in the pane if filename is nil.

text-limit , if non-nil, should be an integer which is an upper bound for the length of text displayed in the pane.

Notes
  1. rich-text-pane is supported only on Microsoft Windows, and Cocoa in Mac OS X 10.3 and later. Some of its features are supported only on Microsoft Windows, as mentioned above.
  2. change-callback and protected-callback are not yet implemented on Cocoa.
  3. The functions that are specific to rich-text-pane cannot be called before the pane is created. If you need to perform operations on the pane before it appears, and which cannot be performed using the initargs, the best approach is to define an :after method on interface-display on the class of the interface containing the rich-text-pane, and perform the operations inside this method.
See also

print-rich-text-pane
rich-text-pane-character-format
rich-text-pane-operation
set-rich-text-pane-character-format
rich-text-pane-paragraph-format
set-rich-text-pane-paragraph-format
Displaying rich text


CAPI User Guide and Reference Manual (Macintosh version) - 25 Feb 2015

NextPrevUpTopContentsIndex