combo-box

Class

Package: common-graphics

Class

The class of the combo-box control

Control

Instance of the combo-box class. This control is similar to pop-up-menu except that it can be operated from the keyboard using the arrow keys.

Adding a combo-box control to your form

Click the combo-box tool on the Component toolbar. Move the mouse cursor to the part of the form where you want to place the control, and click again. The control will appear with colored resizing handles.

Resizing and moving the control

Controls can only be resized and moved on forms during the design stage; the size and location of everything is fixed on a running form.

Resize the control by clicking the mouse cursor and dragging one of the handles to the new size-point. Release the mouse key when you are satisfied with the new size. Note: resizing the combo-box means horizontal resizing only. Changing the size of the combo-box won't mean proportional changes in the size of the characters inside the box. Change the font property if you want to change the size of the actual characters displayed.

Move the control by clicking anywhere on it except a resizing handle and dragging it to a new location on the form. Release the mouse key when you are ready to place the control.

Customizing combo-box behavior

Allowing users to type directly in the box instead of pulling down and selecting a value, set the value of the typable property. If it is specified non-nil, users may type a new value directly into the edit-box of a combo-box rather than being forced to select a value from the drop-down list.

Displaying all the box values either all at once or one at a time

The dropping property is no longer supported. (It was supposed to control whether all values of the combo-box were always displayed or not.)

Dropping and undropping (opening and closing) programmatically

A combo box created with dropping t can be dropped (opened) and undropped (closed) programmatically. See drop-combo-box and undrop-combo-box.

Scrollbars

Combo-box controls cannot have a horizontal scrollbar, so the valid choices are :vertical and nil for the scrollbars property. If a horizontal scrollbar is needed on a combo-box, an outline control could be used instead, using only top-level items in the range and turning off the draw-icons property to simulate a combo-box.

Creating an instance of a combo-box control

This call to make-instance returns an instance of a combo-box. Properties can be initialization keyword arguments (the keyword has the same name as the property, with a prepended colon, e.g. :width). Additional arguments could be provided. Their absence indicates the default value will be used.

(make-instance 'combo-box
               :font
                (make-font-ex nil "MS Sans Serif" 11 nil)
               :left 238
               :name :combo-box-1
               :range '(:one :two :three)
               :top 106
               :value :one)

See About how to get sample code for creating controls in cgide.htm, which explains how to use the IDE to create such code.

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.