The class titled-object
is a mixin class which provides support for decorating a pane with a title (a piece of text positioned next to the pane) and with a message (a piece of text below the pane).
interface
layout
title-pane
display-pane
text-input-pane
toolbar
button-panel
list-panel
option-pane
progress-bar
output-pane
slider
A title string for the pane (or nil
).
Initargs to the title make-instance
.
The font used for the title.
How to adjust the title relative to the pane.
The gap between the title and the pane.
A message string for the pane (or nil
).
A string specifying the title and a mnemonic. Applies only to the subclasses specified below.
titled-object-title
titled-object-title-font
titled-object-message
titled-object-message-font
The titled pane makes its title decoration from a title-pane and the message decoration from a message-pane.
The
text
of the title-pane is passed via the titled-object
initarg
title
and the
text
of the message-pane is passed via the titled-object
initarg
message
.
The initargs and font for the title-pane are passed via the titled-object
initargs
title-args
and
title-font
respectively.
title-gap specifies the size in pixels of the gap between the title and the pane. The default value of title-gap is 3.
For subclasses other than interface, the font used for the message can be found by titled-object-message-font and set by (setf titled-object-message-font).
message-gap specifies the size in pixels of the gap between the message and the pane. The default value of message-gap is 3.
The message is always placed below the pane, but the title's position can be adjusted by specifying
title-position
which can be any of the following.
Place the title to the left of the pane.
Place the title to the right of the pane.
Place the title above the pane.
Place the title below the pane.
Place the title in a frame (like a groupbox) around the pane.
The
title-adjust
slot is used to adjust the title so that it is left justified, right justified or centered. The value of
title-adjust
can be any of the values accepted by the function pane-adjusted-offset, which are :left
, :right
, :top
, :bottom
, :center
and :centre
.
Note: title-adjust cannot handle both x and y. It is designed for cases like this:
(capi:contain
(make-instance 'capi:list-panel
:items '(1 2 3 4 5)
:title "Temp"
:title-position :left
:title-adjust :center
:title-args
'(:visible-min-width (:character 12))))
mnemonic-title offers an alternate way to provide the pane's title, and with a mnemonic. It takes effect only for button-panel, list-panel, list-view, option-pane, output-pane, progress-bar, scroll-bar, slider, text-input-pane, text-input-range, tree-view and their subclasses, and is interpreted as described for menu.
Note: titles and mnemonic titles can now be added in a grid-layout.
titled-object
corresponds to the LispWorks 4.1 class titled-pane
. For backwards compatibility the accessors titled-pane-title
and titled-pane-message
, including setf methods, are provided. These simply trampoline to titled-object-title
and titled-object-message
, and may not be supported in future releases.
Try each of these examples to see some of the effects that titled panes can produce. Note that text-input-pane is a subclass of titled-object
, and that it has a default
title-position
of
:left
.
(capi:contain (make-instance 'capi:text-input-pane))
(capi:contain (make-instance 'capi:text-input-pane
:title "Enter some text:"))
(capi:contain (make-instance
'capi:text-input-pane
:title "Enter some text:"
:title-position :top))
(capi:contain (make-instance 'capi:text-input-pane
:title "Enter some text:"
:title-position :top
:title-adjust :center))
(capi:contain (make-instance 'capi:text-input-pane
:title "Enter some text:"
:title-position :top
:title-adjust :right))
(capi:contain (make-instance 'capi:text-input-pane
:message "A message"))
(capi:contain (make-instance 'capi:text-input-pane
:message "A message"
:title "Enter some text:"))
(capi:contain (make-instance 'capi:text-input-pane
:title "Enter some text:"
:title-args
'(:foreground :red)))
CAPI User Guide and Reference Manual (Windows version) - 25 Feb 2015