>That error statement is in
>the TblGetItemBounds routine. The error message will be shown if the
>provided row number (that is, the parameter passed to the routine) is
>greater than the table's number of rows, or if the given column is greater
>than the table's number of columns.
The only thing that I'm calling in that routine is TblGetBounds. Do you
know if TblGetBounds internally calls TblGetItemBounds? The only parameters
I pass into TblGetBounds is the table pointer, and the address of a
RectangleType.
This whole things seems weird because I have no problem with doing the
scrolling with the hardware keys....
This is my scrolling code:
void SelectViewScroll(Short linesToScroll)
{
TablePtr table;
Word rowsInTable;
Word lastRow;
Word scrollAmount = 0;
Int i;
UInt newTopVisibleRecord;
RectangleType scrollR;
RectangleType vacated;
DirectionType direction;
table = GetObjectPtr(SelectTripTableTable);
rowsInTable = SelectViewNumberOfRows(table);
// **** If I call the following,
// **** it prevents the 1885 error
// TblUnhighlightSelection(table);
// Find the new top visible record
newTopVisibleRecord = tblInfoTopRecord;
tblInfoCurRecord = noRecordSelected;
// Move The bits that will remain visible
if(((linesToScroll > 0) && (linesToScroll < rowsInTable)) ||
((linesToScroll < 0) && (-linesToScroll < rowsInTable)))
{
if(linesToScroll > 0)
{
// Scroll down
SeekRecord(&newTopVisibleRecord, linesToScroll,
dmSeekForward);
ErrFatalDisplayIf(tblInfoTopRecord == newTopVisibleRecord,
"Invalid scroll value");
lastRow = TblGetLastUsableRow(table) - 1;
for(i = 0; i < linesToScroll; i++)
{
scrollAmount += TblGetRowHeight(table, lastRow);
TblRemoveRow(table, 0);
}
direction = up;
}
else
{
// Scroll up - change sign and seek
SeekRecord(&newTopVisibleRecord, -linesToScroll,
dmSeekBackward);
ErrFatalDisplayIf(tblInfoTopRecord == newTopVisibleRecord,
"Invalid scroll value");
// change sign for correct condition
for(i = 0; i < -linesToScroll; i++)
{
scrollAmount += TblGetRowHeight(table, 0);
TblInsertRow(table, 0);
}
direction = down;
}
TblGetBounds(table, &scrollR);
WinScrollRectangle(&scrollR, direction, scrollAmount, &vacated);
WinEraseRectangle(&vacated, 0);
}
// Avoid redraw if no change
if(tblInfoTopRecord != newTopVisibleRecord)
tblInfoTopRecord = newTopVisibleRecord;
SelectViewLoadTable(FrmGetActiveForm());
TblRedrawTable(table);
}
}
--
Tim Astle
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/