Luca Bertoncello wrote:
> I wrote an application for my Palm.
> In this application I have a TextField with a Scrollbar.
> No problem to managing the TextField and the Scrollbar, but
> I'd like to allow the user to use the "scroll button" (the
> UP/DOWN button on the PDA) to scroll the text.
> Has anyone a good example how I can implement it?
Usually it's something along the lines of:
YourFormHandleEvent(EventType* eventP)
{
...
switch (eventP->eType)
{
...
case keyDownEvent:
if (EvtKeydownIsVirtual(eventP))
{
switch (eventP->data.keyDown.chr)
{
case vchrPageUp:
// Scroll the Field.
FldScrollField(..., winUp);
// Update the scrollbar.
SclSetScrollBar(...);
break;
case vchrPageDown:
// etc.
}
}
}
}
You might want to consult the Memo Pad sample code for a more complete example.
You also might want to handle vchrRockerUp/vchrRockerDown if you want to use
the 5-way navigator for scrolling.
- James
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/