1 CAPI Reference Entries

pinboard-layout

Class

Summary

The classpinboard-layout provides two very useful pieces of functionality for displaying CAPI windows. Firstly it is a layout that allows its children to be positioned anywhere within itself (like a pinboard). Secondly it supportspinboard-objects which are rectangular areas within the layout which have size and drawing functionality.

Superclasses

output-pane
layout

Subclasses

simple-pinboard-layout

Description

When apinboard-layout lays out its children, it positions them at the x and y specified as hints (using:x and:y), and sizes them to their minimum size (which can be specified using:min-width and:max-width). The pinboard layout itself has a minimum size of one pixel by one pixel which is not affected by the size of its children. If you need the sizing capabilities, then use the classsimple-pinboard-layout which surrounds a single child, and adopts the size constraints of that child.

The pinboard layout handles the display of pinboard objects itself by calculating which objects are visible in the region that needs redrawing, and then by calling the generic functiondraw-pinboard-object on these objects in the order that they are specified in the layout description. This means that if two pinboard objects overlap, the later one in the layout description will be on top of the other one.

Example

Here is an example of a pinboard layout placing simple panes at arbitrary positions inside itself.

(capi:contain (make-instance
               'capi:pinboard-layout
               :description
               (list (make-instance
                      'capi:text-input-pane
                      :x 20
                      :y 100)
                     (make-instance
                      'capi:push-button-panel
                      :x 30
                      :y 200
                      :items '(1 2 3))))
                      :best-width 300 :best-height 300)

Here are some examples of the use of pinboard objects with pinboard layouts.

(capi:contain (make-instance
               'capi:pinboard-layout
               :description (list
                             (make-instance
                              'capi:image-pinboard-object
                              :image "new-lispworks-logo"
                              :x 20 :y 10)))
               :best-width 300 :best-height 300)

(capi:contain (make-instance 'capi:pinboard-layout :description (list (make-instance 'capi:item-pinboard-object :text "Hello" :x 40 :y 10) (make-instance 'capi:line-pinboard-object :x 10 :y 30 :min-width 100))) :best-width 200 :best-height 200)

Example File

capi/elements/pinboard.lisp

See Also

pinboard-object
redraw-pinboard-object


CAPI Reference Manual, Liquid Common Lisp Version 5.0 - 3 OCT 1997

Generated with Harlequin WebMaker