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

pane-adjusted-position Generic Function

Summary

Calculates how to place a pane correctly within a layout, given a minimum and maximum position.

Package

capi

Signature

pane-adjusted-position pane adjust min-position max-position &key &allow-other-keys

Arguments
pane
A pane.
adjust
A keyword or a list of keyword and an integer.
min-position
An integer.
max-position
An integer.
Description

The generic function pane-adjusted-position calculates the position required by adjust so that the pane pane is placed correctly within the available space in its parent layout, between min-position and max-position. It is a complementary function to pane-adjusted-offset, and the default method actually calls pane-adjusted-offset with the gap between the two positions, and then adds on the minimum position to get the new position.

The default method accepts the following values for adjust.

:top
Place pane at the top of the region.
:bottom
Place pane at the bottom of the region.
:left
Place pane at the left of the region.
:right
Place pane at the right of the region.
:center
Place pane in the center of the region.
(:top n)
Place the top of pane n pixels below the top of the region.
(:bottom n)
Place the bottom of pane n pixels above the bottom of the region.
(:left n)
Place the left of pane n pixels after the left of the region.
(:right n)
Place the right of pane n pixels before the right of the region.
(:center n)
Place the center of pane n pixels below the center of the region.

However, new methods can accept alternative values for adjust where required and can also add extra keywords. For example, grid-layout allows adjust to be a list of adjust values, and then passes the offset into this list as an additional keyword. It is preferable to add new methods to pane-adjusted-offset as these changes will be seen by the default method of pane-adjusted-position.

Notes

pane-adjusted-position is deprecated.

Examples
(setq button-panel (make-instance 'capi:button-panel
                                  :items '(1 2 3)))
(capi:pane-adjusted-position button-panel
                             :center 100 200)
(capi:pane-adjusted-position button-panel
                             :right 100 200)
(capi:pane-adjusted-position button-panel
                             :left 100 200)
See also

layout
graph-pane
x-y-adjustable-layout


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42