Table.h
. It discusses the following topics:
TableAttrType
bit field defines the visible characteristics of the table.
typedef struct {
    UInt16 visible:1;
    UInt16 editable:1;
    UInt16 editing:1;
    UInt16 selected:1;
    UInt16 hasScrollBar:1;
    UInt16 reserved:11;
} TableAttrType;
TableAttrType
bit field as opaque. Use the functions specified in the descriptions below to retrieve and set each value. Do not attempt to change member values directly.
TableColumnAttrType
structure defines a column in a table.
typedef struct {
    Coord width;
    UInt16 reserved1 : 5;
    UInt16 masked : 1;
    UInt16 editIndicator : 1;
    UInt16 usable : 1;
    UInt16 reserved2 : 8;
    Coord spacing;
    TableDrawItemFuncPtr drawCallback;
    TableLoadDataFuncPtr loadDataCallback;
    TableSaveDataFuncPtr saveDataCallback;
} TableColumnAttrType;
TableColumnAttrType
structure as opaque. Use the functions specified in the descriptions below to retrieve and set each value. Do not attempt to change structure member values directly.
masked
field is defined only if 3.5 New Feature Set is present.
TableItemPtr
points to a
TableItemType
.
typedef TableItemType *TableItemPtr;
TableItemType
structure defines an item, or cell, within the table.
typedef struct {
    TableItemStyleType itemType;
    FontID fontID;
    Int16 intValue;
    Char * ptr;
} TableItemType;
TableItemType
structure as opaque. Use the functions specified in the descriptions below to retrieve and set each value. Do not attempt to change structure member values directly.
NOTE:  None of the table items create memory that you need to free. The table manager handles all of the allocating and deallocating of memory for table items. The only memory you are responsible for freeing is the memory handle containing the text that you want displayed in editable text fields. (SeeTableLoadDataFuncType
.)
itemType
|
The type of the item, such as a control, a text label, and so on. TblSetItemStyle sets this value. The rest of the fields in this struct are either used or not used depending on the itemType . See Table 19.1.
|
fontID
|
ID of the font used to display the item's text. TblGetItemFont and TblSetItemFont retrieve and set this value.
|
intValue
|
Integer value of the item. TblGetItemInt and TblSetItemInt retrieve and set this value.
|
ptr
|
itemType
field, describes how each type is drawn, describes which other fields are used for each itemType
, and provides special instructions for setting those fields. Note in particular that the fontID
field is often not used. Instead, certain items are displayed in a standard font. These are noted in the last column of this table.
TablePtr
type defines a pointer to a
TableType
.
typedef TableType * TablePtr;
FrmGetObjectPtr
in this way:
tblPtr = FrmGetObjectPtr(frm,
FrmGetObjectIndex(frm, tblID));
tblID
is the resource ID assigned when you created the table.
TableRowAttrType
structure defines a row in a table.
typedef struct {
    UInt16 id;
    Coord height;
    UInt32 data;
    UInt16 reserved1 : 7;
    UInt16 usable : 1;
    UInt16 reserved2 : 4;
    UInt16 masked : 1;
    UInt16 invalid : 1;
    UInt16 staticHeight : 1;
    UInt16 selectable : 1;
    UInt16 reserved3;
} TableRowAttrType;
TableRowAttrType
structure as opaque. Use the functions specified in the descriptions below to retrieve and set each value. Do not attempt to change structure member values directly.
masked
field is defined only if 3.5 New Feature Set is present.
TableType
structure represents a table.
typedef struct TableType {
    UInt16 id;
    RectangleType bounds;
    TableAttrType attr;
    Int16 numColumns;
    Int16 numRows;
    Int16 currentRow;
    Int16 currentColumn;
    Int16 topRow;
    TableColumnAttrType * columnAttrs;
    TableRowAttrType * rowAttrs;
    TableItemPtr items;
    FieldType currentField;
} TableType;
TableType
structure as opaque. Use the functions specified in the descriptions below to retrieve and set each value. Do not attempt to change structure member values directly.
void TblDrawTable (TableType *tableP)
FrmDrawForm
when the form contains a table object.
TableItemType
struct description for more information about how each type of table cell is drawn.
textTableItem, textWithNoteTableItem
, or narrowTextTableItem
), this function uses the
TableLoadDataFuncType
callback function to load the text into the table cells. The text field does not retain the text handle that your TableLoadDataFunc
returns, meaning that you are responsible for freeing the memory that you load into the table.
narrowTextTableItem
cells or customTableItem
cells, this function uses the
TableDrawItemFuncType
callback function to draw the extra pixels after the text or to draw the entire cell.
TblSetRowMasked
and
TblSetColumnMasked
.
TblEraseTable
before calling this function, particularly if the entire table has changed, as the visual effect of drawing over a white background may be more pleasing.
Boolean TblEditing (const TableType *tableP)
true
if the table is in edit mode, false
otherwise.
tblEnterEvent
is received on an editable table cell (textTableItem, textWithNoteTableItem
, or narrowTextTableItem
), or when
TblGrabFocus
is called.
textWithNoteTableItem
or when the table releases the focus (
TblReleaseFocus
).
void TblEraseTable (TableType *tableP)
visible
and selected
attributes to false
. It does not invalidate table rows.
Boolean TblFindRowData (const TableType *tableP, UInt32 data, Int16 *rowP)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row data to find. |
  |
