Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How can I create a horizontal scrolling (marquee) effect in menus and popup lists using Symbian C++?

From Wiki
Jump to: navigation, search

Article Metadata
Platform(s): S60 2nd Edition, FP2
S60 2nd Edition, FP3
S60 3rd Edition
S60 3rd Edition (initial release)
S60 2nd Edition (initial release)
Created: User:Technical writer 2 (24 Aug 2006)
Last edited: hamishwillee (14 Jun 2012)


How can I create a horizontal scrolling (marquee) effect in menus and popup lists?


Starting from S60 2nd Edition, FP2 it is possible to enable the marquee effect (horizontal scrolling of the selected item if its text width does not allow it to be fully displayed) for all the objects derived from CFormattedCellListBoxData.
void CTestAppUi::HandleCommandL( TInt aCommand )
    switch( aCommand )
... snip ...
        case ETestAppCommand1:
    // Create listbox and PUSH it.
    CAknSinglePopupMenuStyleListBox* list = new(ELeave) CAknSinglePopupMenuStyleListBox;
    // Create popup list and PUSH it.
    CAknPopupList* popupList = CAknPopupList::NewL(list, R_AVKON_SOFTKEYS_OK_BACK, AknPopupLayouts::EMenuWindow);
    // initialize listbox.
    list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect);
    list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
_LIT(KListItemFormat, "%S");
_LIT(KFirstItem, "First item");
_LIT(KNextItem, "This is a very long string used for the next item");
_LIT(KLastItem, "Last item");
// construct listbox item array
CDesCArray *itemList = new (ELeave) CDesCArrayFlat(3);
TBuf<100> item;
// first listbox item
item.Format(KListItemFormat, &KFirstItem());
// next listbox item
item.Format(KListItemFormat, &KNextItem());
// last listbox item
item.Format(KListItemFormat, &KLastItem());
// set items and ownership
// enable marquee effect for long strings
list->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue );
    // Set title
    popupList->SetTitleL(_L("Scrollable items"));
    // Show popup list.
    CleanupStack::Pop();            // popuplist
    TBool popupOk = popupList->ExecuteLD();
    // do something
    // so something else
    CleanupStack::PopAndDestroy();  // list
... snip ...
            Panic( ETestAppUi );
Starting from S60 3rd Edition this effect is also supported by CEikMenuPane, which means that it can be applied to menus:
void CTestAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
#ifndef __SERIES60_3X__
if(aMenuPane != NULL)

This page was last modified on 14 June 2012, at 06:33.
16 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.