Categories: S60 | Symbian C++ | UI | Code Examples
This page was last modified 10:09, 22 January 2008.
Create Marquee effect in poplists and menus
From Forum Nokia Wiki
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 ) { case ETestAppCommand1: { CAknSinglePopupMenuStyleListBox* list = new(ELeave) CAknSinglePopupMenuStyleListBox; CleanupStack::PushL(list); // Create popup list and PUSH it. CAknPopupList* popupList = CAknPopupList::NewL(list, R_AVKON_SOFTKEYS_OK_BACK, AknPopupLayouts::EMenuWindow); CleanupStack::PushL(popupList); // initialize listbox. list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect); list->CreateScrollBarFrameL(ETrue); 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()); itemList->AppendL(item); // next listbox item item.Format(KListItemFormat, &KNextItem()); itemList->AppendL(item); // last listbox item item.Format(KListItemFormat, &KLastItem()); itemList->AppendL(item); // set items and ownership list->Model()->SetItemTextArray(itemList); list->Model()->SetOwnershipType(ELbmOwnsItemArray); // 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(); if(popupOk) { // do something } else { // do something else } CleanupStack::PopAndDestroy(); // list } break; default: Panic( ETestAppUi ); break; } }
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NDS library & filter | fwojtek | Symbian Tools & SDKs | 1 | 2005-08-18 11:48 |
| sound && CMdaAudioPlayerUtility Help | qibinyi | General Symbian C++ | 1 | 2003-08-07 03:51 |
| Difficult to select an item in ChoiceGroup and List | mnaeher | Mobile Java General | 4 | 2007-02-02 09:23 |
| How to change cancel button to back in select cancel button when menu is open | Rajani_sp | Symbian User Interface | 4 | 2007-11-22 11:11 |
| what's the effect when carbide expires? | xersmith | General Symbian C++ | 5 | 2007-03-03 12:54 |
