I simply have my form laid out with a srollbar along side the table.

My application tracks the number of items that I conceivably represent in the table 
(e.g. 20 - although the table height is only 3), I then keep track of which row in my 
grand list is the top row for the table.  The scrollbar is then set with a routine as 
follows:

-------------------------------------
void UpdateThreadScroll(FormPtr form, UInt16 fieldID, UInt16 scrollbarID)
{
  ScrollBarPtr scroll;
  UInt16 numItems = GetCurrentTopicSize();    // This is the overall size
  Int16 fieldHeight = 3;                      // My table height
  Int16 maxValue;

  if (numItems > fieldHeight)
    maxValue = numItems - fieldHeight;
  else if (TopRow > 0)
    maxValue = TopRow;
  else
    maxValue = 0;

  scroll = (ScrollBarPtr)GetObjectPtr(form, scrollbarID);

  SclSetScrollBar(scroll, TopRow, 0, maxValue, fieldHeight-1);
}

-------------------------------------

UpdateThreadScroll is then called whenever the table scroll bar needs to be updated 
(either due to a change in position, or a change in size).

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

Reply via email to