GEOS SDK TechDocs|
|
4.6 Handling Locator Searches |
4.8 Changing Column Definitions
TableClass
does not automatically support the drawing of
Table
headings. However, it is easy to implement this yourself.
To create a
Table
with headings, simply create two different
Table
objects: one for the body of the
Table
, and one for the headings. Make sure the two Tables have the same left and right margins, and make sure their columns are of the same width; but other than that, you can set up the two tables completely differently. For example, the upper
Table
(which would have only one line) might well not be user-editable or selectable.
Group the two Tables below the single
TableContent
object. Once you've set up the two Tables, you may want to experiment with headings and borders to get the look you want. Notice that the two
Table
s scroll independently. This means that when a user scrolls the lower
Table
, the same headings will always be visible at the top of the columns. You will want to add the TF_MAIN_TABLE flag to your main Table object so that it does not attempt to scroll the heading table.
Code Display 5-7 Adding a Header Table
/* A Header is simply a Table, though it is usually only one row. */
@object CoffeeTableClass, CoffeeTableHeader = {
TI_rows = 1; /* Because this is a header, only one row is needed. */
TI_columns = MY_TABLE_COLS; /* Make sure you have the same number of columns
* as in the main table. */
TI_visibleRows = 1;
TI_rowHeight = 18; /* Your row height may be different than the row height
* of the main table. */
TI_columnDefinitions = @CoffeeTableHeaderColumnDefs;
TI_borderFlags = TBF_BOX_BORDERS;
CTI_chunkArray = @CoffeeTableHeaderDataArray;
}
/* The column definition widths should match those of the main table. Headers * should not contain any TableColumnFlags, however. Set these to zero. */
@chunk TableColumnDefinition CoffeeTableHeaderColumnDefs[] = {
0, 25,
0, 100,
0, 45,
0, 70};
/* The Table header data array contains the strings to display in the Table * header. */
@chunkArray CellDataStruct CoffeeTableHeaderDataArray = {
"#","Description","Type","$/lb."
};
GEOS SDK TechDocs|
|
4.6 Handling Locator Searches |
4.8 Changing Column Definitions