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

combo-box-column-mixin

A non-instantiable class that can be mixed with the grid-column class to create grid columns whose cells act like combo-box controls. Each cell in the column will implement the pseudo-control if the row of that cell is an instance of a grid-row subclass that mixes in the widget-row-mixin class. Instances of this may use real combo-boxes or simulations (such as pop-up menus). Which is used depends on the value of the use-real-combo-box property.

To ensure that this mixin class' methods take precedence over other methods that specialize on grid-column, this mixin class generally should appear first in a defclass expression's list of superclasses, as in:

(defclass my-combo-box-column
  (combo-box-column-mixin my-subclass-of-grid-column) ...)

The draw-cell method provided by this mixin will call read-cell-value to find the value to draw in the cell, and then call the column's data-read-converter function to convert the value to the actual string to draw.

When the user clicks on the down-arrow gadget displayed in the cell, the cell-click method provided by this mixin displays a list of choices and calls write-cell-value with the new choice if the user selects one. When the user clicks anywhere else in the cell, other properties of the grid-column determine whether this gesture displays the list of choices, initiates type-in, or does nothing. The user may alternately press the spacebar to emulate clicking on the down-arrow or the enter key to emulate clicking elsewhere in the cell.

The typable property of the column may be used to indicate whether the user may optionally type in a new value directly. When the typable property is true, the edit-start-trigger and edit-end-trigger properties of the column may be used to determine what gesture the user must make to initiate and complete the typing in of a new value for the cell. This type of column may also be given a template-string to restrict what the user may enter.

The range-reader property should be used to determine the set of choices that will be presented in each cell's drop-down list. The on-print property may be used to convert the choices to strings to be displayed in the cell's drop-down list (though the column's data-read-converter is called to convert the cell's actual value to the string displayed in the cell).

The click-must-be-on-gadget property may be used to determine where the user must click within the cell to display the list of choices when the typable property is nil. (When typable is true, the user must always click on the drop-down arrow to show the list of choices, since clicking elsewhere in the cell initiates type-in instead.)

See the section Built-In Grid Cell Widgets on the page for the grid-widget class for an overview of the grid column mixins.

A quicker but less object-oriented alternative to using the widget-column-mixin classes is to write cell-widget methods.


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