Correction, the error seems to be caused by this function....

static void SelectViewLoadTable(FormPtr frm)
{
     Word   row;
     Word   recordNum;
     Word   lineHeight;
     Word   dataHeight;
     Word   tableHeight;
     Word   lastRecordNum;
     Word   numRows;
     ULong   uniqueID;
     FontID   currFont;
     TablePtr  table;
     VoidHand  record;
     RectangleType r;

     table = GetObjectPtr(SelectTripTableTable);

     TblGetBounds(table, &r);
     tableHeight = r.extent.y;

     currFont = FntSetFont(SelectFont);
     lineHeight = FntLineHeight();
     FntSetFont(currFont);

     dataHeight = 0;

     recordNum = tblInfoTopRecord;

     // For each row in the table, store the record in the table item
     // that will display the record.
     numRows = TblGetNumberOfRows(table);
     for(row = 0; row < numRows; row++)
     {
          // Get the next record in the current category.
          record = DmQueryNextInCategory(gInfoDB, &recordNum,
dmAllCategories);

          // If the record was found, store the record number in the table
item,
          // otherwise set the table row unusable.
          if(record && (tableHeight >= dataHeight + lineHeight))
          {
               TblSetRowID(table, row, recordNum);
               TblSetItemStyle(table, row, 0, customTableItem);
               TblSetItemFont(table, row, 0, SelectFont);
               TblSetRowHeight(table, row, lineHeight);

               DmRecordInfo(gInfoDB, recordNum, NULL, &uniqueID, NULL);
               if((TblGetRowData(table, row) != uniqueID) ||
(!TblRowUsable(table, row)))
               {
                    TblSetRowUsable(table, row, true);

                    // Store the unique id of the record in the row.
                    TblSetRowData(table, row, uniqueID);

                    // Mark the row invalid so that it will draw when we
call the
                    // draw routine.
                    TblMarkRowInvalid(table, row);
               }

               lastRecordNum = recordNum;
               if(row + 1 < numRows)
                    recordNum++;

               dataHeight += lineHeight;
          }

          else
               TblSetRowUsable(table, row, false);
     }
     // Update the scroll arrows.
     SelectViewUpdateScrollers(frm, lastRecordNum);
}

--

Tim Astle



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to