<- |
Pointer to the row number (return value). |
true
if a match was found, false
otherwise.
TblSetRowData
.
TblGetRowData
,
TblFindRowID
,
TableRowAttrType
Boolean TblFindRowID (const TableType *tableP, UInt16 id, Int16 *rowP)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row ID to find. |
  |
<- |
Pointer to the row number (return value). |
true
if a match was found, false
otherwise.
TblSetRowID
,
TblFindRowData
,
TableRowAttrType
void TblGetBounds (const TableType *tableP, RectangleType *r)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
<- |
A RectangleType structure in which the bounds are returned. |
r
parameter contains the bounds.
TblGetItemBounds
Coord TblGetColumnSpacing (const TableType *tableP, Int16 column)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Column number (zero-based). |
column
parameter is invalid.
Coord TblGetColumnWidth (const TableType *tableP, Int16 column)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Column number (zero-based). |
column
parameter is invalid.
FieldType
in which the user is currently editing a text item.
FieldPtr TblGetCurrentField (const TableType *tableP)
NULL
if the table is not in edit mode.
TblGetSelection
void TblGetItemBounds (const TableType *tableP, Int16 row, Int16 column, RectangleType *r)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the item (zero-based). |
  |
-> |
Column number of the item (zero-based). |
  |
<- |
Pointer to a structure that holds the bounds of the item. |
r
. This function may raise a fatal exception if the row
or column
parameter specifies a row or column that does not appear on screen.
FontID TblGetItemFont (const TableType *tableP, Int16 row, Int16 column)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the item (zero-based). |
  |
-> |
Column number of the item (zero-based). |
row
or column
parameter specifies a row or column that is not on the screen.
fontID
field for this table item. Only certain types of table items use the font specified by the fontID
field when they are displayed. The
TableItemType
description specifies what font is used to display each type of table item.
TblSetItemFont
Int16 TblGetItemInt (const TableType *tableP, Int16 row, Int16 column)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the item (zero-based). |
  |
-> |
Column number of the item (zero-based). |
row
or column
does not appear on the screen.
intValue
field for this table item. Certain types of table items display the value stored in intValue
, and other types display the value pointed to by the ptr
field. See the
TableItemType
description for details. If the intValue
was never set for this table item, this function returns 0.
TblSetItemInt
,
TblGetItemPtr
void * TblGetItemPtr (const TableType *tableP, Int16 row, Int16 column)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the item (zero-based). |
  |
