Anyone know how to create a custom draw table on a dialog...? Everything
seems fine until I set one of my columns to have 'customTableItem' type and
then later call TblSetCustomProcedure().
Then I get the error form.c, Line 1767, Object #601 in form #1000 is
missing. The thing is form #1000 is my main form not the dialog..? Anyone
know why TblSetCustomProcedure() is looking at that form rather than the one
in my dialog...? Is there a better time to call TblSetCustomProcedure, or is
this just not possible...?
Any suggestions? I've included the relevant bits of code below.
Cheers, Scott
*---------- SAMPLE CODE ----------------*
Boolean ShowPluginsDlg()
{
UInt16 result;
FormPtr dlg;
RectangleType rect;
Boolean changed = false;
dlg = FrmInitForm(PluginsDlg); // #600
FrmSetEventHandler(dlg, PluginsDlgHandleEvent);
InitialiseTable(dlg, PlgnTbl); // #601
FrmDrawForm(dlg);
// Initialise Controls Here
result = FrmDoDialog(dlg);
if(result == IDOK)
{
}
FrmDeleteForm(dlg);
return changed;
}
/*--------------------------------------------------------------------------
--*/
static void InitialiseTable(FormPtr dlg, UInt16 tableID)
{
Int16 row;
TablePtr table = (TablePtr)FrmGetObjectPtr(dlg, FrmGetObjectIndex(dlg,
tableID));
Int16 numRows = TblGetNumberOfRows(table);
for(row = 0; row < numRows; row++)
{
TblSetItemStyle(table, row, 0, checkboxTableItem);
TblSetItemStyle(table, row, 1, customTableItem);
TblSetRowUsable(table, row, true);
}
TblSetColumnUsable(table, 0, true);
TblSetColumnUsable(table, 1, true);
TblSetCustomDrawProcedure(table, 1, OnDrawPluginData);
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/