Hi!
I am getting a problem with creating tables.
These are the functions which I have used in my program.
static void LoadTable(void)
{
frm = FrmGetActiveForm();
table = FrmGetObjectPtr (frm, FrmGetObjectIndex (frm, MainNameTableTable));
TblSetCustomDrawProcedure(table, FrmQty, Draw);
TblSetCustomDrawProcedure(table, ToQty, Draw);
rowsInTable = TblGetNumberOfRows(table);
for (row = 0; row < rowsInTable; row++) {
TblSetItemStyle(table, row, FrmQty, customTableItem);
TblSetColumnUsable(table, FrmQty, true);
TblSetColumnUsable(table, ToQty, true);
}
static void Draw(VoidPtr tableP, Word row, Word column, RectanglePtr n)
{
String s = func();
width = n->extent.x - 2;
textLen = StrLen(s);
FntCharsInWidth(s, &width, &textLen, &fits);
WinDrawChars(s, textLen, n->topLeft.x, n->topLeft.y);
}
func() is a function which returns
a string say "employee".
I have called the load table in the form open event.
I am get an error which says that DrawQuantity
is undefined.
>Does the Draw function need a prototype?
>And how else will it be called in the TblSetCustomDrawProcedure.
>Are the 2 functions enough to draw the table.
Please tell me how I go about it.
THank You!!!!!!!!
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/