void CDefaultNumbersPopupList::ConstructL() { CALLSTACKITEM_N(_CL("CDefaultNumbersPopupList"), _CL("ConstructL")); iListbox = new (ELeave) CAknDoublePopupMenuStyleListBox; iPhoneDefault =CEikonEnv::Static()->AllocReadResourceL(R_DEFAULT_PHONE); iSmsDefault =CEikonEnv::Static()->AllocReadResourceL(R_DEFAULT_SMS); iMmsDefault =CEikonEnv::Static()->AllocReadResourceL(R_DEFAULT_MMS); iEmailDefault =CEikonEnv::Static()->AllocReadResourceL(R_DEFAULT_EMAIL); iNoDefault =CEikonEnv::Static()->AllocReadResourceL(R_NO_DEFAULT); iDefault = CEikonEnv::Static()->AllocReadResourceL(R_DEFAULTS); iArrayItems = new CDesCArrayFlat(1); PopulateListbox(); // original contsructl CAknPopupList::ConstructL(iListbox, R_DEFAULT_POPUP_CBA, AknPopupLayouts::EMenuDoubleWindow); CAknPopupList::SetTitleL(*iDefault); iListbox->ConstructL(this, CEikListBox::ELeftDownInViewRect); iListbox->CreateScrollBarFrameL(ETrue); iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); CTextListBoxModel* model = iListbox->Model(); model->SetItemTextArray(iArrayItems); model->SetOwnershipType(ELbmDoesNotOwnItemArray); }
void CProfileListDialog::PreLayoutDynInitL() { ButtonGroupContainer().SetDefaultCommand(ECmdProfileListConnect); iProfileArray = new (ELeave) CDesCArrayFlat(8); // Add default as the first profile iProfileArray->AppendL(KDefaultProfileName); // Find all profile files from the profile directory and add them to the // list RFs &fs = CEikonEnv::Static()->FsSession(); CDir *dir; User::LeaveIfError(fs.GetDir(iProfileDirectory, KEntryAttNormal, ESortByName, dir)); CleanupStack::PushL(dir); for ( TInt i = 0; i < dir->Count(); i++ ) { iProfileArray->AppendL((*dir)[i].iName); } CleanupStack::PopAndDestroy(); //dir // Set profiles to the listbox CEikTextListBox *lbox = ((CEikTextListBox*)Control(EProfileListDlgProfileList)); CTextListBoxModel *lbm = lbox->Model(); lbm->SetItemTextArray(iProfileArray); lbm->SetOwnershipType(ELbmDoesNotOwnItemArray); // Enable scroll bars CEikScrollBarFrame *sbf = lbox->CreateScrollBarFrameL(ETrue); sbf->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto); ButtonGroupContainer().SetDefaultCommand(ECmdProfileListConnect); }
void CPhotoListView::GetFolder() { TInt PopValue; //TBuf<150> msg; TInt count=0; CDesCArray* items = iPhotosAppUi->GetFolderList(); CDesCArray* foldernames = iPhotosAppUi->ReturnText(); if (items == NULL) { Count = 0; items = new (ELeave) CDesCArrayFlat(1); items->AppendL(foldernames->MdcaPoint(0)); } else { Count = items->MdcaCount(); items->AppendL(foldernames->MdcaPoint(0)); } foldernames->Reset(); CEikTextListBox* list = new( ELeave ) CAknSinglePopupMenuStyleListBox; CleanupStack::PushL( list ); CAknPopupList* popupList = CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_SELECT_CANCEL, AknPopupLayouts::EMenuWindow); CleanupStack::PushL( popupList ); popupList->SetMaximumHeight(2); list->ConstructL( popupList, CEikListBox::ELeftDownInViewRect ); list->CreateScrollBarFrameL( ETrue ); list->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto ); CTextListBoxModel* model = list->Model(); model->SetItemTextArray( items ); model->SetOwnershipType( ELbmOwnsItemArray ); count = GetPhotoCount(); // TInt price; // TLex lex(iPhotosAppUi->iCharge); // lex.Val(price); // count = count * price; // TBuf<30> temp; // temp.AppendNum(count); // msg.Copy(_L("Charge ")); // msg.Append(temp); // msg.Append(_L(" pesos")); //msg.Copy(_L("Select Album:")); //msg.Copy(*(iEikonEnv->AllocReadResourceL(R_IMAGES_SELECT_ALBUM))); /*count = count / 3; temp.Copy(_L("")); temp.AppendNum(count); path = iPhotosAppUi->ImageFolderPath(); if(path == 0 || path == 1) msg.Append(_L(" Photos)")); else if(path == 2 || path == 3) msg.Append(_L(" Videos)"));*/ popupList->SetTitleL(*(iEikonEnv->AllocReadResourceL(R_IMAGES_SELECT_ALBUM))); PopValue = popupList->ExecuteLD(); if(PopValue==0) { iFolderStatus=-1; } else if(PopValue==1) { PopValue=list->CurrentItemIndex(); iFolderStatus=PopValue; TPtrC ptr1(items->MdcaPoint(PopValue)); comment.Copy(ptr1); } items->Reset(); CleanupStack::Pop(); // popupList CleanupStack::PopAndDestroy(); // list }