| Graph Formatting | Contents | Index | Text Formatting |
19 Bordered Output
CLIM provides a mechanism for surrounding arbitrary output with some kind of a
border. The programmer annotates some output-generating code with an advisory
macro that describes the type of border to be drawn. The following code
produces the output shown in Figure 19.1 .
For example, the following produces three pieces of output, surrounded by a rectangular, highlighted with a dropshadow, and underlined, respectively.
(defun border-test (stream)
(fresh-line stream)
(surrounding-output-with-border (stream :shape :rectangle)
(format stream "This is some output with a rectangular border"))
(terpri stream) (terpri stream)
(surrounding-output-with-border (stream :shape :drop-shadow)
(format stream "This has a drop-shadow under it"))
(terpri stream) (terpri stream)
(surrounding-output-with-border (stream :shape :underline)
(format stream "And this output is underlined")))

| surrounding-output-with-border | (&optional stream &rest drawing-options &key shape (move-cursor t )) &body body | [Macro] |
If the boolean move-cursor is true (the default), then the text cursor will be moved so that it immediately follows the lower right corner of the bordered output.
stream is an output recording stream to which output will be done. The stream argument is not evaluated, and must be a symbol that is bound to a stream. If stream is t (the default), *standard-output* is used. body may have zero or more declarations as its first forms.
There are several strategies for implementing borders. One strategy is to create a ``border output record'' that contains the output records produced by the output of body , plus one or more output records that represent the border. Another strategy might be to arrange to call the border drawer at the approriate times without explicitly recording it.
| define-border-type | shape arglist &body body | [Macro] |
arglist may include other keyword arguments that serve as the drawing options.
body is the code that actually draws the border. It has lexical access to
stream , record , left , top , right , and bottom ,
which are respectively, the stream being drawn on, the output record being
surrounded, and the coordinates of the left, top, right, and bottom edges of the
bounding rectangle of the record. body may have zero or more declarations
as its first forms.
| Graph Formatting | Contents | Index | Text Formatting |