×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    49

    CAknDoubleNumberStyleListBox tutorial and sample

    Dear All,

    I am new to Symbian UI development.
    I am developing an application for S60 3rd edition using Carbide C++ for development.

    I try to show a list of information in the application using CAknDoubleNumberStyleListBox.
    I can find a sample in the nokia forum about how to use the CAknDoubleNumberStyleListBox. But in the example, it can only "draw" the list box to the screen. If there are many results, we cannot scroll down to show all the results. It seems I need to handle the event of key pressed?

    Do anyone have information / tutorial on how to implement such a list? Do you have any sample/tutorial source code on how to do it?

    Thanks a lot for your help.
    Hammond

  2. #2
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    Re: CAknDoubleNumberStyleListBox tutorial and sample

    hi,

    For scrolling add this code
    iListBox->SetContainerWindowL( *this );
    iListBox->ConstructL( this, 0 );

    //iListBox->ActivateL( );
    iListBox->CreateScrollBarFrameL( ETrue );
    iListBox->ScrollBarFrame( )->SetScrollBarVisibilityL
    ( CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto );
    iListBox->SetListBoxObserver(this);

    Derive you conatiner class with "MCoeControlObserver".

    Cheer's

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    49

    Re: CAknDoubleNumberStyleListBox tutorial and sample

    Marvik,

    Thanks for your help. I can create the scrollbar. But how to handle the event? e.g. arrow button, the "option", "exit" button etc?

    how to capture the events?

    Thanks.
    Hammond

  4. #4
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129

    Re: CAknDoubleNumberStyleListBox tutorial and sample

    May be you need re-define OfferKeyEventL function in your AppContainer.
    TKeyResponse CMyAppContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
    {
    if (iSettingItemList)
    return iSettingItemList->OfferKeyEventL(aKeyEvent, aType);
    else
    return EKeyWasNotConsumed;
    }

  5. #5
    Registered User
    Join Date
    Jun 2006
    Posts
    49

    Re: CAknDoubleNumberStyleListBox tutorial and sample

    ashari,

    I have defined the OfferKeyL function in my container.
    But after drawing the List, when I click on the arrow button, the OfferKeyL function is not called.

    By the way, actually where to capture the event? The OfferKeyL function? or the HandleControlEventL function?

    Thanks.
    Hammond

  6. #6
    Registered User
    Join Date
    Jun 2006
    Posts
    259

    Re: CAknDoubleNumberStyleListBox tutorial and sample

    Hi,

    Try with this code in "OfferKeyEventL"

    TChar charCode(aKeyEvent.iCode);
    switch(charCode)
    {
    case EKeySpace:
    case EKeyDevice3:
    case EKeyLeftArrow:
    case EKeyRightArrow:
    if(iListBox)
    {
    iListBox->OfferKeyEventL(aKeyEvent, aType);
    }
    else
    {
    //CEikonEnv::Static()->InfoWinL(_L("error"),_L(""));
    }
    return EKeyWasConsumed;
    case EKeyUpArrow:
    {
    TInt index = iListBox->CurrentItemIndex();
    if(index == 0)
    {
    iListBox->SetCurrentItemIndexAndDraw(iMessageList->MdcaCount()-1);
    return EKeyWasConsumed;
    }
    iListBox->OfferKeyEventL(aKeyEvent, aType);
    return EKeyWasConsumed;
    }
    case EKeyDownArrow:
    {
    TInt index = iListBox->CurrentItemIndex();
    if(index == iMessageList->MdcaCount()-1)
    {
    iListBox->SetCurrentItemIndexAndDraw(0);
    return EKeyWasConsumed;
    }
    iListBox->OfferKeyEventL(aKeyEvent, aType);
    return EKeyWasConsumed;
    }
    default:
    break;
    }
    return EKeyWasNotConsumed;

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,740

    Re: CAknDoubleNumberStyleListBox tutorial and sample

    Do not forget to put your control on the Control Stack in the AppUi.
    And also do not forget to remove it:
    Code:
    void CSampleAppUi::ConstructL()
    {
        BaseConstructL();
        iAppView = CSampleView::NewL(ClientRect());
        AddToStackL(iAppView);
    }
    
    
    CSampleAppUi::~CSampleAppUi()
    {
        if(iAppView)
            RemoveFromStack(iAppView);
        delete iAppView;
    }

  8. #8
    Regular Contributor
    Join Date
    Nov 2006
    Location
    Brebes, Indonesia
    Posts
    129

    Re: CAknDoubleNumberStyleListBox tutorial and sample

    Have you more than 1 AppView or AppContainer ?
    if yes, may be u must add the code
    AppUi()->AddToStackL(*this, iContainer);
    http://blogehendrawan.blogspot.com - Kembangin symbian di Indonesia yukk....

  9. #9
    Registered User
    Join Date
    Jun 2006
    Posts
    49

    Re: CAknDoubleNumberStyleListBox tutorial and sample

    Dear All,

    I was out of town so couldn't reply.
    Thanks for your information. I can scroll those items in the list now.

    But another question I am encountering now. Yes, I can scroll the data, but for the command frame at the bottom, that is the "Option Exit" bar, still the bar is used for the main application. So how can I implement so that the bar will handle command for the scroll list instead of for the main application? Any sample I can reference?

    Thanks a lot for your help.
    Hammond

Similar Threads

  1. J2ME Bluetooth tutorial
    By pichalsi in forum Bluetooth Technology
    Replies: 2
    Last Post: 2009-07-09, 12:50
  2. Building the Hello World sample
    By EUtopian in forum Symbian Tools & SDKs
    Replies: 6
    Last Post: 2006-11-05, 18:54
  3. Sample Source Code?
    By francute in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 3
    Last Post: 2006-07-16, 19:48
  4. Any Push Initiator sample??
    By hgyang in forum WAP Servers
    Replies: 1
    Last Post: 2002-07-29, 10: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
  •  
×