The drawing of the scrollbar is done by this method
void DrawScrollBar(FormType * form,ScrollBarType *
ScrollBarPtr)
{
if((MainEndIndex - MainStartIndex) > 8)
{
ScrollBarPtr =
FrmGetObjectPtr(form,FrmGetObjectIndex(form,ScrollList));
SclSetScrollBar (ScrollBarPtr,0, 0, (MainEndIndex -
MainStartIndex)-9,9);
FrmShowObject(form,FrmGetObjectIndex(form,ScrollList));
}
else
{
FrmHideObject(form,FrmGetObjectIndex(form,ScrollList));
}
}
> I added the scrollbar in the resource (.rcp) file
>
> SCROLLBAR ID ScrollList AT ([EMAIL PROTECTED]
> [EMAIL PROTECTED] 7 110) VALUE 0 MIN 0 MAX 0 PAGESIZE
> 0
>
> and in the .c file i added the following code
>
> static Boolean MainFormHandleEvent(EventPtr event)
> {
> ScrollBarType * ScrollBarPtr;
> ......some code here......
> ... some switches here.....
> case sclRepeatEvent:
> {
> newval = event->data.sclRepeat.newValue;
>
MainFormInit(form,MainStartIndex+newval,MainEndIndex);
> FrmDrawForm(form);
> handled = false; //Handled should be set to false
> }
> break;
> }
>
> Now at first if i wanted the scrollbar to be hidden
> i
> just did
>
FrmHideObject(form,FrmGetObjectIndex(form,ScrollList)).
>
> The scrollbar return 2 types of values one is the
> new
> value it went to and the other on which it was
> prevously at. Now from these values i calculated
> which
> records to show in the table . MainFormInit method
> does that displaying accordingly.
>
> Hope this helps
>
> Husnain
>
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/