I am facing a very simple problem. I have 2 CEikEdwin controls on a screen and both CEikEdwin objects have multiple lines, how do I navigate from one CEikEdwin object to the other using the up/down arrow keys? Right now, when I press the up/down arrow key, it jumps from one control to another. But my problem is, if the user has entered multiple lines of text in the control and wants to go up/down within the text, they can't.
I need a way to know that what line the cursor is - if there are any lines above/below it, if so scroll to that line within the control, else jump to the next control. Is there any API to do the same???
Solved the previous problem using CusorPos and TextLength, but got a new
problem, when i do a left/right scroll using arrow key, if the cursor
position is at the end of the text in the control, it goes to the begining
of the text... sort of rotates. Only after it has gone to the pos start/end
does it give the code control.... which is not helpful as, I want to jump to
the next control if the cusrson position is zero/end and not scrol to
end/zero text position.
Any ideas how to go about it?
if(aKeyEvent.iCode == EKeyUpArrow || aKeyEvent.iCode == EKeyLeftArrow)
{
// first check if user can scroll within control
// if so scroll till cursor pos = 0
// else jump to next control on top
..
..
}
if(aKeyEvent.iCode == EKeyDownArrow || aKeyEvent.iCode == EKeyRightArrow )
{
// first check if user can scroll within control
// if so scroll till cursor pos at end of text
// else jump to next control below
..
..
..
}
OfferKeyEventL function of Edwin returns EKeyWasNotConsumed if cursor is at last line and you press down arrow. so you can check for this and change Focus if OfferKeyEvent returns EKeyWasNotConsumed.