> > My problem is not with the display, but with the selection.. For some
> > reason, I can only click and get a table select event when I click on
the
> > top half of a cell, but not the bottom half.
For those who might need something like this....
The archives led to the same conclusion.. that you had to do it yourself..
my temporary (but not completely elegant yet because the highlight still
looks odd, I'm open to suggestions on solving that part) solution to this is
this code in my event handler:
*** Declared in the handler:
static RectangleType tableBounds;
static Boolean isDownInTable;
*** tableBounds is set to the bounding rectangle of my table and
isDownInTable is set to false in the frmOpenEvent:
TblGetBounds(table, &tableBounds);
isDownInTable = false;
*** I added these penDown and penUp Events..
case penDownEvent:
{
isDownInTable = RctPtInRectangle (event->screenX, event->screenY,
&tableBounds);
break;
}
case penUpEvent:
{
if (isDownInTable && RctPtInRectangle (event->screenX, event->screenY,
&tableBounds))
{
int row;
RectangleType cellBounds;
cellBounds.topLeft.x = tableBounds.topLeft.x;
cellBounds.topLeft.y = tableBounds.topLeft.y;
cellBounds.extent.x = tableBounds.extent.x;
// my table has 5 rows, but this could be replaced by a call to
TblGetNumberOfRows
cellBounds.extent.y = tableBounds.extent.y / 5;
row = 0;
while (row < 5) // ditto note above about number of rows...
{
if (RctPtInRectangle(event->data.penUp.start.x,
event->data.penUp.start.y, &cellBounds) &&
RctPtInRectangle(event->data.penUp.end.x, event->data.penUp.end.y,
&cellBounds))
break;
cellBounds.topLeft.y += cellBounds.extent.y;
idx++;
}
if (row < 5) // ditto again...
{
// the pen went down and up on the same row and "row" is the value
}
}
isDownInTable = false;
break;
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/