Hi guys,

I am having trouble displaying some text in my table.  Here is a code
snippet:

void DrawFunction (VoidPtr pTable, Int16 row, Int16 column, RectanglePtr
bounds)
{
   FormPtr pForm = FrmGetActiveForm ();
   CharPtr     pText;

   pText = "Test";

   // draw it
   WinDrawChars (pText, StrLen (pText), bounds->topLeft.x,
bounds->topLeft.y);

   return;
}

void ListFill (FormPtr pForm)
{

   Int16 i;
   Int16 uRecordNum;
   Int16 Rows;

   UInt16 uIDTable = FrmGetObjectIndex (pForm, tblMemo );
   TablePtr pTable = FrmGetObjectPtr (pForm, uIDTable);

   Rows = TblGetNumberOfRows (pTable);

    // set our draw procedure callback for each column
   TblSetCustomDrawProcedure (pTable, 0, DrawFunction );
   TblSetCustomDrawProcedure (pTable, 1, DrawFunction );

   uRecordNum = 0;

   for (i = 0; i < Rows; i++, uRecordNum++)
   {
      // set the cells to have custom drawing
      TblSetItemStyle  (pTable, i, 0, customTableItem );
      TblSetItemInt (pTable, i, 0, uRecordNum);
      TblSetItemStyle  (pTable, i, 1, customTableItem );
      TblSetItemInt (pTable, i, 1, uRecordNum);

      // set the row to be unusable to start
      TblSetRowUsable (pTable, 0, false);

      // force a row redraw
      TblMarkRowInvalid (pTable, i );
   }

    TblSetRowUsable (pTable, 0, true);

   // set the columns to be usable
   TblSetColumnUsable  (pTable, 0, true );
   TblSetColumnUsable  (pTable, 1, true );

   return;
}




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to