A keyword specifying the operation to perform.
The value or values to use, when the operation is setting something.
The valid values of operation on Microsoft Windows and Cocoa are:
result
is a boolean indicating whether it is currently possible to perform a :paste
, :cut
or :copy
operation.
Performs the indicated operation.
Selects all the text.
args should be two integers start and end . Sets the selection to the region bounded by start (inclusive) and end (exclusive).
Returns as multiple values the bounding indexes of the selection. result is the start (inclusive) and result2 is the end (exclusive). If there is no selection, both values are the index of the insertion point.
result
is a boolean indicating whether it is currently possible to perform an :undo
or :redo
operation.
Undoes the last editing operation. Note that, after typing, it is the whole input, rather than a single character, that is undone. The :undo
operation may be repeated successively, to undo previous editing operations in turn.
Note:
with RichEdit 1.0, :undo
does not work repeatedly - it only undoes one previous editing operation. See rich-text-version
Undoes the effect of the last :undo
operation. The :redo
operation may be repeated successively, to cancel the effect of previous :undo
operations in turn.
Note:
with RichEdit 1.0, :redo
does not work. See rich-text-version.
result
is the value of a boolean modified flag. This flag can be set by the :set-modified
operation. Also, editing the text sets it to true.
Sets the modified flag. The argument is a boolean.
Saves the text to a file. Details below.
Loads the text from a file. Details below.
Additionally these values of operation are valid on Microsoft Windows, only:
Returns a value indicating the word wrap, which can be the keyword :none
.
result
can also be the keyword :window
or a CAPI printer object, meaning that the text wraps according to the width of the window or the printer.
Sets the word wrap. The argument can be as described for :get-word-wrap
, and additionally it can be the keyword :printer
, meaning the current-printer.
Specifies whether the selection should be hidden (not highlighted) when pane does not have the focus. The argument is a boolean.
For operations :save-file
and :load-file
,
args
is a lambda list
filename
&key
selection
format
plain-text
filename is the file to save or load.
selection
is a boolean, with default value nil
.
format
is nil
or a keyword naming the file format. Values include :rtf
and :text
meaning Rich Text Format and text file respectively.
plain-text
is a boolean, with default value nil
.
With
operation
:save-file
, if
selection
is true, only the current selection is saved. If
selection
is nil
, all the text is saved. The default value of
format
is :rtf
and there are two further allowed values, :rtfnoobjs
and :textized
. These are like :rtf
and :text
except in the way they deal with COM objects. See the documentation for SF_RTFNOOBJS and SF_TEXTIZED in the EM_STREAMOUT entry in the MSDN for details. When saving with
format
:rtf
or :rtfnoobjs
, if
plain-text
is true, then keywords that are not common to all languages are ignored. With other values of
format
,
plain-text
has no effect.
With
operation
:load-file
, if
selection
is true, the unselected text is preserved. If there is a selection, the new text replaces it. If there is no selection, the new text is inserted at the current insertion point. If
selection
is nil
, all the text is replaced. The default value of
format
is nil
, meaning that the RTF signature is relied upon to indicate a Rich Text Format file. If
plain-text
is true, then keywords that are not common to all languages are ignored.
(setq rtp
(capi:contain
(make-instance
'capi:rich-text-pane
:text (format nil "First paragraph.~%Second paragraph, a little longer.~%Another paragraph, which should be long long enough that it spans more than one line. ~%" ))))
Set the selection to characters 9 to 18:
(capi:rich-text-pane-operation rtp :set-selection 9 18)
Write all the text to a file in text format:
(capi:rich-text-pane-operation
rtp :save-file "mydoc.txt" :format :text)
(capi:rich-text-pane-operation rtp :paste)
CAPI User Guide and Reference Manual (Windows version) - 3 Aug 2017