本文整理汇总了C++中CEikLabel::SetLabelAlignment方法的典型用法代码示例。如果您正苦于以下问题:C++ CEikLabel::SetLabelAlignment方法的具体用法?C++ CEikLabel::SetLabelAlignment怎么用?C++ CEikLabel::SetLabelAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEikLabel
的用法示例。
在下文中一共展示了CEikLabel::SetLabelAlignment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConstructL
void CMainMenuListContainer::ConstructL(const TRect& aRect,
CMainMenuListView* aView,
const TInt* aMbmImageIds,
const TInt* aMbmMaskIds,
const TInt* aMainMenuCommandIds,
const TInt* aMainMenuFirstLabelIds,
const TInt* aMainMenuSecondLabelIds)
{
CreateWindowL();
InitComponentArrayL();
iBgContext =
CAknsBasicBackgroundControlContext::NewL(KAknsIIDQsnBgAreaMain,
aRect, ETrue);
iView = aView;
iMainMenuCommandIds = aMainMenuCommandIds;
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
TRgb fgcolor(0,0,0);
AknsUtils::GetCachedColor(skin, fgcolor, KAknsIIDQsnTextColors,
EAknsCIQsnTextColorsCG6);
CEikLabel* label = new (ELeave) CEikLabel();
label->SetContainerWindowL(*this);
Components().AppendLC(label, ETitleLabel);
label->OverrideColorL(EColorLabelText, fgcolor);
label->SetTextL(KDefaultTitle());
label->SetLabelAlignment(ELayoutAlignCenter);
HBufC* titleText = CEikonEnv::Static()->AllocReadResourceLC(R_MM_TITLE_TEXT);
label->SetTextL(*titleText);
CleanupStack::PopAndDestroy(titleText);
CleanupStack::Pop(label);
// Create and populate the listbox
iListBox = new( ELeave ) CAknDoubleLargeStyleListBox();
Components().AppendLC(iListBox, EListBox);
iListBox->SetContainerWindowL(*this);
iListBox->SetMopParent(this);
{
TResourceReader reader;
iEikonEnv->CreateResourceReaderLC( reader, R_WAYFINDER_MAIN_MENU_LIST_VIEW_LISTBOX );
iListBox->ConstructFromResourceL( reader );
CleanupStack::PopAndDestroy(); // reader internal state
}
iListBox->SetFocus(ETrue);
iListBox->SetListBoxObserver(this);
iListBox->ItemDrawer()->FormattedCellData()->SetMarqueeParams(5, 3, 1000000, 200000);
iListBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL(ETrue);
for (TInt i = 0; iMainMenuCommandIds[i] != -1; ++i) {
AddItemL(aMbmImageIds[i], aMbmMaskIds[i],
aMainMenuFirstLabelIds[i],
aMainMenuSecondLabelIds[i]);
}
iListBox->CreateScrollBarFrameL(ETrue);
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
CEikScrollBarFrame::EOff);
iListBox->UpdateScrollBarsL();
iListBox->SetCurrentItemIndex(0);
iListBox->DrawNow();
CleanupStack::Pop(iListBox);
//Activate view
SetRect(aRect);
ActivateL();
}