Hi All,
I am developing an launcher application in which I am using a Table to
display a single column and multiple rows data.
In the application, I want to display all applications with DATABASE TYPE as
"ovly". I am getting blank lines in the list whenever a OVERLAY database
is read in the FOR LOOP. I am giving below the code snippet where I am
reading the databases.
Please help. Thanks and regards.
Yuva
---------------------------------------------------------
static void ListViewLoadTable (FormPtr frm)
{
UInt16 row;
UInt16 recordNum;
UInt16 lineHeight;
UInt16 dataHeight;
UInt16 tableHeight;
UInt16 numRows;
TablePtr table;
RectangleType r;
LocalID lid;
Char* dbasename,*dabasetype;
Err error;
UInt32 dbType;
UInt16 result;
table = GetObjectPtr (MainMemolistTable);
TblGetBounds (table, &r);
tableHeight = r.extent.y;
lineHeight = FntLineHeight ();
dataHeight = 0;
recordNum = TopVisibleRecord;
numRows = TblGetNumberOfRows (table);
for (row = 0; row < numRows;row++)
{
if((recNo2 >= -1) && (recNo2<=MemosInCategory))
lid = DmGetDatabase(0,recNo2);
dbasename=MemPtrNew(100);
error = DmDatabaseInfo(0,lid,dbasename,NULL,NULL,NULL,NULL,NULL,
NULL,NULL,NULL,&dbType,NULL);
}
if ((dbasename) && (tableHeight >= dataHeight + lineHeight))
{
if(dbType != sysFileTOverlay)
{
TblSetRowID (table, row, recordNum);
TblSetItemStyle (table, row, 0, customTableItem);
TblSetRowHeight (table, row, lineHeight);
TblSetRowSelectable(table,row, false);
if ((TblGetRowData (table, row) != (UInt16)lid) ||
(!TblRowUsable (table, row)))
{
{
TblSetRowUsable (table, row, true);
TblSetRowData (table, row, (UInt16)lid);
TblMarkRowInvalid (table, row);
}
}
if (row+1 < numRows) recordNum++;
dataHeight += lineHeight;
}else
{
TblSetRowHeight (table, row, lineHeight);
TblSetRowUsable (table, row, false);
TblMarkRowInvalid (table, row);
}
}
else
{
TblSetRowHeight (table, row, lineHeight);
TblSetRowUsable (table, row, false);
}
}
TblRedrawTable(table);
ListViewUpdateScrollers (frm);
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/