Oops appears to be as I'm calling TblSetCustomProcedure() before I call
FrmDoDialog(), as if I put the InitialiseTable() call after the
FrmDrawForm(dlg) and then a call to TblDrawTable() in the dlg's event loop
(PluginsDlgHandleEvent) then it all works fine - well it doesn't error out
at least.

The question is .... what event should I do the initial TblDrawTable on - I
don't appear to get a frmOpenEvent() or frmUpdateEvent() from FrmDoDialog().
Anybody know what event I may be able to catch - or how to cause one
here...?

Cheers, ScottP

"ScottP" <[EMAIL PROTECTED]> wrote in message
news:99952@;palm-dev-forum...
>
> 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/

Reply via email to