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
--- Manuel_Garc�a_Urreta
<[EMAIL PROTECTED]> wrote:
> Can you send me the methods for scrolling atable?
>
> Thanks in Advance
>
> Manuel from Argentina
>
> ----- Original Message -----
> From: "husnain malik" <[EMAIL PROTECTED]>
> To: "Palm Developer Forum"
> <[EMAIL PROTECTED]>
> Sent: Thursday, February 19, 2004 10:05 AM
> Subject: Re: Problem implementing ScrollBar with
> Table
>
>
> >
> > I also had some problems while using the Table's
> > scrollbar, therefore i disabled the table's bar
> and
> > added the control scroll bar. I managed to show
> and
> > hide the scroll bar by calculating myself when it
> > should be shown or hidden. If you want i can send
> you
> > the methods, they are easy to understand.
> >
> > Husnain
> > --- Pinaki Roy <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > > i'm strugling to implement ScrollBar with Table
> (
> > > with 10 rows) in my application --and i'm not
> > > getting
> > > much info or code-examples on this on net
> (though
> > > there're lots on scrollBar with Field & List) --
> as
> > > of
> > > now i 'm exactly following the approach given
> in
> > > the
> > > link
> > >
> > > http://www.mixdown.org/~andrew/palm.php
> > >
> > > i've modified SclSetScrollBar() in my
> > > table-initialization function as follows -
> > >
> > > scroll = (ScrollBarPtr) GetObjectPtr(id
> of
> > > my
> > > ScrollBar);
> > >
> > > if (ListNum > numRows) // ListNum=total no of
> data
> > > in
> > > my list to be displayed
> > > SclSetScrollBar(scroll, gTopVisibleItem, 0,
> > > ListNum-numRows, numRows-1);
> > > // numrows= no of rows in a page at a time
> > > else //scrolling not required
> > > SclSetScrollBar(scroll, gTopVisibleItem, 0,
> > > 0,
> > > numRows-1)
> > > and in the "tblEnterEvent:" i purposely made
> > > handled
> > > = false ;
> > >
> > > These are the two changes i 've done on the code
> > > samples gievn in that site and incorporated them
> in
> > > my
> > > application. And it's coming fine for the first
> page
> > > -- but if i scroll down pressing the arrowHead ,
> > > then
> > > the 10th row only is getting displayed
> repeatedly on
> > > the incoming rows -- but if i extract the
> element of
> > > say 13th row (using FldGetTextPtr ) and display
> it
> > > in
> > > the next page -- i 'll get what i wanted ie 13th
> row
> > > of my data list , but in the previous page in
> the
> > > table it's showing the 10th row only--what may
> be
> > > the
> > > reason for this??
> > > can anybody help me please ??
> > > Thanks & Regards
> > > Pinaki
> > >
> > >
> >
>
________________________________________________________________________
> > > Yahoo! India Insurance Special: Be informed on
> the
> > > best policies, services, tools and more.
> > > Go to:
> > >
> http://in.insurance.yahoo.com/licspecial/index.html
> > >
> > > --
> > > For information on using the Palm Developer
> Forums,
> > > or to unsubscribe, please see
> > http://www.palmos.com/dev/support/forums/
> >
> >
> > __________________________________
> > 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/
> >
> > --
> > Este mensaje ha sido analizado por
> DeMonteGrande.com.ar MailScanner
> > en busca de virus y otros contenidos peligrosos, y
> se considera que
> > est� limpio.
>
>
> --
> Este mensaje ha sido analizado por
> DeMonteGrande.com.ar MailScanner
> en busca de virus y otros contenidos peligrosos, y
> se considera que
> est� limpio.
>
>
> --
> For information on using the Palm Developer Forums,
> or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/
__________________________________
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/