×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    4

    CEikEdwin line feed

    I've created a CEikEdwin editor in a container (CCoeControl) just as shown
    in the SDK editor sample. the editor works perfectly. only line-feed character
    in special character table seems to be not working. listening key events for
    EKeyLineFeed, EKeyEnter, ... in container's OfferKeyEventL function does not
    solve the problem. I could not find any resource definition about
    enabling/disabling line-feeds.

    is there any way to enable line-feed character in special character table?

    thanks.
    Akermen


    resource definition of editor:
    ------------------------------------------
    RESOURCE EDWIN r_test_edwin
    {
    flags = EAknEditorFlagDefault;
    width = 0;
    maxlength = 0;
    }
    ------------------------------------------

    creation of the editor:
    ------------------------------------------
    TResourceReader reader;
    iCoeEnv->CreateResourceReaderLC(reader, R_TEST_EDWIN);

    iEditor = new (ELeave) CEikEdwin;
    iEditor->SetContainerWindowL(*this);
    iEditor->SetAknEditorFlags(EAknEditorFlagDefault);
    iEditor->SetAknEditorAllowedInputModes(EAknEditorAllInputModes);
    iEditor->SetAknEditorInputMode(EAknEditorTextInputMode);
    iEditor->EnableCcpuSupportL(ETrue);
    iEditor->SetBorder(TGulBorder::ESingleGray);
    iEditor->ConstructFromResourceL(reader);

    CleanupStack::PopAndDestroy();

    iEditor->CreatePreAllocatedScrollBarFrameL();
    iEditor->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);

    const TSize size(aRect.Width(), aRect.Height() - iOffsetTop);
    const TPoint pos(0, iOffsetTop);

    iEditor->AddEdwinObserverL(this);
    iEditor->SetExtent(pos, size);
    iEditor->SetFocus(ETrue);

    TCharFormat cFormat;
    TCharFormatMask cFormatMask;
    cFormat.iFontSpec = pFont->FontSpecInTwips();
    cFormatMask.SetAll();
    CGlobalText* pText = (CGlobalText*)iEditor->Text();
    pText->ApplyCharFormatL(cFormat, cFormatMask, 0, 0);

    TParaFormatMask mask;
    mask.SetAll();
    iFormat = CParaFormat::NewL();
    iFormat->iLineSpacingInTwips = 100;
    iFormatLayer = CParaFormatLayer::NewL(iFormat, mask);
    iEditor->SetParaFormatLayer(iFormatLayer);
    ------------------------------------------

  2. #2
    Registered User
    Join Date
    Jul 2004
    Posts
    4

    Re: CEikEdwin line feed

    'lines' variable must be added to the edwin resource definition:
    -----------------------------------------------------
    flags = EEikEdwinAllowUndo;
    width = 0;
    lines = 2;
    -----------------------------------------------------

    with this change edwin accepts line feed character from special character table.

Similar Threads

  1. Replies: 3
    Last Post: 2007-01-18, 11:27
  2. problem with Code Warrior 5.2
    By mayankkedia in forum Symbian
    Replies: 4
    Last Post: 2006-06-22, 08:26
  3. Get line number from CEikEdwin
    By nimbus_cloud in forum Symbian
    Replies: 1
    Last Post: 2005-11-25, 03:15
  4. code warrior problems
    By mayankkedia in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2004-10-25, 06:59
  5. problem with codewarrior 5.2
    By mayankkedia in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2004-09-27, 16:08

Posting Permissions

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