At 1:50 PM +0100 10-02-00, Gordon, Douglas wrote:
>I have a table with four columns that uses custom draw procedures. Each row
>is associated with a database record, and various fields in a record are
>used to display information in that row. The issue is that my custom draw
>procedure is called for each column in a particular row, so currently it has
>to query the record, lock it, get the data for the specific column, and
>unlock it.
Also note that in OS 3.5, your custom draw procedures will be called MUCH
more often. In order to highlight properly in color, the cell is redrawn
completely now. (The old way was just to invert the bits in the area, but
that doesn't work with colors.) So that's even more incentive to get the
record loading code out of the table drawing routine.
One thing you might do is just load and lock all the records that are
currently on display in the table. You can use one of the extra fields in
one of the table cells to store the pointer to the actual record for that
cell, or use the row ID for that. Then your table drawing code can just
assume the record is already locked.
--Bob
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html