本文整理汇总了C++中CEikButtonGroupContainer::SetCommandL方法的典型用法代码示例。如果您正苦于以下问题:C++ CEikButtonGroupContainer::SetCommandL方法的具体用法?C++ CEikButtonGroupContainer::SetCommandL怎么用?C++ CEikButtonGroupContainer::SetCommandL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEikButtonGroupContainer
的用法示例。
在下文中一共展示了CEikButtonGroupContainer::SetCommandL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doubleStyle
// ---------------------------------------------------------------------------
// CAknMemorySelectionDialogMultiDrive::ExecuteL
// ---------------------------------------------------------------------------
//
EXPORT_C CAknCommonDialogsBase::TReturnKey
CAknMemorySelectionDialogMultiDrive::ExecuteL(
TDriveNumber& aSelectedDrive, TDes* aRootPath, TDes* aDefaultFolder )
{
__ASSERT_DEBUG( iTitle && iLeftSoftkey && iRightSoftkey,
User::Panic( KCFDPanicText, ECFDPanicTitleOrSoftkeyNotSet ) );
iModel->UpdateItemsL();
TBool doubleStyle( AknCFDUtility::DirectoriesOnly( iDialogType ) );
CEikFormattedCellListBox* listBox = NULL;
if( doubleStyle )
{
listBox = new( ELeave ) CAknDoubleLargeGraphicPopupMenuStyleListBox();
}
else
{
listBox = new( ELeave ) CAknSingleGraphicPopupMenuStyleListBox();
}
CleanupStack::PushL( listBox );
AknPopupLayouts::TAknPopupLayouts layout( doubleStyle ?
AknPopupLayouts::EMenuDoubleLargeGraphicWindow :
AknPopupLayouts::EMenuGraphicWindow );
TBool isEndKeyPress = EFalse;
CAknCommonDialogsPopupList* popupList =
CAknCommonDialogsPopupList::NewL(
*iEventHandler, listBox, layout, isEndKeyPress );
CleanupStack::PushL( popupList );
listBox->ConstructL( popupList, 0 );
listBox->CreateScrollBarFrameL( ETrue ); // Create scroll indicator
listBox->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
listBox->Model()->SetItemTextArray( iModel );
// Set model ownership type
listBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
// Icons:
// Granularity, 5 icons
CAknIconArray* iconArray = new( ELeave ) CAknIconArray( 5 );
CleanupStack::PushL( iconArray );
LoadIconsL( iconArray, doubleStyle );
listBox->ItemDrawer()->FormattedCellData()->SetIconArrayL( iconArray );
CleanupStack::Pop(); // iconArray
popupList->SetTitleL( *iTitle ); // Set title
CEikButtonGroupContainer* cba = popupList->ButtonGroupContainer();
MEikButtonGroup* buttonGroup = cba->ButtonGroup();
cba->SetCommandL( buttonGroup->CommandId( 0 ), *iLeftSoftkey );
cba->SetCommandL( buttonGroup->CommandId( 2 ), *iRightSoftkey );
// Set listener for popuplist anytime.
TBool hasRemoteDrive =
( iIncludedMedias & AknCommonDialogsDynMem::EMemoryTypeRemote );
iEventHandler->StartNotifyDisk( popupList, hasRemoteDrive );
TInt selectedIndex = FindIndexByDrive( aSelectedDrive );
if( selectedIndex == KErrNotFound )
{
selectedIndex = 0; // The first index
}
listBox->View()->SetCurrentItemIndex( selectedIndex );
// Update CAB show.
iEventHandler->HandleEventL(
MAknCommonDialogsEventObserver::EFocusChange,
selectedIndex,
selectedIndex,
popupList->ButtonGroupContainer() );
CleanupStack::Pop(); // popupList (deleted in ExecuteLD)
// Execute the popup dialog
TBool returnValue = EFalse;
TRAPD( err, returnValue = popupList->ExecuteLD() );
if ( iEventHandler )
{
iEventHandler->StopNotifyDisk();
}
if( returnValue )
{
selectedIndex = listBox->CurrentItemIndex();
GetDrivePaths( selectedIndex, aRootPath, aDefaultFolder );
aSelectedDrive = FindDriveByIndex( selectedIndex );
}
else if ( err )
{
User::Leave( err );
}
CleanupStack::PopAndDestroy(); // listBox
return TReturnKey( returnValue );
}