ClassPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version

combo-box

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

To allow 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.

Comparing values in a combo-box range

Combo-boxes use on-change-test to compare their value to elements in their range. The initial value of the on-change-test is eql. That value is inappropriate if the values in the range are strings: equal would be more appropriate for strings (two strings with the same characters may not be eql but are equal).

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.)

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. :left for left). 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.

A diagram of window and widget classes is shown in Widget and window classes in cgide.htm.


Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version