I must be missing something: how can you resize a table (in the sense of revealing more visible rows)?
You can't. Instead, define the table for the maximum number of rows you'll ever need on the largest screen, and hide the rows you're not using.
Size it for normal screen. This starts you with a normal sized table with too many and very short rows.
When you open your form, resize the table appropriately based on screen size. I then call this function to mark the individual rows usable, set their height, and return the number of usable rows in the table:
Int16 ResizeTableQVGA(FormPtr frmP, UInt16 tblID, FontID tblfont) {
UInt16 tableIndex = FrmGetObjectIndex(frmP, tblID);
TablePtr tableP = FrmGetObjectPtr(frmP, tableIndex);
FontID prev_font = FntSetFont((mggIsaQVGA ? VgaBaseToVgaFont(tblfont) : tblfont));
Int16 maxdefined = TblGetNumberOfRows(tableP);
Int16 oneline = FntLineHeight();
RectangleType r;
Int16 maxvis;
int i;
FntSetFont(prev_font);
FrmGetObjectBounds(frmP, tableIndex, &r);
maxvis = min(maxdefined, (r.extent.y/oneline));
for (i = 0; i < maxdefined; i++) {
if (i < maxvis) {
TblSetRowHeight(tableP, i, oneline);
TblSetRowUsable(tableP, i, true);
TblSetRowSelectable(tableP, i, true);
}
else {
TblSetRowUsable(tableP, i, false);
TblSetRowSelectable(tableP, i, false);
}
}return maxvis; }
-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
