I have played around a bunch with the page size.  I have set it to one and
also 14 which is the number of lines in the field.  I have set min to 0 and
max to the number of lines in the field so the value of 14 makes the most
sense to me but for some reason that didn't work.

On 7/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hmm, I dunno. Maybe the pagesize is too high? Thus it would jump from
> beginning to end (and vice versa) in one click.
>
> ----- Original Message ----
> From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> To: Palm Developer Forum <palm-dev-forum@news.palmos.com>
> Sent: Monday, July 16, 2007 11:12:10 AM
> Subject: Scrolling Fields
>
> I'm trying to set up a field in my application that works with a scroll
> bar. I have everything laid out but I am having trouble getting the field to
> respond to changes in the scrollbar. The field just stays put or jumps all
> the way to the end or the beginning when I attempt to move the scrollbar.
> When I move through and edit the field the scrollbar responds perfectly it
> just doesn't work the other way around. Here is the function that I call
> when I receive the SclRepeatEvent.
>
> Boolean MainForm::updateField(Int16 oldpos, Int16 newpos, struct
> ScrollBarType * bar)
> {
>     struct FormType * frmP = FrmGetFormPtr(Messages);
>     FieldType *field;
>     UInt16 fieldIndex;
>     fieldIndex = FrmGetObjectIndex(myForm, Messages);
>     field = (FieldType *)FrmGetObjectPtr(myForm, fieldIndex);
>     UInt16 scrollPos = 0;
>     UInt16 textHeight = 0;
>     UInt16 fieldHeight = 0;
>     UInt16 maxValue = 0;
>     const char * myChars = FldGetTextPtr(field);
>     fieldHeight = FldCalcFieldHeight(myChars, 140);
>     Int16 minimum = 0;
>     Int16 maximum = 0;
>     Int16 value;
>     Int16 pageSize;
>     UInt16 linesToScroll = (UInt16) newpos - oldpos;
>     WinDirectionType direction = winUp;
>     if(linesToScroll<0)
>     {
>         linesToScroll = -1 * linesToScroll;
>         direction = winDown;
>     }
>     FldScrollField (field, linesToScroll,direction);
>     // Update the scroll bar.
>     SclGetScrollBar (bar, &value, &minimum, &maximum, &pageSize);
>     if (direction == winUp)
>     {
>         value -= (Int16) linesToScroll;
>     }
>     else
>     {
>         value += (Int16) linesToScroll;
>     }
>     SclSetScrollBar (bar, value, (Int16) 0, (Int16) fieldHeight,
> pageSize);
>     return true;
> }
> --
> For information on using the ACCESS Developer Forums, or to unsubscribe,
> please see http://www.access-company.com/developers/forums/
>
>
>
>
> --
> For information on using the ACCESS Developer Forums, or to unsubscribe,
> please see http://www.access-company.com/developers/forums/
>

-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to