| Allegro CL version 8.2 Moderately revised from 8.1. 8.1 version |
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):
:button
-- static-text-and-button-column-mixin
:check-box
-- check-box-column-mixin
:combo-box
-- combo-box-column-mixin
:editable-text
-- editable-text-column-mixin
:static-text
-- static-text-column-mixin
:lamp
-- lamp-column-mixin
:pixmap
-- pixmap-column-mixin
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.
static-text
widget,
return these values:
:static-text
nil
to defer to the read-cell-value method for the cell.
:button
nil
to defer to the read-cell-value method for the cell
check-box
widget,
return these values:
:check-box
nil
); the null string will
center the gadget horizontally
editable-text
widget, return these values:
:editable-text
combo-box
widget,
return these values:
:combo-box
combo-box
for the list of choices
rather than a pop-up-menu
lamp
widget,
return these values:
:lamp
grid-widget
s.
pixmap
,
return these values:
:pixmap
grid-column
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-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page has had moderate revisions compared to the 8.1 page.
Created 2016.6.21.
| Allegro CL version 8.2 Moderately revised from 8.1. 8.1 version |