Hi,
sorry if I reply only now, but this is what happen with projects
schedule...
"Van Nguyen" <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have TblSetCustomDrawProcedure (tableP, column0,
> MyFormDrawRecord);
> in my program. MyFormDrawRecord is the call back
> function define as follows
>
> static void MyFormDrawRecord(MemPtr tableP, Int16 row,
> Int16 column, RectanglePtr bounds)
> {
>
[SNIP]
>
> }
>
> In my program I have a table which loads all the DB's
> names created for this app at start up. User can
> select any name and delete it from the table. Let's
> say I have 4 records:
>
> 1- DB1 // row 0, colum 0
> 2- DB2 // row1, "
> 3- DB3 // row2, "
> 4- DB4 // row3, "
>
> If I ever select the last record in this table -->
> DB4, delete it, and the select any other records, for
> instance, DB2, the the system calls the call back
> function, and passes in row = 3, column = 0 which is
> of DB4 (already deleted) into TblGetItemInt and
> returns recordnum = 3. DmGetRecord fails because
> record 3 is no long in the database. I am very
> surprised as why it does not pass in row = 1, column =
> 0 for DB2 I just selected.
>
> Since I don't have control over what the system passes
> in for row and column to my call back function, I
> don't know how to fix it.
>
> I wonder how, where, and when it gets this data?
>
> After I delete a record, I call a function to reload
> the table, and also call TblRedrawTable. There is no
> problem if I delete other records, and not the last
> one, or after I delete the last one, go to another
> form, then come back and select another record, then
> everything works.
>
> Has anyone seen this before? Any help or suggestions
> you can pass along very much appreciated. Please help
> me!
> Thanks!
>
>
> =====
> Best regards,
>
> Van Nguyen.
>
First of all a question:
Where, in your code, you set up the intValue filed for the table items?
Second, a (hopefully correct) annotation.
Your callback procedure is called when the system needs to redraw one or
more cell in a table.
If you set all the table as invalid (using TblMarktableInvalid), when you
redraw the table, your callback is called for all the rows.
Otherwise, if you set only a row as invalid (using TblMarkRowInvalid), when
you redraw the table, your callback is called for only the invalid row.
Said this, I think it's possible that you set all the table as invalid and
that you don't handle correctly the situation of the redraw of an empty cell
(a cell not linked to a record in a database).
Best regards
Pietro
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/