本文整理汇总了C++中CEikLabel::OverrideColorL方法的典型用法代码示例。如果您正苦于以下问题:C++ CEikLabel::OverrideColorL方法的具体用法?C++ CEikLabel::OverrideColorL怎么用?C++ CEikLabel::OverrideColorL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEikLabel
的用法示例。
在下文中一共展示了CEikLabel::OverrideColorL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitialiseL
void CPreviewPopUpContent::InitialiseL(const TRect& aRect,
const TDesC& aMbmName,
TInt aNbrOfRows,
TInt aImageId,
TInt aMaskId)
{
// Do not call CreateWindowL() as parent CAknPreviewPopUpController owns window
InitComponentArrayL();
iMbmName = aMbmName.AllocL();
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
TRgb fgcolor(0,0,0);
AknsUtils::GetCachedColor(skin, fgcolor, KAknsIIDQsnTextColors,
EAknsCIQsnTextColorsCG55);
if (aImageId != -1 && aMaskId != -1) {
AknIconUtils::CreateIconL(iBitmap, iMask, *iMbmName, aImageId, aMaskId);
AknIconUtils::SetSize(iBitmap, TSize(10, 10),
EAspectRatioPreservedAndUnusedSpaceRemoved);
}
iStringLengths = new (ELeave) CArrayFixFlat<TInt>(aNbrOfRows);
iLabelContainer.Reset();
// Create one label with standard font size.
iStringLengths->AppendL(aRect.Width());
CEikLabel* label = new (ELeave) CEikLabel();
label->SetContainerWindowL(*this);
Components().AppendLC(label);
label->OverrideColorL(EColorLabelText, fgcolor);
label->SetTextL(KDefaultText);
CleanupStack::Pop(label);
iLabelContainer.AppendL(TLabelData(label));
// The rest of the labels with a smaller font.
const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont);
for (TInt i = 0; i < aNbrOfRows-1; ++i) {
iStringLengths->AppendL(aRect.Width());
CEikLabel* label = new (ELeave) CEikLabel();
label->SetContainerWindowL(*this);
Components().AppendLC(label);
label->SetFont(font);
label->OverrideColorL(EColorLabelText, fgcolor);
label->SetTextL(KDefaultText);
CleanupStack::Pop(label);
iLabelContainer.AppendL(TLabelData(label));
}
//CEikonEnv::Static()->ScreenDevice()->ReleaseFont(font);
Components().SetControlsOwnedExternally(EFalse);
// Set the windows size
SetRect(aRect);
// Activate the window, which makes it ready to be drawn
ActivateL();
}
示例2: 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();
}