-> |
Column number of the item (zero-based). |
NULL
if the item does not have a pointer value. This function may display a fatal message if the row
or column
parameter is invalid.
ptr
field for this table item. Certain types of table items display the value pointed to by the ptr
, and other types display the value stored in the intValue
field. See the
TableItemType
description for details. An application may have set the value of the ptr
field anyway, even for items that use the intValue
. This function always returns that value.
return tableP->items[row * tableP->numColumns +
column].ptr;
TblSetItemPtr
Int16 TblGetLastUsableRow (const TableType *tableP)
tblUnusableRow
if there are no usable rows.
Int16 TblGetNumberOfRows (const TableType *tableP)
UInt32 TblGetRowData (const TableType *tableP, Int16 row)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Number of the row (zero-based). |
row
parameter is invalid.
TblFindRowData
,
TblSetRowData
,
TableRowAttrType
Coord TblGetRowHeight (const TableType *tableP, Int16 row)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Number of the row (zero-based). |
row
parameter is invalid.
UInt16 TblGetRowID (const TableType *tableP, Int16 row)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Number of the row (zero-based). |
row
parameter is invalid.
TblFindRowID
,
TableRowAttrType
Boolean TblGetSelection (const TableType *tableP, Int16 *rowP, Int16 *columnP)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
<- |
The row and column indexes (zero-based) of the currently selected item. |
true
if the item is highlighted, false
if not.
TblSetRowSelectable
void TblGrabFocus (TableType *tableP, Int16 row, Int16 column)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Current row to be edited (zero-based). |
  |
-> |
Current column to be edited (zero-based). |
row
or column
parameter is invalid.
FrmSetFocus
before calling this function. FrmSetFocus
releases the focus from the object that previously had it and sets the form's internal structures. After calling this function, you must call
FldGrabFocus
to display the insertion point in the field. (You can use
TblGetCurrentField
to obtain a pointer to the field.)
static void EditViewRestoreEditState () {
    Int16 row;
    FormPtr frm;
    TablePtr table;
    FieldPtr fld;
    if (CurrentFieldIndex == noFieldIndex)
    return;
    // Find the row that the current field is in.
    table = GetObjectPtr (EditTable);
    if ( ! TblFindRowID (table,
    CurrentFieldIndex, &row) )
    return;
    frm = FrmGetActiveForm ();
    FrmSetFocus (frm, FrmGetObjectIndex (frm,
    EditTable));
    TblGrabFocus (table, row, editDataColumn);
   
    // Restore the insertion point position.
    fld = TblGetCurrentField (table);
    FldSetInsPtPosition (fld, EditFieldPosition);
    FldGrabFocus (fld);
}
TblReleaseFocus
Boolean TblHandleEvent (TableType *tableP, EventType *event)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
The event to be handled. |
true
if the event was handled, false
if it was not.
false
if the table is not an editable table.
keyDownEvent
,
fldEnterEvent
, or
menuCmdBarOpenEvent
to the currently selected field.
fldHeightChangedEvent
occurs, this function changes the height of the specified field as indicated by the event. If the field being resized is going to scroll off the bottom of the screen, then instead the table scrolls the rows above it up off the top. Otherwise, the table is scrolled downward and rows below the current row are scrolled off the bottom as necessary.
fldHeightChangedEvent
is only handled for dynamically sized fields. See the descriptions of
FieldAttrType
and
FldMakeFullyVisible
for more information.
penDownEvent
occurs, the table checks to see if the focus is being changed. If it is and the user was previously editing a text field within the table, it saves the data in the table cell using the
TableSaveDataFuncType
callback function, then it enqueues a
tblEnterEvent
with the new row and column that are selected.
tblEnterEvent
occurs, this function tracks the pen until it is lifted. If the pen is lifted within the bounds of the same item it went down in, a
tblSelectEvent
is added to the event queue; if not, a
tblExitEvent
is added to the event queue.
hasScrollBar
attribute in the table. (See
TableAttrType
.)
void TblHasScrollBar (TableType *tableP, Boolean hasScrollBar)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
true to set the attribute, false to unset it. |
ListViewUpdateScrollers
function in the Memo example application (MemoMain.c
) for an example of setting scroll bar values for a table.
void TblInsertRow (TableType *tableP, Int16 row)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row to insert (zero-based). |
false
. (See
TableRowAttrType
.)
TblSetRowUsable
after making sure that the row displays a value and then call
TblRedrawTable
when you are ready to draw the table.
void TblMarkRowInvalid (TableType *tableP, Int16 row)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
row
parameter is invalid.
TableRowAttrType
void TblMarkTableInvalid (TableType *tableP)
TableRowAttrType
void TblRedrawTable (TableType *tableP)
TableItemType
struct description for more information about how each type of table cell is drawn.
textTableItem, textWithNoteTableItem
, or narrowTextTableItem
), this function uses the
TableLoadDataFuncType
callback function to load the text into the table cells. The text field does not retain the text handle that your TableLoadDataFunc
returns, meaning that you are responsible for freeing the memory that you load into the table.
narrowTextTableItem
cells or customTableItem
cells, this function uses the
TableDrawItemFuncType
callback function to draw the extra pixels after the text or to draw the entire cell.
TblSetRowMasked
and
TblSetColumnMasked
.
TblMarkTableInvalid
,
TblMarkRowInvalid
,
TblDrawTable
void TblReleaseFocus (TableType *tableP)
FrmSetFocus
with an object index of noFocus
to notify the form that the table has lost focus. The form code calls TblReleaseFocus
for you.
TableSaveDataFuncType
callback function is called to save the text in the currently selected field, the memory allocated for editing is released, and the insertion point is turned off.
FldReleaseFocus
if the focus is in an editable text field and that field uses a custom drawing function (
TableDrawItemFuncType
).
TblGrabFocus
void TblRemoveRow (TableType *tableP, Int16 row)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row to remove (zero-based). |
TblRedrawTable
.
Boolean TblRowInvalid (const TableType *tableP, Int16 row)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
true
if the row is invalid, false
if it's valid. This function may raise a fatal error message if the row
parameter is invalid.
TblRedrawTable
to do so.
TblMarkRowInvalid
,
TblMarkTableInvalid
Boolean TblRowMasked (const TableType * tableP, Int16 row)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
true
if the row is masked, false
otherwise.
TblSetRowMasked
,
TblSetColumnMasked
,
TableRowAttrType
,
SecSelectViewStatus
Boolean TblRowSelectable (const TableType *tableP, Int16 row)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
true
if the row is selectable, false
if it's not.
TableRowAttrType
Boolean TblRowUsable (const TableType *tableP, Int16 row)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
true
if the row is usable, false
if it's not.
column
parameter is invalid.
void TblSelectItem (TableType *tableP, Int16 row, Int16 column)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row of the item to select (zero-based). |
  |
