×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2012
    Location
    bangladesh
    Posts
    5

    problem in UI button with Richtext Editor and scroll bar

    hello everyone,

    i have work in Symbain carbide.C++ S60 5th edition. In UI design i drag and drop a TextEditor, a RichText Editor and a Button. My work is ..... dynamically write an input in TextEditor and show the Output in Richtext Editor when the Button is pressed. it work well firstly. But problem is ... when i add a scroll bar in Richtext Editor the Button event is not work.
    please anyone solve my problem as soon as possible.

    I add my scroll bar code in the following:
    -------------------------------------------
    class CDyn_Size_IMContainer : public CCoeControl
    ,MCoeControlObserver{
    private:
    CEikEdwin* iTextEditorInput;
    CEikLabel* iEnterTextLabel;
    CEikRichTextEditor* iRichTextOutput;
    CAknButton* iSendBtn;
    CEikLabel* iRichTextLabel;


    void HandlePointerEventL(const TPointerEvent &aPointerEvent);

    }

    --------
    void CDyn_Size_IMContainer::ConstructL(
    const TRect& aRect,
    const CCoeControl* aParent,
    MEikCommandObserver* aCommandObserver )
    {
    if ( aParent == NULL )
    {
    CreateWindowL();
    }
    else
    {
    SetContainerWindowL( *aParent );
    }
    iFocusControl = NULL;
    iCommandObserver = aCommandObserver;
    InitializeControlsL();
    SetRect( aRect );
    ActivateL();

    SetRichTextOutputFormattingL();

    // ----main scroll bar code in richtext editor ---------------------------------
    iRichTextOutput->CreateScrollBarFrameL()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);

    iRichTextOutput->TextLayout()->ReformatVerticalSpaceL(); //To remove vertical spaces
    iRichTextOutput->TextLayout()->RestrictScrollToTopsOfLines( EFalse );

    ///-----------------------------------------------------------------------------
    SetRect( aRect );
    ActivateL();

    }
    --------------
    void CDyn_Size_IMContainer::SizeChanged()
    {
    CCoeControl::SizeChanged();
    LayoutControls();

    //-------screen content dynamic size changed ----------------------------
    TSize screenResol;
    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EApplicationWindow, screenResol);

    //----------------------------------------------------------------------------------
    TRect rect = Rect();

    TInt StatusLineHeight = iRichTextLabel->Font()->HeightInPixels()+ 6;
    iRichTextLabel->SetExtent(TPoint(0,(screenResol.iHeight)/42.66 ) , TSize(rect.Width(), StatusLineHeight));

    TRect ScrollBarRect;
    CEikScrollBar* scrlBar =iRichTextOutput->ScrollBarFrame() ? iRichTextOutput->ScrollBarFrame()->VerticalScrollBar(): NULL;
    if (scrlBar)
    {
    ScrollBarRect = iRichTextOutput->ScrollBarFrame()->VerticalScrollBar()->Rect();

    }



    iRichTextOutput->SetExtent(TPoint(0, StatusLineHeight), TSize(rect.Width() - ScrollBarRect.Width(),(screenResol.iHeight)/2.13));


    }
    -------------
    void CDyn_Size_IMContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
    {
    static TInt firstpoint;

    if(aPointerEvent.iType == TPointerEvent::EButton1Down)
    {
    firstpoint = aPointerEvent.iPosition.iY;
    }

    if(aPointerEvent.iType == TPointerEvent::EDrag)
    {
    if(aPointerEvent.iPosition.iY > firstpoint)
    {
    iRichTextOutput->TextView()->ScrollDisplayL(TCursorPosition::EFLineUp);
    iRichTextOutput->MoveDisplayL(TCursorPosition::EFLineUp); //Scrolls the text either horizontally or vertically without affecting the cursor’s position

    DrawNow();
    iRichTextOutput->DrawNow();

    }
    else
    {
    iRichTextOutput->TextView()->ScrollDisplayL(TCursorPosition::EFLineDown);
    iRichTextOutput->MoveDisplayL(TCursorPosition::EFLineDown); //Scrolls the text either horizontally or vertically without affecting the cursor’s position

    DrawNow();
    iRichTextOutput->DrawNow();

    }
    }
    }

  2. #2
    Nokia Developer Expert
    Join Date
    Sep 2011
    Posts
    382

    Re: problem in UI button with Richtext Editor and scroll bar

    CountComponentControls() and HandleControlEventL() would be nice to check as well according to the wiki.

Similar Threads

  1. Button in a RichText Editor?
    By inforn in forum Symbian User Interface
    Replies: 3
    Last Post: 2011-06-23, 02:05
  2. Problem With RichText Editor
    By devdattac in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-12-22, 09:14
  3. problem with scroll bar in richtext editor
    By itssandesh in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-05-06, 07:30
  4. Problem showing the SMS body text on RichText Editor
    By saadmansur in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2007-06-21, 11:30
  5. Richtext editor box
    By ticktock in forum Symbian
    Replies: 1
    Last Post: 2007-04-01, 16:26

Posting Permissions

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