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

with-geometry Macro

Summary

Helps you to define layouts and create new pinboard-object subclasses.

Package

capi

Signature

with-geometry pane &body body => result*

Arguments
pane
body
Lisp forms.
Values
result*
Multiple values.
Description

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:

%x%
An integer specifying the x position of the pane in pixels relative to its parent.
%y%
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.
%height%
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:

%min-width%
A real number specifying the minimum width of the pane.
%min-height%
A real number specifying the minimum height of the pane.
%max-width%
A real number specifying the maximum width of the pane.
%max-height%
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).

%scroll-width%

The extent of the horizontal scroll range.

%scroll-height%

The extent of the vertical scroll range.

%scroll-horizontal-page-size%

The horizontal scroll page size.

%scroll-horizontal-slug-size%

The width of the scroll bar slug.

%scroll-horizontal-step-size%

The horizontal scroll step size.

%scroll-start-x%

The start of the horizontal scroll range.

%scroll-start-y%

The start of the vertical scroll range.

%scroll-vertical-page-size%

The vertical scroll page size.

%scroll-vertical-slug-size%

The height of the scroll bar slug.

%scroll-vertical-step-size%

The vertical scroll step size.

%scroll-x%
x coordinate of the current scroll position.
%scroll-y%
y coordinate of the current scroll position.

The following two variables access the object for which the representation is:

%object%
The object whose geometry this is.
%child%
The same as %object% (kept for compatibility with LispWorks 3.1).
See also

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 (Windows version) - 01 Dec 2021 19:33:57