-> |
Column of the item to select (zero-based). |
column
or row
parameter point to an item that is not on the screen.
row
contains a masked private database record, then the item remains unselected.
void TblSetBounds (TableType *tableP, const RectangleType *rP)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Pointer to a RectangleType structure that specifies the bounds for the table. |
void TblSetColumnEditIndicator (TableType *tableP, Int16 column, Boolean editIndicator)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Column number (zero based). |
  |
-> |
true to highlight, false to turn off highlight. |
editIndicator
value of true
, and all other table item types have an edit indicator of false
.
true
and column 3 has an edit indicator of false
, only the items in column 1 and 2 are drawn as highlighted when selected. Column 4 items are not drawn as highlighted.
TableColumnAttrType
void TblSetColumnMasked (TableType *tableP, Int16 column, Boolean masked)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Column number (zero-based). |
  |
-> |
true to have the column be masked, false otherwise. |
TblRowMasked
,
TblSetRowMasked
,
TableColumnAttrType
,
SecSelectViewStatus
column
.
void TblSetColumnSpacing (TableType *tableP, Int16 column, Coord spacing)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Column number (zero-based). |
  |
-> |
Spacing after the column in pixels. |
column
parameter is invalid.
TblSetColumnUsable
,
TableColumnAttrType
void TblSetColumnUsable (TableType *tableP, Int16 column, Boolean usable)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Column number (zero-based). |
  |
-> |
true for usable or false for not usable. |
column
parameter is invalid.
TblMarkRowInvalid
,
TableColumnAttrType
void TblSetColumnWidth (TableType *tableP, Int16 column, Coord width)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Column number (zero-based). |
  |
-> |
Width of the column (in pixels). |
column
parameter is invalid.
TblGetColumnWidth
,
TableColumnAttrType
void TblSetCustomDrawProcedure (TableType *tableP, Int16 column, TableDrawItemFuncPtr drawCallback)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Column number. |
  |
-> |
Callback function. |
TableItemStyleType
of customTableItem
. See the
TableItemType
description for more information.
column
parameter is invalid.
TableDrawItemFuncType
,
TblDrawTable
,
TableColumnAttrType
void TblSetItemFont (TableType *tableP, Int16 row, Int16 column, FontID fontID)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the item (zero-based). |
  |
