Hi!
   I am facing a weird problem with scroll bars.
When ever I scroll it doesn't show the updated table.
Instead the table is shown with a few rows deleted or added.
Please can someone tell me the cause for this.
      In the constructor I have given the maxvalue as 0.
Thank You!!!

 case sclExitEvent:
     
                 cursor = findIndex( event>data.sclExit.newValue );
                  initIndexes();
                  drawTable();
                  break;           
        

static UInt findIndex( UInt scrollValue )
{
        UInt index = 0;
        DmSeekRecordInCategory( gDB, &index, scrollValue,
                        dmSeekForward, dmAllCategories );
        return( index );
}

          

static void initIndexes( void )
{
        
        
        frm = FrmGetActiveForm();
        
        // CH.9 For each table row
        for( count = 0; count < rowsInTable; count++ )
        {
                // CH.9 Find the next matching record
                if( DmSeekRecordInCategory( gDB, &index, 0,
                                dmSeekForward, dmAllCategories ) )
                {
                        // CH.9 No more records. Fill the rest of the array with
                        // 0xffff
                        for( ; count < rowsInTable; count++ )
                                tableIndex[count] = 0xffff;
                        break;
                }
                        
                // CH.9 Put the index number in the array
                tableIndex[count] = index;
                index++;
        }
        
        // CH.9 Set the cursor to a known category record
        cursor = tableIndex[0];
        
        
        // CH.8 Update the arrow buttons and scrollbars
        numRecsInCategory = DmNumRecordsInCategory( gDB, dmAllCategories );
        if( numRecsInCategory > rowsInTable )
        {
                UInt    position = DmPositionInCategory( gDB, cursor,dmAllCategories );
                
                
SclSetScrollBar( FrmGetObjectPtr(frm,Form1Scrollbar1ScrollBar), position, 
0,numRecsInCategory
- rowsInTable, rowsInTable );
        }
        
        
        else    
        {
                // CH.8 Hide the scrollbar
                SclSetScrollBar( FrmGetObjectPtr(frm,Form1Scrollbar1ScrollBar), 0, 0, 
0, 0
);
                }
        
        
                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