Greetings!

I'm having a problem with dynamic table listings
displaying un-called-for check boxes when I display
a subset list of topics in my databases.

I have spent the past three weeks perusing and
reading this forum's postings (back to 8/18/1999)
to no avail.  I have searched escribe and the KB, but
perhaps I haven't searched for just the right stuff....

Background:
I have three different types of database records, in
a hierarchical relationship, each record type is
different enough such that I am using three databases.
A selection from database 1 will display related
records from database 2, and a selection from
database 2 will display related records from
database 3.  Think of an org chart type of hierarchy.
I cannot use categories, since I'm using the Palm
DB and I have more than 15 types of records in each
DB, plus this is a read-only application.

I need to support PalmOS 3.0+ and I use CodeWarrior
v7.0 for Windows.

I am successfully navigating the tables from DB1 to
DB2 to DB3, however, when I get my subset of records
displayed based on the previous DB selection, if the
last record displayed is not the last record in the DB,
I get actual working checkboxes displayed in my table
after my subset is displayed.  This occurs when I have
fewer records than table rows to display only when I
am displaying records other than the final/last record
in the database.  I am not choosing this Table ItemStyle.

I'm using the code from the memoDB application, as a
starting base, however I am not using categories, nor
am I using hidden/secret record attributes, but I
wish to display a subset of records in my database
in a table (one column) form - like the memo ListView.

How do I keep the checkboxes from displaying?
Is this something I'm either doing or not doing?
Am I not going after this problem the 'best' way?
Am I just not seeing some simple error?

Any help would be greatly appreicated.

code snippet to select the start of the subset of
records to display (they're sorted by the topic I'm
selecting from the previous table (and DB)):
------------------------------8<----------------------------
...
CurrentCategory = dmAllCategories;
table = FrmGetObjectPtr( frm, FrmGetObjectIndex (frm,ReadingListTable));
rowsInTable = ListViewNumberOfRows(table);
CurrentRecord = noRecordSelected;
status = DmSeekRecordInCategory( gDBrd, &RDrecordNum, 0, dmSeekForward,
CurrentCategory);
if( dmErrSeekFailed != status && dmErrIndexOutOfRange != status) {
// we found a record in this category, now determine if it's in the
topic selected
        g_rH = DmQueryRecord( gDBrd, RDrecordNum);
        g_rP = MemHandleLock( g_rH);
        readrec_ss_code = g_rP->stud_code;
        if( readrec_ss_code == g_ss_code ) { // we've got a match
                RDTopVisibleRecord = RDrecordNum;
                found = true;
        }
        else    // no match, go on
                found = false;
        MemHandleUnlock( g_rH);

        if( !found) { // look beyond the first record for a match
                for( i = 1; i < DmNumRecordsInCategory(gDBrd, CurrentCategory); i++) {
                        if( errNone != DmSeekRecordInCategory( gDBrd, &RDrecordNum, 1,
dmSeekForward, CurrentCategory))
                                continue;
                        else {  // We found a potential match
                                g_rH = DmQueryRecord( gDBrd, RDrecordNum);
                                g_rP = MemHandleLock( g_rH);
                                readrec_ss_code = g_rP->stud_code;
                                if( readrec_ss_code == g_ss_code ) {    // we've got a 
match
                                        RDTopVisibleRecord = RDrecordNum;
                                        MemHandleUnlock( g_rH);
                                        break;  // we found our top visible record,
                                }               // let's go load the table....
                                // else no match, go on
                        }
                }
        }
}

RDListViewLoadTable(frm);

// Set the callback routine that will draw the records.
TblSetCustomDrawProcedure( table, 0, RDListViewDrawRecord);
TblSetColumnUsable( table, 0, true);    
------------------------------8<----------------------------


code snippet to load the table with the records:
------------------------------8<----------------------------
...
numRows = TblGetNumberOfRows(table);
for (row = 0; row < numRows; row++) {
        recordH = DmQueryNextInCategory(gDBrd, &RDrecordNum, CurrentCategory);
        if( recordH) {
                g_rP = MemHandleLock( recordH);
                if( g_rP->stud_code != g_ss_code) {
                        MemHandleUnlock( recordH);
                        this_one = false;
                        continue;
                }
                else {
                        MemHandleUnlock( recordH);
                        match++;
                        this_one = true;
                }
        }
        else
                this_one = false;
        
        // If the record was found, store the record number in the table item,
        // otherwise set the table row unusable.
        if(this_one && match && recordH && (tableHeight >= dataHeight +
lineHeight)) {
                TblSetRowID( table, row, RDrecordNum);
                TblSetItemStyle( table, row, 0, customTableItem);
                TblSetItemFont( table, row, 0, ListFont);
                TblSetRowHeight( table, row, lineHeight);
                DmRecordInfo( gDBrd, RDrecordNum, NULL, &uniqueID, NULL);
                        
                if( (TblGetRowData( table, row) != uniqueID) || ( !TblRowUsable(
table, row)))                           TblSetRowUsable( table, row, true);
                        // Store the unique id of the record in the row.
                        TblSetRowData( table, row, uniqueID);
                        // Mark the row invalid so that it will draw.
                        TblMarkRowInvalid( table, row);
                }
                else {
                        TblSetRowSelectable( table, row, false);
                        TblSetRowUsable( table, row, false);
                }
                if( row+1 < numRows)
                        RDrecordNum++;
                dataHeight += lineHeight;
        }
        else {
                TblSetRowHeight( table, row, lineHeight);
                TblSetRowUsable( table, row, false);
        }
...
------------------------------8<----------------------------


Comments?


Thank you!

Randy


-- 
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