-> |
Column number of the item (zero-based). |
  |
-> |
ID of the font to be used. |
fontID
field for this table item. Only certain types of table items use the font specified by the fontID
field when they are displayed. The
TableItemType
description specifies what font is used to display each type of table item. It is not an error to set the fontID
for a table item that does not use it.
row
or column
parameter specifies a row or column that is not on the screen.
TblGetItemFont
void TblSetItemInt (TableType *tableP, Int16 row, Int16 column, Int16 value)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the item (zero-based). |
  |
-> |
Column number of the item (zero-based). |
  |
-> |
Any byte value (an integer). |
row
or column
parameter is invalid.
intValue
field for this table item. Certain types of table items display the value stored in intValue
, and other types display the value pointed to by the ptr
field. See the
TableItemType
description for details. If you set the intValue
of an item that displays its ptr
value, it is not an error. An application can store whatever value it wants in the intValue
field; however, be aware that this has nothing to do with the value displayed by such a table cell.
TblGetItemInt
,
TblSetItemPtr
void TblSetItemPtr (TableType * tableP, Int16 row, Int16 column, void *value)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the item (zero-based). |
  |
-> |
Column number of the item (zero-based). |
  |
-> |
Pointer to data to display in the table item. |
row
or column
parameter is invalid.
ptr
field for this table item. Certain types of table items display the value pointed to by ptr
, and other types display the value stored in the intValue
field. See the
TableItemType
description for details. If you set the ptr
of an item that displays its intValue
, it is not an error. An application can store whatever value it wants in the ptr
field; however, be aware that this has nothing to do with the value displayed by such a table cell.
TblGetItemPtr
,
TblSetItemInt
void TblSetItemStyle (TableType *tableP, Int16 row, Int16 column, TableItemStyleType type)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the item (zero-based). |
  |
-> |
Column number of the item (zero-based). |
  |
-> |
The type of item, such as an editable text field or a check box. See TableItemType for a list of possible values. |
row
or column
parameter is invalid.
TblSetItemInt
or
TblSetItemPtr
to set the value displayed by the table item. You should call one or the other of these functions depending on the type of table item you specified. See the table in the
TableItemType
description for details.
for (row = 0; row < rowsInTable; row++) {
    TblSetItemStyle (table, row, completedColumn,
    checkboxTableItem);
    TblSetItemStyle (table, row, priorityColumn,
    numericTableItem);
    TblSetItemStyle (table, row, descColumn,
    textTableItem);
    TblSetItemStyle (table, row, dueDateColumn,
    customTableItem);
    TblSetItemStyle (table, row, categoryColumn,
customTableItem);
}
TblSetCustomDrawProcedure
void TblSetLoadDataProcedure (TableType *tableP, Int16 column, TableLoadDataFuncPtr loadDataCallback)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Column number (zero-based). |
  |
-> |
Callback procedure. See TableLoadDataFuncType . |
TableLoadDataFuncType
for more information on writing the callback function.
TblSetCustomDrawProcedure
void TblSetRowData (TableType *tableP, Int16 row, UInt32 data)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
row
parameter is invalid.
TblGetRowData
,
TblFindRowData
void TblSetRowHeight (TableType *tableP, Int16 row, Coord height)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
  |
-> |
New height in pixels. |
row
parameter is invalid.
void TblSetRowID (TableType *tableP, Int16 row, UInt16 id)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
  |
-> |
ID to identify a row. |
row
parameter is invalid.
TblGetRowID
,
TblFindRowID
,
TableRowAttrType
void TblSetRowMasked (TableType *tableP, Int16 row, Boolean masked)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
  |
-> |
true to have the row be masked, false otherwise. |
UInt16 attr;
privateRecordViewEnum privateRecordStatus;
Boolean masked;
privateRecordStatus = (privateRecordViewEnum)
    PrefGetPreference(prefShowPrivateRecords);
....
DmRecordInfo (ToDoDB, recordNum, &attr, NULL,
    NULL);
masked = ((attr & dmRecAttrSecret) &&
    (privateRecordStatus == maskPrivateRecords));
