×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jun 2003
    Posts
    83

    Multiple Textboxes - naviagation

    Hi,

    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???

    Ta!

    Ash

  2. #2
    Regular Contributor
    Join Date
    Jun 2003
    Posts
    83
    Hi Again!

    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
    ..
    ..
    ..
    }

  3. #3
    Registered User
    Join Date
    Apr 2003
    Location
    Turkey
    Posts
    12
    Hi,

    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.

    it should be like this.

    in OfferKeyEventL
    //*****
    if (iFirstControl->IsFocused())
    {
    if(aKeyEvent.iCode == EKeyDownArrow)
    {
    Response = iFirstControl-> OfferKeyEventL(aKeyEvent,aType);
    if(Response==EKeyWasNotConsumed)
    {
    iFirstControl->SetFocus( EFalse );
    iSecondControl->SetFocus( ETrue );
    }
    }
    }


    Cemal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×