Generic FunctionPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

cell-widget

Arguments: grid-row grid-column row-number column-number

Returns a number of values that indicate which of the several built-in cell widgets should appear in particular grid-widget cells, and what attributes those widgets should have. The default method does nothing, so an application must add its own cell-widget methods in order to use the built-in cell widgets with this approach.

An alternative approach is to use the various widget-column-mixin subclasses along with the widget-row-mixin class. That approach is more object-oriented, but also limits the built-in cell widgets to particular columns for each type of widget.

The IDE's Navigator Dialog contains a complete example of the cell-widget approach, called Grid-widget: using built-in cell widgets in ARBITRARY cells.

The first value returned from a cell-widget method should be a keyword that indicates which type of widget to use in the cell that is indicated by the arguments to cell-widget. The possible values are :button, :static-text, :editable-text, :check-box, :combo-box, :lamp, and :pixmap. For more information on how each of these widgets works, please refer to the associated widget-column-mixin class shown below (even though these classes are not used at all when writing cell-widget methods):

The rest of the multiple values that a cell-widget method should return supply various attributes of the cell's widget. These values depend on which type of widget is being used. Most of these values correspond to properties of the various widget-column-mixin subclasses, though the cell-widget approach does not use those mixin classes. Since the cell-widget approach has no grid-column object on which to hang these property values, we must return them as multiple values from cell-widget methods instead.

Here are the multiple values that a cell-widget method should return for each type of widget. This list includes links to the corresponding widget-column-mixin properties that they emulate, where applicable, for more information.

These returned values cover only the properties that are unique to the built-in cell widgets. Other attributes of the cell will still be determined by general grid-widget generic functions such as read-cell-value, write-cell-value, cell-font, cell-background-color, cell-horizontal-justification, and so on. See the grid-widget class for a complete overview.

cell-widget methods may be called frequently, so to avoid generating a lot of garbage it is advisable to return static values rather than values that are newly consed on each call.

There is an example using cell-widget on the Examples tab of the Navigator Dialog.

See the grid-widget class for an overview of writing grid-widget code.


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version