×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    10

    container with scroll

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

    iModel = TEikScrollBarModel(310, 10, 0);
    iSBFrame = new (ELeave) CEikScrollBarFrame(this, this, ETrue);
    iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn);
    iSBFrame->Tile(&iModel);
    iSBFrame->MoveVertThumbTo(iModel.iThumbPosition);
    iSBFrame->DrawScrollBarsNow();


    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,
    Younker

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: container with scroll

    Do you return iSBFrame as a component control?

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    10

    Re: container with scroll

    i think iSBFrame should not be returned as component control.
    Btw itried doing that...it gave me an error
    "illegal implicit conversion from 'CEikScrollBarFrame *const ' to 'CCoeControl *' "

    There is something somewhere, am missing

  4. #4
    Registered User
    Join Date
    Jun 2005
    Posts
    10

    Re: container with scroll

    Here is the whole code....

    void CMyContainer::ConstructL( const TRect& aRect)
    {

    CreateWindowL();

    iImage = new (ELeave) CEikImage;
    iImage->CreatePictureFromFileL(KBitmapFile,EMbmBitmapheaderLoading);
    iImage->SetContainerWindowL(*this);
    iImage->SetExtent(TPoint(0,0), TSize(176,176));

    iNameTtl = new (ELeave) CEikLabel;
    iNameTtl->SetContainerWindowL(*this);
    iNameTtl->SetExtent(TPoint(0,130), TSize(125,20));
    iNameTtl->SetTextL(_L("Name: "));

    iNameEdtr = new (ELeave) CEikEdwin;
    iNameEdtr->ConstructL(0,1,50,1);
    iNameEdtr->SetContainerWindowL(*this);
    iNameEdtr->SetTextL(&iParser.Name());
    iNameEdtr->SetExtent(TPoint(0,150), TSize(176,20));

    iTagTtl = new (ELeave) CEikLabel;
    iTagTtl->SetContainerWindowL(*this);
    iTagTtl->SetExtent(TPoint(0,170), TSize(125,20));
    iTagTtl->SetTextL(_L("Tags: "));

    iTagEdtr = new (ELeave) CEikEdwin;
    iTagEdtr->ConstructL(0,1,100,2);
    iTagEdtr->SetContainerWindowL(*this);
    iTagEdtr->SetExtent(TPoint(0,190), TSize(176,40));

    iDescTtl = new (ELeave) CEikLabel;
    iDescTtl->SetContainerWindowL(*this);
    iDescTtl->SetExtent(TPoint(0,230), TSize(125,20));
    iDescTtl->SetTextL(_L("Description: "));

    iDescEdtr = new (ELeave) CEikEdwin;
    iDescEdtr->ConstructL(0,1,200,3);
    iDescEdtr->SetContainerWindowL(*this);
    iDescEdtr->SetExtent(TPoint(0,250), TSize(176,60));

    SetRect(aRect);
    ActivateL();

    iNameEdtr->SetFocus(ETrue);
    }

    void CMyContainer::CreateScrollBar()
    {
    TEikScrollBarFrameLayout tLayout;
    iVModel = TEikScrollBarModel(310, 10, 0);
    iSBFrame = new (ELeave) CEikScrollBarFrame(this, this, ETrue);
    iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn);
    iSBFrame->SetScrollBarControlType(CEikScrollBar::EVertical,CEikScrollBarFrame::EArrowHead);
    iSBFrame->SetScrollBarSide(CEikScrollBar::EVertical,CEikScrollBarFrame::ETopOrLeft);

    tLayout.SetClientMargin(0);
    tLayout.SetInclusiveMargin(0);
    tLayout.iTilingMode = TEikScrollBarFrameLayout::EClientRectConstant;


    TRect tRect = TRect(0,0,176,310);

    TBool tBool = iSBFrame->TileL(NULL,&iVModel,tRect,iRect,tLayout);
    iSBFrame->MoveVertThumbTo(iVModel.iThumbPosition);
    iSBFrame->DrawScrollBarsNow();
    }

    TKeyResponse CMyContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/)
    {
    TKeyResponse response(EKeyWasNotConsumed);
    switch(aKeyEvent.iCode)
    {
    case EKeyUpArrow:
    if(iVModel.iThumbPosition > iVModel.iScrollSpan)
    iSBFrame->MoveVertThumbTo(--iVModel.iThumbPosition);
    response = EKeyWasConsumed;
    break;
    case EKeyDownArrow:
    if(iVModel.iThumbPosition < iVModel.iScrollSpan)
    iSBFrame->MoveVertThumbTo(++iVModel.iThumbPosition);

    response = EKeyWasConsumed;
    break;
    default:
    break;
    }
    return response;
    }


    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 );
    }
    }


    Now...will anybody please let me know...what i am missing??
    I need to fix it up urgently.

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    21

    Re: container with scroll

    为什么不在 构造函数中调用 滚动条的 创建函数啊

Similar Threads

  1. Problem with CBA & Scroll Indicator on s60 v2
    By jt79 in forum Symbian User Interface
    Replies: 0
    Last Post: 2007-04-11, 14:18
  2. Scroll bars in a list box (Series 60)
    By krnsoft in forum Symbian User Interface
    Replies: 30
    Last Post: 2007-02-05, 06:12
  3. Create scroll bar in multi text view
    By ctpthanh in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-04-04, 08:47
  4. Weird problem with scroll bar
    By yusa- in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-09-24, 08:56
  5. Problem with Container
    By ManishPatil in forum Symbian
    Replies: 2
    Last Post: 2004-02-19, 12:41

Posting Permissions

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