Bug reported to [EMAIL PROTECTED]
Fields should produce a fldChangedEvent when cursor key events cause it to scroll.
These events are used by the application to update the scroll bar, so without them,
the scroll bar remains as it was. The code that handles leftArrowChr in FldHandleEvent
should call FldSendChangeNotification when it moves the cursor up to the end of the
previous line, and scrolling is necessary to make the previous line visible. This bug
is also present with the other three directions of cursor movement.
Which versions of Palm OS have this bug:
* Palm OS 2.0 and later, including 3.1.
* Bug is not in Palm OS 1.0 because it doesn't have scroll bars.
Scenario:
* Go to the Memo Pad application.
* Choose the small font.
* Enter the numbers from 1 to 12, one number per line, entering the return stroke
between each number, but not after the last number. You now have 12 lines of text in a
field which displays only 11 lines at a time (in the small font).
* Drag the scroll car down to the bottom, so the number 2 is at the top of the screen.
* Tap to place the insertion point just to the left of the number 2 at the top of the
screen, and enter the cursor left stroke. This will move the cursor to the end of the
first line of text in the field, causing the field to scroll up. The number 1 is now
at the top of the screen, so the scroll car should be at the top. Instead, the scroll
car will still be at the bottom.
* Try to drag the scroll car down. You can't scroll down to see the number 12 without
dragging the car up first.
Workaround:
Use the following "fixed" version of FrmDispatchEvent in your application's event loop:
Boolean FixedFrmDispatchEvent(EventPtr eventP)
{
FieldPtr fieldP;
Word scrollPos;
unsigned char ch;
Boolean result;
if (eventP->eType != keyDownEvent)
return FrmDispatchEvent(eventP);
fieldP = GetFocusObjectPtr();
if (! fieldP)
return FrmDispatchEvent(eventP);
ch = eventP->data.keyDown.chr;
if (! (ch == upArrowChr || ch == downArrowChr || ch == leftArrowChr || ch ==
rightArrowChr))
return FrmDispatchEvent(eventP);
scrollPos = FldGetScrollPosition(fieldP);
result = FrmDispatchEvent(eventP);
if (result && scrollPos != FldGetScrollPosition(fieldP))
FldSendChangeNotification(fieldP);
return result;
}
-
Danny Epstein * mailto:[EMAIL PROTECTED]
Applied Thought Corporation * http://www.appliedthought.com
Flytrap for PalmOS * http://www.appliedthought.com/flytrap