> I would like to highlight a table row when any cell in the row is tapped.
> The table has four columns, each contains a non-editable text field. I
call
> TblSetRowSelectable when I initialize the table. It is called for each
row,
> immediately after calling TblSetRowUsable. However, tapping a row does
not
> cause the row to highlight.
>
> It was my impression from the dummies book that highlighting a row was the
> default behavior for tapping a non-editable textfield cell. Is this not
the
> case? Is there something I've overlooked?
>
> I've included debug code which calls TblRowSelectable and confirmed that
> each row is, in fact, selectable. I've even tried a kluge where I call
> TblSelectItem on each cell in the row specified by a tblSelectEvent, but
> this only highlights the last cell selected.
I believe the default behavior is for a field to be selected when clicked.
A row cannot be selected. However, someone sent me code that can do this.
I've never tested this code, so you'll have to let me know if it works. The
downside is that I don't think it will look that great on a IIIc.
On tblEnterEvent, do this:
// highlight entire row
TablePtr tbl = (TablePtr)eP->data.tblEnter.pTable;
RectangleType r;
TblGetItemBounds(tbl, eP->data.tblEnter.row, 1, &r);
Word sExtent = r.extent.x;
TblGetItemBounds(tbl, eP->data.tblEnter.row, 0, &r);
r.extent.x += sExtent;
WinInvertRectangle(&r, 1);
Then when you want to unhighlight the row (i.e. on frmClose or whatever)
WinInvertRectangle(&r, 1);
If I missed your point, which I may have, perhaps the problem is that you
should be using a customTableItem to display your information. (Instead of
a textTableItem) If the text is just being displayed, you should have no
problems with this.
Regards,
+++++++++++++
Timothy D. Astle
Embedded Systems Programmer
ALT Group Inc.
+++++++++++++
"People who can smile when things go wrong has thought of someone else to
blame it on."
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/