Next Prev Up Top Contents Index

option-pane

Class
Summary

A pane which offers a choice of items, but which displays only the currently selected item.

Superclasses

choice
titled-object
simple-pane

Initargs

:enabled

Non- nil if the option pane is enabled.

:visible-items-count

An integer specifying the maximum length of the drop-down menu, or the symbol :default .

Accessors

option-pane-enabled
option-pane-visible-items-count

Description

The class option-pane provides a pane which offers a choice between a number of items via a drop-down menu. Only the currently selected item is displayed.

The class option-pane inherits from choice, and so has all of the standard choice behavior such as selection and callbacks. It also has an extra enabled slot along with an accessor which is used to enable and disable the option pane.

If visible-items-count is an integer then the drop-down menu is no longer than this, and is scrollable if there are more items.

If visible-items-count is :default , then the drop-down menu is no longer than 10. This is the default value.

Example

This example sets the selection and changes the enabled state of an option-pane :

(setq option-pane (capi:contain
                   (make-instance 'capi:option-pane
                                  :items '(1 2 3 4 5)
                                  :selected-item 3)
                   :process nil))
 
(setf (capi:choice-selected-item option-pane) 5)
 
(setf (capi:option-pane-enabled option-pane) nil)
 
(setf (capi:option-pane-enabled option-pane) t)

This example illustrates the use of visible-items-count :

(capi:contain
 (make-instance 'capi:option-pane
                :items 
                (loop for i below 20 collect i)
                :visible-items-count 6))

There is a further example in the file examples/capi/choice/option-pane.lisp .


LispWorks CAPI Reference Manual - 13 Mar 2003

Next Prev Up Top Contents Index