Hello
Thanks Paul, I am able to remove the check box problem. But I am facing
another problem in the Table.
I have created the 2 columns table. In first column I am using the custom
draw item. And in the second column I am using the textTableItem. My table
is having the scrollbars. So if I write in any cloumn and then I have
scroll-down and agian if I came to that record then I lost the text written.
So let me know whether I have to save all the columns text in the memory?
and if I ma having large no of records then I have to create the text handle
for every column? or there are some alternatives to this? Following are the
initalize function of the table.
void KAcceptDataForm::fnInitializeTable(void)
{
TableType* table = (TableType*)GetObjectPtr(AcceptDataResultTable);
Int16 rowsInTable;
Int16 row;
//Create an array
fnFillArray(g_pAcceptFieldSet); //heare I am filling my array for
displaying the records
TblSetCustomDrawProcedure(table, 0, fnDrawAcceptDataElement);
rowsInTable = TblGetNumberOfRows(table);
for (row = 0; row < g_nAcceptFieldColumn; row++)
{
TblSetItemStyle(table, row, 0, customTableItem);
//TblSetItemInt (table, row, 0, 0);
TblSetRowID (table, row, row);
TblSetItemStyle(table, row, 1, textTableItem);
}
for (row = 0; row < 2; row++)
{
TblSetColumnUsable(table, row, true);
}
fnLoadTable();
TblRedrawTable(table);
}
void KAcceptDataForm::fnLoadTable(void)
{
TableType* table = (TableType*)GetObjectPtr(AcceptDataResultTable);
Int16 rowsInTable = TblGetNumberOfRows(table);
Int16 row = 0;
int nMaxValue = 0;
g_nAcceptTopItem = min(g_nAcceptTopItem, g_nAcceptFieldColumn);
for (row = 0; row < rowsInTable; row++)
{
if (row + g_nAcceptTopItem < g_nAcceptFieldColumn)
{
// Make the row usable.
TblSetRowUsable(table, row, true);
// Store the item number as the row id.
TblSetRowID(table, row, row + g_nAcceptTopItem);
// make sure the row will be redrawn
TblMarkRowInvalid(table, row);
}
else
{
TblSetRowUsable(table, row, false);
}
}
nMaxValue = g_nAcceptFieldColumn - rowsInTable;
if (0 > nMaxValue)
{
nMaxValue = 0;
}
SclSetScrollBar((ScrollBarType
*)GetObjectPtr(AcceptDataScrollbarScrollBar),
g_nAcceptTopItem, 0, nMaxValue, rowsInTable - 1);
}
With Regards,
Amit Kalekar
[EMAIL PROTECTED]
Kalpadrum Infotech Pvt.Ltd.
www.kalpadrum.com
----------------------------------------------------------------------------
--------------------------------------------------------------------
Subject: RE: Checkbox problem in the table
~~~~~~~~~~~~
From: "Paul Gibson" <[EMAIL PROTECTED]>
Date: Mon, 15 Apr 2002 09:47:32 -0600
X-Message-Number: 28
it sounds as if the Row IDs are not being set correctly, and therefor the
table redraw is not tracking the visible portion the right way.
How are you calculating the top visible row in relation to the total number
of items (visible and non visible)? Does this happen only with the top
item? Or does it happen with any of the check boxes? If you post your
table load functions I'd be happy to look at them. I use tables with
checkboxes extensively, and have gotten them all to work quite well.
Paul
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/