Helps you to define layouts and create new pinboard-object subclasses.
capi
with-geometry pane &body body => result*
pane⇩ |
A simple-pane or a pinboard-object. |
body⇩ |
Lisp forms. |
result* |
Multiple values. |
The macro with-geometry
is used for defining layouts and for creating new pinboard-object subclasses, by providing access to the geometry of a pane.
with-geometry
evaluates the forms in body as an implicit progn while binding the following variables to slots in the geometry of pane in much the same way as the Common Lisp macro with-slots. Except the special cases which are mentioned below, these variables are read-only and should not be set.
Four variables define the geometry of the pane. If you define define your own calculate-layout method, it can set these variables:
An integer specifying the x position of the pane in pixels relative to its parent. | |
An integer specifying the y position of the pane in pixels relative to its parent. | |
%width% |
An integer specifying the width in pixels of the pane. |
An integer specifying the height in pixels of the pane. |
Four variables specify constraints on the pane. If you define your own calculate-constraints method, it can set these variables:
A real number specifying the minimum width of the pane. | |
A real number specifying the minimum height of the pane. | |
A real number specifying the maximum width of the pane. | |
A real number specifying the maximum height of the pane. |
The following variables are also bound but apply only to instances of output-pane or layout which have at least one scroll bar. They can be retrieved by get-horizontal-scroll-parameters and get-vertical-scroll-parameters. They can be set by set-horizontal-scroll-parameters and set-vertical-scroll-parameters. These variables should be regarded as read-only inside with-geometry
(they are writable for backwards compatibility only).
The extent of the horizontal scroll range. | |
The extent of the vertical scroll range. | |
The horizontal scroll page size. | |
The width of the scroll bar slug. | |
The horizontal scroll step size. | |
The start of the horizontal scroll range. | |
The start of the vertical scroll range. | |
The vertical scroll page size. | |
The height of the scroll bar slug. | |
The vertical scroll step size. | |
x coordinate of the current scroll position. | |
y coordinate of the current scroll position. |
The following two variables access the object for which the representation is:
The object whose geometry this is. | |
The same as %object% (kept for compatibility with LispWorks 3.1). |
calculate-constraints
calculate-layout
convert-relative-position
element
get-horizontal-scroll-parameters
get-vertical-scroll-parameters
scroll
set-horizontal-scroll-parameters
set-vertical-scroll-parameters
3.8 Accessing pane geometry
6 Laying Out CAPI Panes
12 Creating Panes with Your Own Drawing and Input
CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42