×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2008
    Location
    India
    Posts
    219

    Question Container with scroll problem??

    I need to add scroller in ma container so tat i can scroll through all labels and editors which are there in container.
    I have coded this..

    void CMyContainer::CreateScrollBars()
    {
    iScrollBarFrame = new (ELeave) CEikScrollBarFrame(this, NULL);
    iScrollBarFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn);
    iScrollBarFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::ENormalScrollBar);
    TEikScrollBarFrameLayout layout;
    iVDsSbarModel.iScrollSpan = 310;
    iVDsSbarModel.iThumbSpan = 10;
    iVDsSbarModel.iThumbPosition = 0;
    TRect t1Rect = TRect(0,0,Rect().Width(),Rect().Height());
    TRect t2Rect = TRect(0,0,Rect().Width(),310);
    iScrollBarFrame->TileL(&iHDsSbarModel, &iVDsSbarModel,t1Rect,t2Rect, layout);
    iScrollBarFrame->DrawScrollBarsNow();
    ActivateL();
    }

    and
    void CMyView:oActivateL( const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,const TDesC8& /*aCustomMessage*/)
    {
    if(!iContainer)
    {
    iContainer = CMyContainer::NewL(ClientRect());
    iContainer->SetMopParent(AppUi());
    //iContainer->SetMopParent(this);
    iContainer->CreateScrollBar();
    AppUi()->AddToStackL( *this, iContainer );
    }
    }


    but still i cant see any scroller or any scroller effect. Can anybody please tell me how what else should i do to have scroller in my container.

    Thanx in advance.

    regards,
    Sunil Bhardwaj

  2. #2
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    213

    Re: Container with scroll problem??

    Did you update these functions?
    CountComponentControls() const
    ComponentControl( TInt aIndex ) const

  3. #3
    Registered User
    Join Date
    Sep 2007
    Location
    Noida, India
    Posts
    67

    Re: Container with scroll problem??

    hi,
    try this code


    iScroll = new(ELeave) CEikScrollBarFrame(this,NULL,ETrue);
    iScroll->SetScrollBarVisibilityL(CEikScrollBarFrame::EOn,CEikScrollBarFrame::EOn);
    iScroll->CreateDoubleSpanScrollBarsL(ETrue,EFalse);

    iVDsSbarModel.iScrollSpan = 1;
    iVDsSbarModel.iThumbPosition = 1;
    iVDsSbarModel.iThumbSpan = 1;

    iHDsSbarModel.iScrollSpan = 1;
    iHDsSbarModel.iThumbPosition = 1;
    iHDsSbarModel.iThumbSpan = 1;

    TEikScrollBarFrameLayout layout;
    layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;

    TRect iRect(Rect());
    iScroll->TileL( &iHDsSbarModel, &iVDsSbarModel, iRect, iRect, layout );

    iScroll->MoveVertThumbTo(iVDsSbarModel.iThumbPosition);
    iScroll->MoveHorizThumbTo(iHDsSbarModel.iThumbPosition);
    iScroll->DrawScrollBarsNow();
    Thanks & Regards,

    Avinash

  4. #4
    Registered User
    Join Date
    Oct 2008
    Location
    India
    Posts
    219

    Re: Container with scroll problem??

    No....Could u tell me how to update these functions??

  5. #5
    Registered User
    Join Date
    Sep 2007
    Location
    Noida, India
    Posts
    67

    Re: Container with scroll problem??

    update the following value in offerkeyeventL method

    if((iVDsSbarModel.iThumbPosition + 1) < iVDsSbarModel.iScrollSpan )
    {
    iScrollBarFrame->MoveVertThumbTo(++iVDsSbarModel.iThumbPosition);
    }

    DrawNow();
    iScrollBarFrame->Tile(&iVDsSbarModel);
    //iScrollBarFrame->DrawScrollBarsNow();
    iScrollBarFrame->MoveVertThumbTo(iVDsSbarModel.iThumbPosition);
    Thanks & Regards,

    Avinash

  6. #6
    Registered User
    Join Date
    Oct 2008
    Location
    India
    Posts
    219

    Re: Container with scroll problem??

    Thxx Avinash....
    Now my scroll bar is visible........

    Did you update these functions?
    CountComponentControls() const
    ComponentControl( TInt aIndex ) const
    hi assayag
    My problem was not of updation it was not visible actually.....now i have to update it.......by the way thxx for your quick reply.....



    Thxx & regards,
    Sunil Bhardwaj

Similar Threads

  1. Modules required :)
    By neil.young in forum Symbian
    Replies: 20
    Last Post: 2009-06-07, 11:35
  2. Scroll bar problem Nokia 5800
    By aamitgupta in forum Symbian User Interface
    Replies: 3
    Last Post: 2009-05-21, 14:09
  3. Container in a view problem
    By MananW in forum Symbian
    Replies: 3
    Last Post: 2006-11-23, 09:36
  4. Replies: 1
    Last Post: 2006-11-10, 05:31
  5. Weird problem with scroll bar
    By yusa- in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-09-24, 08:56

Posting Permissions

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