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

row-selecting-column-mixin

A grid-column that is an instance of this class allows the user to select and/or move grid-rows by clicking the cells where they cross the grid-column. The selectable property of a row must also be true before the row may be interactively selected, and the movable property of a row must also be true before the row may be interactively moved. In other words, a row may be interactively selected at a particular cell if the row is a selectable one and the column at that cell is an instance of row-selecting-column-mixin; and (likewise) a row may be interactively moved (among the rows in its grid-row-section) at a particular cell if the row is a movable one and the column at that cell is an instance of row-selecting-column-mixin.

This feature is typically used only in a grid-column that serves as a set of row headers, so that the special row-selecting and/or -moving behavior does not override other cell-click behavior in the body of the grid-widget. Nevertheless, it may sometimes be desirable to use this class for multiple columns of a grid.

The user uses this feature by moving the mouse cursor into a cell in a selectable or movable   grid-row where it crosses a row-selecting-column-mixin column. The user may click and drag vertically in this cell to reposition the grid-row, or click and release without moving the mouse more than *start-drag-slack* pixels to toggle the selected property of the row. When the mouse button is released after a drag, the row is positioned among the rows in its grid-row-section so that it is just below all of the rows whose vertical centers are above the final vertical center of the drag box (this should be intuitive). A drag may be canceled either by pressing the Escape key before releasing the mouse button or by releasing the mouse button while the drag box is positioned where the row would snap back to where it was already.

An individual selectable grid-row may be added to the current set of selected rows in its grid-row-section by holding down the control key while clicking the row; if the row is already selected, then this deselects the row instead. If the shift key is held down while clicking a selectable row, then the range of rows that just encompasses all of the rows that were already selected plus the row that was clicked are then left in a selected state (regardless of their selected state beforehand).

This class must be mixed with grid-column (or one of its subclasses) to make an instantiable class. It is best to specify such mixin classes ahead of the grid-column class in the list of superclasses for a new class, so that the small amount of special behavior from the mixin class will override the more general behavior of the grid-column class. For example:

(defclass my-row-selecting-column (row-selecting-column-mixin grid-column)())

The above default mouse click behavior may be overridden by custom cell-click methods.

For an example of row-selecting-column-mixin, see the Navigator dialog example (on the Examples tab) entitled "Grid-Widget: a basic replicated editable-text column". See also the class row-header-column, which combines this class with row-sizing-column-mixin and grid-column for use as a typical column of row headers.

See also slide-subsection.


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

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