prc-tools 2.95.3
pose 3.5
palmos33-en-v-dbg.rom on pose
PalmOS v4.0 on physical unit


I have a scrollable field which is exhibiting odd behaviour. If the first line
of the field displays the beginning of the field text (the scroll car is at
the top), selecting text within the field by tap'n'drag does not work - the
insertion point remains in place and no text is highlighted.

If the scroll bar is moved so that the end of the field is visible, the text
can be selected. However, if text is added to the field to move the scroll
bar, once again no text can be selected. The text can only be selected if the
scroll car is at the lowest limit of movement.

Has anyone seen this behaviour before? A quick google and search on the Palm
dev kb turned up nothing..

I'm thinking I may be doing something wrong in handling sclRepeatEvent. Here's
the code for that:

    WinDirectionType dir;
    UInt16 scrollLines;

    if (ev->data.sclRepeat.value > ev->data.sclRepeat.newValue) {
      dir = winUp;
      scrollLines = ev->data.sclRepeat.value - ev->data.sclRepeat.newValue;
    } else {
      dir = winDown;
      scrollLines = ev->data.sclRepeat.newValue - ev->data.sclRepeat.value;
    }

    FldScrollField(_fld_ptr, scrollLines, dir);

    return true;


and for fldChangedEvent:


    UInt16 scrollPos, textHeight, fldHeight, maxValue;

    FldGetScrollValues(_fld_ptr, &scrollPos, &textHeight, &fldHeight);

    if (textHeight > fldHeight) {
      maxValue = textHeight - fldHeight;
    } else if (scrollPos) {
      maxValue = scrollPos;
    } else {
      maxValue = 0;
    }

    SclSetScrollBar(_scl_ptr, scrollPos, 0, maxValue, fldHeight - 1);

    return true;


Any clues as to what I'm doing wrong?


Si.


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

Reply via email to