NextPrevUpTopContentsIndex

simple-pane

Class
Summary

The class simple-pane is the superclass for any elements that actually appear as a native window, and is itself an empty window.

Package

capi

Superclasses

element

Subclasses

display-pane
interface
title-pane
button-panel
list-panel
option-pane
output-pane
progress-bar
slider
text-input-pane
tree-view
toolbar
layout
button

Initargs

:enabled

A boolean controlling whether the pane is enabled.

:background

The background color of the pane.

:foreground

The foreground color of the pane.

:font

The default font for the pane.

:horizontal-scroll

t , :without-bar , or nil . If true the pane can scroll horizontally.

:vertical-scroll

t , :without-bar , or nil . If true the pane can scroll vertically.

:visible-border

A boolean or a keyword controlling whether the pane has a border, for some pane classes.

:internal-border

A non-negative integer, or nil . Controls the width of the internal border.

:cursor

A keyword naming a built-in cursor, or a cursor object, or nil .

:pane-menu

Specifies a menu to be raised by the :post-menu gesture.

:drop-callback

Specifies a drop callback for output-pane or interface.

Accessors

simple-pane-enabled
simple-pane-background
simple-pane-foreground
simple-pane-font
simple-pane-cursor
simple-pane-scroll-callback
simple-pane-drop-callback

Readers

simple-pane-horizontal-scroll
simple-pane-vertical-scroll
simple-pane-visible-border

Description

enabled determines whether the pane is enabled. The default value is t . Note that changing the enabled state of a visible pane changes its appearance.

background and foreground are colors specified using the Graphics Ports color system. Additionally on Cocoa, the special value :transparent is supported, which makes the pane's background match that of its parent.

font should be font, a font description, or nil .

The value for visible-border can be any of the following, with the stated meanings where applicable:

nil

Has no border.

t

Has a border.

:default

Use the default for the window type.

:outline

Add an outline border.

There are various platform/pane class combinations which do not respond to all values of visible-border . For instance, on Windows XP with the default theme, text-input-choice and option-pane always have a visible border regardless of the value of visible-border , while other classes including display-pane , text-input-pane , list-panel , editor-pane and graph-pane have three distinct border styles, with visible-border :default meaning the same as visible-border t .

If internal-border is non- nil , it should be a non-negative integer specifying the width of an empty region around the edge of the pane.

Any simple pane can be made scrollable by specifying t to :horizontal-scroll or :vertical-scroll . By default these values are nil , but some subclasses of simple-pane default them to t where appropriate (for instance editor-pane s always default to having a vertical scroll-bar).

For a pane which is scrollable but does not display a scroll bar, pass the value :without-bar for :horizontal-scroll or :vertical-scroll . See the example in output-panes/scrolling-without-bar.lisp .

The height and width of a scrollable simple pane can be specified by the initargs :scroll-height and :scroll-width , which have the same meaning as :internal-min-height and :internal-min-width . See the LispWorks CAPI User Guide for more information about height and width initargs.

cursor specifies a cursor for the pane. nil means use the default cursor, and this is the default value. cursor can also be a cursor object as returned by load-cursor. The other allowed values are keywords naming built-in cursors which are supported on each platform as shown in the table below.

 

 

cursor

Cocoa

Windows

Motif

:busy

No

Yes

Yes

:i-beam

Yes

Yes

Yes

:top-left-arrow

Yes

Yes

Yes

:h-double-arrow

Yes

Yes

Yes

:v-double-arrow

Yes

Yes

Yes

:left-side

Yes

Yes

Yes

:right-side

Yes

Yes

Yes

:top-side

Yes

Yes

Yes

:bottom-side

Yes

Yes

Yes

:wait

No

Yes

Yes

:crosshair

Yes

Yes

Yes

:gc-notification

No

Yes

Yes

:top-left-corner

No

Yes

Yes

:top-right-corner

No

Yes

Yes

:bottom-left-corner

No

Yes

Yes

:bottom-right-corner

No

Yes

Yes

:hand

Yes

Yes

Yes

:fleur

Yes

Yes

Yes

:move

Yes

Yes

Yes

:closed-hand

Yes

No

No

:open-hand

Yes

No

No

:disappearing-item

Yes

No

No

Note: On Cocoa in Mac OS X 10.2, only :i-beam is supported.

pane-menu can be used to specify or create a menu to be displayed when the :post-menu gesture is received by the pane. It has the default value :default which means that make-pane-popup-menu is called to create the menu. For a full description of pane-menu , see the section "Popup menus for panes" in the LispWorks CAPI User Guide .

drop-callback can be specified for a pane that is an instance of output-pane, interface or a subclass of one of these. When the user drags an object over a window, the CAPI first tries to call the drop-callback of any output-pane under the mouse and otherwise calls the drop-callback of the top-level interface. The default value of drop-callback is nil , which means that there is no support for dropping into the pane.

For editor-pane, drop-callback can be :default , which provides support for dropping a string into the pane and inserting the string into the pane's editor buffer.

If drop-callback is any other non- nil value, it should be a function designator with this signature:

drop-callback pane drop-object stage

The function drop-callback is called by the CAPI at various times such as when the pane is displayed and when the user attempts to drop data into the pane. pane is the pane itself, drop-object is an object used to communicate information about the current dropping operation (see below) and stage is a keyword. drop-callback should handle these values of stage :

:formats

This might occur when the pane is being displayed or might occur each time the user drags or drops an object over the pane. It should call SET-DROP-OBJECT-SUPPORTED-FORMATS with the drop-object and a list of formats that the pane wants to receive. Each format is a keyword. The list of the formats must be the same each time it is called.

:enter

This occurs when the user drags an object over the pane. It can query the drop-object using drop-object-provides-format and drop-object-allows-drop-effect-p to discover what the user is dragging. It can also use drop-object-pane-x and drop-object-pane-y to query the mouse position relative to the pane. It should call (setf drop-object-drop-effect) with an effect if it wants to allow the object to be dropped. If this is not called, then the object cannot be dropped into the pane.

:drag

This occurs when the user continues to drag an object over the pane. It should behave as for stage :enter and should call (setf drop-object-drop-effect) if it wants to allow the object to be dropped. It might also want to update the pane to indicate where the object will be dropped.

:drop

This occurs when the user drops an object over the pane. It can query the drop-object as for :enter but can also obtain the object itself using drop-object-get-object for one of the formats in the list returned by drop-object-provides-format. Once the object is received, it should call (setf drop-object-drop-effect) with the effect that has been used by the callback.

In order to display a simple pane, it needs to be contained within an interface. The two convenience functions make-container and contain are provided to create an interface with enough support for that pane. The function make-container just returns a container for an element, and the function contain displays an interface created for the pane using make-container.

Examples
(capi:contain (make-instance 'capi:output-pane
                  :background :red
                  :scroll-width 300
                  :horizontal-scroll t))
 
(setf ep
      (capi:contain
       (make-instance 'capi:editor-pane
                      :visible-border t)))
 
(setf (capi:simple-pane-cursor ep) :crosshair)
See also

contain


LispWorks CAPI Reference Manual - 17 Mar 2008

NextPrevUpTopContentsIndex