Cell Spanning


Introduction

The cell spanning feature of EditTable enables cells to span across several columns and/or rows. This span can be applied to all of the cells in the table, or a subset of the table locations. Cell spanning is enabled by the resource XmNspanMode, which also determines the manner in which the cells will be drawn. The following display was produced by et_span.c in the examples directory.


Figure 11: Cell and Annotation Spanning.

The normal practice is to make sure that the adjacent cells, which are covered by the span, are empty. That is, cells for which no data is specified or where the value is one of the undefined values listed in the EditTable Data table below. This is because any data which exists in a cell before spanning is specified can remain visible, even though that location becomes part of a spanned cell.

Defined ConstantDescription
XintUNDEFINED_SHORTSpecifies an undefined short integer value.
XintUNDEFINED_INTEGERSpecifies an undefined integer value.
XintUNDEFINED_LONGSpecifies an undefined long integer value.
XintUNDEFINED_FLOATSpecifies an undefined floating point value.
XintUNDEFINED_DOUBLESpecifies an undefined double precision float point value.
XintUNDEFINED_STRINGSpecifies an undefined character string.
XintUNDEFINED_POINTERSpecifies a NULL pointer.

Also, if the XmNspanCellPointer resource is set to True, the cell pointer treats the spanned cell as a single location, and the cells that are covered by the span are inaccessible. However, if it is set to False, then the cells covered by a span can still be individually accessed and edited. Only empty row/column locations covered by a spanned cell will not interfere with the visibility of that cell.

The function XintEditTableCellSpanSetRange is used to set the cell span, as defined by the XintCellSpanFactor structure, over a given range of row/column locations. There is a corresponding function, XintEditTableCellSpanGetRange, that will retrieve the cell span factor for a particular cell.

Spanning can also occur in the horizontal and vertical annotation areas. This is done by specifying the starting row of the span range as zero (0) for the horizontal annotation and the starting column of the span range as zero (0) for the vertical annotation.