TblSetRowMasked(tableP, row, masked);
TblRowMasked
,
TblSetColumnMasked
,
TableRowAttrType
,
SecSelectViewStatus
void TblSetRowSelectable (TableType *tableP, Int16 row, Boolean selectable)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
  |
-> |
true or false . |
row
parameter is invalid.
TblRowSelectable
,
TblSetRowUsable
,
TableRowAttrType
void TblSetRowStaticHeight (TableType *tableP, Int16 row, Boolean staticHeight)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
  |
-> |
true to set the static height, false to unset it. |
row
parameter is invalid.
void TblSetRowUsable (TableType *tableP, Int16 row, Boolean usable)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number (zero-based). |
  |
-> |
true or false . |
row
parameter is invalid.
void TblSetSaveDataProcedure (TableType *tableP, Int16 column, TableSaveDataFuncPtr saveDataCallback)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Column number (zero-based). |
  |
-> |
Callback function. See TableSaveDataFuncType . |
column
parameter is invalid.
TblSetCustomDrawProcedure
void TblUnhighlightSelection (TableType *tableP)
void TableDrawItemFuncType (void *tableP, Int16 row, Int16 column, RectangleType *bounds)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the item to be drawn (zero-based). |
  |
-> |
Column number of the item to be drawn (zero-based). |
  |
-> |
The area of the screen in which the item is to be drawn. |
TblDrawTable
and
TblRedrawTable
.
customTableItem
(to draw the entire item) or narrowTextTableItem
(to draw whatever is required in the space between the text and the right edge of the table cell).
customTableItem
instead. For example, if you want to include a date in your table but you want it to show the year as well as the month and day, you should implement a custom drawing function.
TblSetCustomDrawProcedure
,
TableItemType
Err TableLoadDataFuncType (void *tableP, Int16 row, Int16 column, Boolean editable, MemHandle *dataH, Int16 *dataOffset, Int16 *dataSize, FieldPtr fld)
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the table item to load. |
  |
-> |
Column number of the table item to load. |
  |
-> |
If true , the table is currently being edited. If false , the table is being drawn but not necessarily being edited. |
  |
<- |
Unlocked handle of a block containing a null-terminated text string. |
  |
<- |
Offset from start of block to start of the text string. |
  |
<- |
Allocated size of text string, not the string length. |
  |
-> |
Pointer to the text field in this table cell. |
TblDrawTable
or
TblRedrawTable
) and when a text field item is being selected (part of
TblHandleEvent
's handling of
tblEnterEvent
). If this function returns an error (any nonzero value) and the item is being selected, then the item is not selected and the table's editing
attribute is set to false
.
dataH
, dataOffset
, and dataSize
that you would pass to
FldSetText
. That is, you can use this function to point the table cell's text field to a string in a database record so that you can edit that string directly using text field routines. To do so, return the handle to a database record in dataH
, the offset from the start of the record to the start of the string in dataOffset
, and the allocated size of the string in dataSize
.
dataOffset
bytes in the memory chunk. The string should be between 0 and dataSize
- 1 bytes in length.
FldSetText
, you are responsible for freeing the memory associated with the dataH
parameter. You can do so in the
TableSaveDataFuncType
function, but it is only called for a cell that has been edited. For non-editable text cells or text cells that are editable but were never selected, free the memory when you close the form.
fld
pointer passed to your function has already been initialized with default values by the table code. If you want to override a field's attributes (for example, if you want to change the underline mode) you can do so in this function.
TblDrawTable
,
TblHandleEvent
,
TableLoadDataFuncType
Boolean TableSaveDataFuncType (void *tableP, Int16 row, Int16 column);
  |
-> |
Pointer to a table object. (See TableType .) |
  |
-> |
Row number of the table item to load. |
  |
-> |
Column number of the table item to load. |
true
if the table should be redrawn, or false
if the table does not need to be redrawn.
TblGetCurrentField
to retrieve a pointer to this field. It is called only on the currently selected field, not on any other fields in the table.
FldCompactText
for you.
TableLoadDataFuncType
callback points to a string on the dynamic heap, you should implement this callback function to store or free the handle. You can use
FldGetTextHandle
to obtain the handle.
true
from this function,
TblRedrawTable
is called. You should mark invalid any table rows that you want redrawn before returning.
TblSetSaveDataProcedure
  |   |