Hi,
I'm a beginner to palm programming and I'm currently trying to create a table
using customTableItem.
I attempted to create a table previously using customTableItem but failed
miserably so opted for the labelTableItem, as I wanted non-editable items to be
displayed. But I soon realised that labelTableItem wouldnt do- Number 1 the
colon ':' at the end of each item and also when you select a row - only the
cell, of the column, is highlighted so I came to realise that I could not use
that.
I have been at customTableItem all day but no joy. I'm at the stage now where I
just want a simple 'test' to be displayed to the table. Nothing is being
displayed though to the table - it's blank. I will paste my code in. I have
looked at numerous examples and copied them into my code but the table
continues to stay blank. Well here's my code at the moment -
static void ListFormLoadOutboxTable()
{
Int16 row;
Int16 rowsInTable;
FormPtr frm;
Int16 uRecordNum;
frm = FrmGetActiveForm();
tableP = FrmGetObjectPtr (frm, FrmGetObjectIndex(frm, EmailTable));
rowsInTable = TblGetNumberOfRows(tableP);
//TblUnhighlightSelection (table);
TblSetCustomDrawProcedure (tableP, 0, SelTableDrawItem);
TblSetCustomDrawProcedure (tableP, 1, SelTableDrawItem );
TblSetCustomDrawProcedure (tableP, 2, SelTableDrawItem );
uRecordNum = 0;
for (row = 0; row < rowsInTable; row++)
{
TblSetItemStyle (tableP, row, 0, customTableItem);
TblSetItemInt (tableP, row, 0, uRecordNum);
TblSetItemStyle (tableP, row, 1, customTableItem);
TblSetItemInt (tableP, row, 1, uRecordNum);
TblSetItemStyle (tableP, row, 2, customTableItem);
TblSetItemInt (tableP, row, 2, uRecordNum);
TblSetRowUsable (tableP, row, false);
TblMarkRowInvalid (tableP, row );
}
TblSetColumnUsable(tableP, 0,true);
TblSetColumnUsable(tableP, 1,true);
TblSetColumnUsable(tableP, 2,true);
TblDrawTable(tableP);
}
///////////////////////////////////////////////
void SelTableDrawItem( void *table, Int16 row, Int16 column, RectanglePtr
bounds )
{
Int16 x, y;
FontID curFont;
CharPtr pText;
FormPtr pForm = FrmGetActiveForm ();
pText = "Test";
x = bounds->topLeft.x;
y = bounds->topLeft.y;
WinDrawChars(pText,StrLen(pText),x, y);
curFont = FntSetFont (stdFont);
FntSetFont (curFont);
return;
}
could any1 please tell me why the above is displaying nothing to the table.. or
if I'm missing something?
Any help would be greatly appreciated,
Thanks,
Elaine
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/