本文整理汇总了C++中CEikLabel类的典型用法代码示例。如果您正苦于以下问题:C++ CEikLabel类的具体用法?C++ CEikLabel怎么用?C++ CEikLabel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CEikLabel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateLabelsL
void CTcContainer::CreateLabelsL( const TRect& /*aRect*/ )
{
// Create labels
CEikLabel* label;
TRect rect( KLabelTlX, KLabelTlY, KLabelBrX, KLabelBrY );
label = CreateLabelL( rect, KTestCase );
rect.Move( 0, KLabelSpacing );
label = CreateLabelL( rect, KNone );
// Use smaller for for this label
label->SetFont( CEikonEnv::Static()->AnnotationFont() );
rect.Move( 0, KLabelSpacing );
label = CreateLabelL( rect, KRequest );
rect.Move( 0, KLabelSpacing );
label = CreateLabelL( rect, KNone );
// Use smaller for for this label
label->SetFont( CEikonEnv::Static()->AnnotationFont() );
rect.Move( 0, KLabelSpacing );
label = CreateLabelL( rect, KStatus );
rect.Move( 0, KLabelSpacing );
label = CreateLabelL( rect, KNone );
// Use smaller for for this label
label->SetFont( CEikonEnv::Static()->AnnotationFont() );
}
示例2: CALLSTACKITEM_N
void CRecognizerContainer::ConstructL(const TRect& aRect, CAknView* View, TBool navi)
{
CALLSTACKITEM_N(_CL("CRecognizerContainer"), _CL("ConstructL"));
iView=View;
iNavi=navi;
iCurrentCodeArray=new RPointerArray<CCodeInfo>;
iScreenMsgBuf = CEikonEnv::Static()->AllocReadResourceL(R_CODE_SCREEN_MSG);
if (iNavi) {
CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
CAknNavigationControlContainer *np = (CAknNavigationControlContainer *)sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi));
CLocalNotifyWindow* tp=CLocalNotifyWindow::Global();
np->PushDefaultL(ETrue);
HBufC * t = iEikonEnv->AllocReadResourceL(R_CHOOSE_CODE);
tp->SetTitleText(t);
} else {
// CEikStatusPane* sp=iEikonEnv->AppUiFactory()->StatusPane();
CLocalNotifyWindow* tp=CLocalNotifyWindow::Global();
tp->SetTitleTextToDefaultL();
}
CreateWindowL();
iStandByLabel = new (ELeave) CEikLabel;
iStandByLabel->SetContainerWindowL(*this);
iStandByLabel->SetTextL(_L("Camera Standby\nClick to resume"));
iStandByLabel->SetAlignment(TGulAlignment(EHCenterVCenter));
iStandByLabel->SetExtent(TPoint(0,0), TSize(176,144));
SetRect(aRect);
ActivateL();
}
示例3: SetTextL
// -----------------------------------------------------------------------------
// SetTextL
//
// -----------------------------------------------------------------------------
//
void CAknInfoPopupNote::SetTextL( const TDesC& aText )
{
if ( aText != iText->Text() )
{
iText->SetTextL( aText );
for ( TInt i = 0; i < iText->NumberOfLines(); i++ )
{
// Draw the label after the background.
CEikLabel* line = iText->Line( i );
line->ActivateL(); // Never leaves
if ( !IsVisible() )
{
line->MakeVisible( EFalse );
}
iText->SetLineModified( i, EFalse );
}
SetWindowLayoutL();
if ( IsVisible() )
{
Window().Invalidate( Rect() );
}
}
}
示例4: InitComponentArrayL
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();
}
示例5: new
CEikLabel* CTcContainer::CreateLabelL( const TRect& aRect, const TDesC& aText )
{
// Create new label and add it to the label array
CEikLabel* label = new( ELeave ) CEikLabel;
CleanupStack::PushL( label );
iLabels.AppendL( label );
CleanupStack::Pop( label );
// Set label container, area and text
label->SetContainerWindowL( *this );
label->SetRect( aRect );
label->SetTextL( aText );
return label;
}
示例6: GetTalkingLabel
// ----------------------------------------------------------------------------
// TKeyResponse CGuideContainer::OfferKeyEventL( const TKeyEvent&,
// TEventCode )
// Handles the key events.
// ----------------------------------------------------------------------------
//
TKeyResponse CGuideContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent,
TEventCode aType )
{
CEikLabel* instructionLabel = GetTalkingLabel();
if (aType == EEventKeyDown) {
this->SetFocus(ETrue);
}
// } else if (aType == EEventKeyUp) {
// iInstructionLabel->SetFocus(ETrue);
// }
if ( aType != EEventKey ){ // Is not key event?
return EKeyWasNotConsumed;
}
switch ( aKeyEvent.iScanCode )
{
case EStdKeyLeftArrow:
case EStdKeyRightArrow:
instructionLabel->SetFocus(ETrue);
return EKeyWasNotConsumed;
break;
// Switches tab.
case EStdKeyUpArrow:
if( !(iAppUI->IsGpsAllowed()) &&
iAppUI->HasRoute() ){
// update here
iView->GoToTurn( ETrue );
instructionLabel->SetFocus(ETrue);
return EKeyWasConsumed;
}
break;
case EStdKeyDownArrow:
if( !(iAppUI->IsGpsAllowed()) &&
iAppUI->HasRoute() ){
// update here
iView->GoToTurn( EFalse );
instructionLabel->SetFocus(ETrue);
return EKeyWasConsumed;
}
break;
case EStdKeyDevice3:
iView->HandleCommandL( EWayFinderCmdGuideReroute );
instructionLabel->SetFocus(ETrue);
return EKeyWasConsumed;
break;
case EStdKeyHash:
iView->HandleCommandL( EWayFinderCmdMap ) ;
instructionLabel->SetFocus(ETrue);
return EKeyWasConsumed;
break;
default:
instructionLabel->SetFocus(ETrue);
return EKeyWasNotConsumed;
break;
}
// //TODO: Test "return EKeyWasConsumed;"
return EKeyWasNotConsumed;
}
示例7: Components
void CMainMenuListContainer::SizeChanged()
{
CCoeControl::SizeChanged();
if(iBgContext) {
iBgContext->SetRect(Rect());
if (&Window()) {
iBgContext->SetParentPos(PositionRelativeToScreen());
}
}
CCoeControlArray::TCursor cursor = Components().Find(ETitleLabel);
CEikLabel* label = cursor.Control<CEikLabel>();
const TDesC* titleText = label->Text();
TRect rect = Rect();
CFont* titleFont = FindLargestPossibleFontL(*titleText, rect.Width(), EAknLogicalFontPrimaryFont);
label->SetFont(titleFont);
CEikonEnv::Static()->ScreenDevice()->ReleaseFont(titleFont);
// Set the size of the label, need to think of the descent as well.
TSize size = label->MinimumSize();
size.iWidth = rect.Width();
TInt descent = label->Font()->DescentInPixels();
size.iHeight += descent;
// Set the pos for the listbox, use the height for the label when doing this.
// Also add the descent in pixels to get some space between the label and the
// listbox.
rect.iTl.iY = descent;
TPoint pos(0, descent);
label->SetExtent(rect.iTl, size);
rect.iTl.iY += size.iHeight;
// As default display both rows and hide the scrollbars
HideSecondRow(EFalse);
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
CEikScrollBarFrame::EOff);
// Need to set the rect to get the listbox to update its values
iListBox->SetRect(rect);
TInt listBoxHeight = iListBox->ItemHeight() * iListBox->Model()->NumberOfItems();
if (listBoxHeight > rect.Height()) {
// The listbox is to large to fint, hide the row and check again.
HideSecondRow(ETrue);
iListBox->SetRect(rect);
listBoxHeight = iListBox->ItemHeight() * iListBox->Model()->NumberOfItems();
if (listBoxHeight > rect.Height()) {
// Show scroll bar only if the height of the listbox is larger then
// the rect.
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
CEikScrollBarFrame::EOn);
iListBox->UpdateScrollBarsL();
}
}
else {
// Setting the first item gets the list box positioned correctly on the screen
iListBox->ScrollToMakeItemVisible(0);
}
}
示例8: new
/**
* Create a label
*/
CEikLabel* CAknTextControl::CreateLabelLC(TInt aLen)
{
CEikLabel* label = new(ELeave) CEikLabel;
CleanupStack::PushL(label);
label->SetContainerWindowL(*this);
label->SetBufferReserveLengthL(aLen);
#ifdef RD_UI_TRANSITION_EFFECTS_POPUPS
label->SetParent( this );
#endif
// we do logical to visual conversion ourselves while wrapping text
label->UseLogicalToVisualConversion( EFalse );
if ( iPictoInterface )
{
label->EnablePictographsL( *iPictoInterface );
}
return label;
}
示例9: ActivateGc
void CGuideContainer::CalculatePortraitLayout()
{
#ifdef NAV2_CLIENT_SERIES60_V3
ActivateGc();
CWindowGc& gc = SystemGc();
gc.Clear(iCurrStreetLabel->Rect());
SetLabelExtent(iCurrStreetLabel, CURRSTREET_LABEL_POS, ETrue);
gc.Clear(iNextStreetLabel->Rect());
SetLabelExtent(iNextStreetLabel, NEXTSTREET_LABEL_POS, ETrue);
gc.Clear(iDistanceLabel->Rect());
SetLabelExtent(iDistanceLabel, DISTANCE_LABEL_POS);
CEikLabel* instructionLabel = GetTalkingLabel();
// Resets the Edwin control for the screen reader
gc.Clear(instructionLabel->Rect());
SetLabelExtent(instructionLabel, TEXT_INSTRUCTION_POS);
DeactivateGc();
if (iProgressBar) {
iProgressBar->SetSizeAndPosition(TRect( WFLayoutUtils::
CalculatePosUsingMainPane( PROGRESS_BAR_POS ),
WFLayoutUtils::
CalculateSizeUsingMainPane( 40, 90 ) ) );
} else {
iProgressBar =
CGuideProgressBar::NewL(*this,
TRect( WFLayoutUtils::CalculatePosUsingMainPane( PROGRESS_BAR_POS ),
WFLayoutUtils::CalculateSizeUsingMainPane( 40, 90 ) ),
iView->GetMbmName(),
EMbmWficonsProgress_triangle_grey,
EMbmWficonsProgress_triangle_blue,
EMbmWficonsProgress_triangle_grey_mask,
EMbmWficonsProgress_bar_grey,
EMbmWficonsProgress_bar_blue,
EMbmWficonsProgress_bar_grey_mask);
}
TRect rect = WFLayoutUtils::GetMainPaneRect();
CreatePictureL(iGuidePicture, rect, GUIDE_PICTURE_POS, 100, 100);
// CreatePictureL(iNextTurnPicture, rect, NEXT_TURN_PICTURE_POS, 24, 24);
// CreatePictureL(iDetourPicture, rect, DETOUR_PICTURE_POS, 24, 24);
SetImage(iNextTurnPicture,
iGuidePicture->GetRect(),
&TopRight, 0.24, 0.24,
-WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));
SetImage(iDetourPicture,
iGuidePicture->GetRect(),
&LowerLeft, 0.24, 0.24,
WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
-WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));
SetImage(iSpeedCamPicture,
iGuidePicture->GetRect(),
&LowerRight, 0.24, 0.24,
-WFLayoutUtils::CalculateXValue(IMAGE_PADDING),
-WFLayoutUtils::CalculateYValueUsingMainPane(IMAGE_PADDING));
iDetourPicture->SetShow(EFalse);
iSpeedCamPicture->SetShow(EFalse);
iDetourPicture->CreateIconL(iView->GetMbmName(),
EMbmWficonsDetour_square,
EMbmWficonsDetour_square_mask);
iSpeedCamPicture->CreateIconL(iView->GetMbmName(),
EMbmWficonsSpeedcamera_square,
EMbmWficonsSpeedcamera_square);
TRect exitRect = Center(iGuidePicture->GetRect(),
TRect(TPoint(),
WFLayoutUtils::
CalculateSizeUsingSize(iGuidePicture->GetSize(),
0.26, 0.16)));
if (iExitPicture) {
iExitPicture->SetImageRect(exitRect);
} else {
iExitPicture = CImageHandler::NewL(exitRect);
}
iExitPicture->SetShow(EFalse);
// XXX Temporary removed until the above lines are tested.
// CreatePictureL(iExitPicture, rect, EXIT_PICTURE_POS, 26, 16);
#endif
}
示例10: CALLSTACKITEM_N
void CUploadContainer::ConstructL(const TRect& aRect)
{
CALLSTACKITEM_N(_CL("CUploadContainer"), _CL("ConstructL"));
iControls=new (ELeave) CArrayPtrFlat< CCoeControl >(10);
CreateWindowL();
TRect r(TPoint(5, 5), TSize(aRect.Width()-10, 1));
if (iFileName.Right(3).CompareF(_L("jpg"))==0) {
#ifndef __S60V2__
iMdaServer=CMdaServer::NewL();
iFileUtil=CMdaImageFileToBitmapUtility::NewL(*this, iMdaServer);
#else
iFileUtil=CMdaImageFileToBitmapUtility::NewL(*this, 0);
#endif
iFileUtil->OpenL(iFileName);
scaled=false;
iImgPlaceHolder=new (ELeave) CEikLabel;
iControls->AppendL(iImgPlaceHolder);
iImgPlaceHolder->SetContainerWindowL( *this );
iImgPlaceHolder->SetFont(iEikonEnv->DenseFont());
iImgPlaceHolder->SetTextL( _L("loading image...") );
r.SetHeight(IMG_HEIGHT);
iImgPlaceHolder->SetRect(r);
r.Move(0, r.Height()+4);
} else {
r.SetHeight(IMG_HEIGHT);
r.Move(0, r.Height()+4);
}
TInt tagw=0;
/*
iTagLabel=new (ELeave) CEikLabel;
iControls->AppendL(iTagLabel);
iTagLabel->SetContainerWindowL( *this );
iTagLabel->SetTextL( _L("Tag:") );
r.SetHeight(12);
iTagLabel->SetRect(r);
tagw=iTagLabel->MinimumSize().iWidth+4;
r.Move( tagw , 0); r.SetWidth(r.Width()-tagw);
*/
TBuf<100> tag;
Settings().GetSettingL(SETTING_UPLOAD_TAG, tag);
if (tag.Length() == 0) tag=KTag();
iTagEdit=new (ELeave) CEikEdwin;
iControls->AppendL(iTagEdit);
iTagEdit->SetContainerWindowL( *this );
iTagEdit->ConstructL();
iTagEdit->SetTextL(&tag);
iTagEdit->AddEdwinObserverL(this);
r.SetHeight(16);
iTagEdit->SetRect(r);
iTagEdit->ActivateL();
r.Move(-tagw, r.Height()+4); r.SetWidth(r.Width()+tagw);
TBool no_descr;
if (iTagOnly)
no_descr=true;
else
no_descr=false;
if (!no_descr) {
TInt height=56;
/*
iDescriptionLabel=new (ELeave) CEikLabel;
iControls->AppendL(iDescriptionLabel);
iDescriptionLabel->SetContainerWindowL( *this );
iDescriptionLabel->SetTextL( _L("Description:") );
r.SetHeight(12);
iDescriptionLabel->SetRect(r);
r.Move(0, r.Height()+4);
height-=16;
*/
r.Move(0, 2);
iDescriptionEdit=new (ELeave) CEikEdwin;
iControls->AppendL(iDescriptionEdit);
iDescriptionEdit->SetContainerWindowL( *this );
iDescriptionEdit->ConstructL();
iDescriptionEdit->AddEdwinObserverL(this);
iDescriptionEdit->SetTextL(&(KDescription()));
r.SetHeight(height);
iDescriptionEdit->SetRect(r);
r.Move(0, r.Height()+4);
SetEditSelected(iDescriptionEdit, true); SetEditActive(iDescriptionEdit, true);
} else {
SetEditSelected(iTagEdit, true); SetEditActive(iTagEdit, true);
}
SetRect(aRect);
ActivateL();
}
示例11: TSize
void
CPreviewPopUpContent::SetAvailableWidth(TInt aWidth, TInt aPadding,
CPreviewPopUpContent::TContentLayout aLayout,
TInt aHeight)
{
iLayout = aLayout;
TInt numLabels = iLabelContainer.Count();
if (numLabels == 0) {
return;
}
// The large font header label.
CEikLabel* labelLa = iLabelContainer[0].iLabel;
// The small font text label.
CEikLabel* labelSm = iLabelContainer[1].iLabel;
// Font height in pixels
TInt fontHeightLa = labelLa->Font()->HeightInPixels();
// Font descent in pixels
TInt descentLa = labelLa->Font()->DescentInPixels();
// The height of one label
TInt labelHeightLa = fontHeightLa + descentLa;
// Font height in pixels
TInt fontHeightSm = labelSm->Font()->HeightInPixels();
// Font descent in pixels
TInt descentSm = labelSm->Font()->DescentInPixels();
// The height of one label
TInt labelHeightSm = fontHeightSm + descentSm;
// totLabelsHeight will hold the total height of all labels that
// will be drawn (one large font and the rest small fonts).
// We additionaly remove a descent on the last line since that
// it seems otherwise we're over compensating.
TInt totLabelsHeight =
labelHeightLa + labelHeightSm * (numLabels - 1); // - descentSm;
// Calculate the image size.
// This calc will give us the height of two label rows.
iIconSize = fontHeightLa + fontHeightSm + descentLa;
TInt iconSize = iIconSize;
TInt padding = aPadding;
if (iBitmap) {
AknIconUtils::SetSize(iBitmap, TSize(iconSize, iconSize),
EAspectRatioPreservedAndUnusedSpaceRemoved);
iconSize = iBitmap->SizeInPixels().iWidth;
} else {
// We have no bitmap set so dont indent the text around the bitmap.
iconSize = 0;
padding = 0;
}
// controlRect will contain the rect for our control to draw in,
// including padding.
TRect controlRect;
if (iLayout == EFourLinesIndentedTextImageTopLeft) {
if (aHeight > 0) {
controlRect = TRect(TPoint(aPadding, aPadding),
TSize(aWidth, aHeight));
} else {
controlRect = TRect(TPoint(aPadding, aPadding),
TSize(aWidth, totLabelsHeight + aPadding));
}
} else if (iLayout == EFourLinesTextImageTopLeftAbove) {
if (aHeight > 0) {
controlRect = TRect(TPoint(aPadding, aPadding),
TSize(aWidth, aHeight));
} else {
controlRect = TRect(TPoint(aPadding, aPadding),
TSize(aWidth,
totLabelsHeight + iconSize + descentLa + aPadding));
}
}
// iComponentRect will contain the drawing area for our controls
// (image and labels).
iComponentRect = controlRect;
iComponentRect.Shrink(aPadding, aPadding);
// Calculate where the text should wrap and
// calculate the positions and rects for the labels in the control.
TRect labelRectLa;
TRect labelRectSm;
if (iLayout == EFourLinesIndentedTextImageTopLeft) {
// The first line will bew positioned next to the image and
// therefore the width will be a bit shorter.
iStringLengths->At(0) = (iComponentRect.Width() - (iconSize + padding));
// The width of the last line should not be wrapped but rather set to
// cropped later on.
iStringLengths->At(1) = (iComponentRect.Width() + 10000);
// The rect for the first label in the layout mode.
labelRectLa = TRect(TPoint(iComponentRect.iTl.iX + iconSize + padding,
iComponentRect.iTl.iY),
TSize(iComponentRect.Width() - (iconSize + padding),
labelHeightLa));
// The rect for the labels with small font as well.
labelRectSm = TRect(TPoint(iComponentRect.iTl.iX + iconSize + padding,
iComponentRect.iTl.iY),
TSize(iComponentRect.Width() - (iconSize + padding),
//.........这里部分代码省略.........
示例12: UpdateLabelsL
void CFiletransferContainer::UpdateLabelsL()
{
//we update labels 2,3,4, 5 and 7
CEikLabel *l;
HBufC* txt;
TInt percent;
//label 2: KB sent/received + percent
l = iFileDetailsLabels[2];
//l->SetContainerWindowL(*this);
//create the KB array
CArrayFixFlat<TInt> *transferedKB=new(ELeave)CArrayFixFlat<TInt>(2);
CleanupStack::PushL(transferedKB);
transferedKB->AppendL(iFiletransferView->iTotalBytesTransfered/1024);
percent=(TInt)(iFiletransferView->iTotalBytesTransfered*100.0/iFiletransferView->iTotalBytes2Transfer);
transferedKB->AppendL(percent);
//load label text
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_KB_TRANSFERED,*transferedKB);
//set the label and clean
l->SetTextL(*txt);
CleanupStack::PopAndDestroy(txt);
CleanupStack::PopAndDestroy(transferedKB);
//label 3: KB remaining to sent/received
l = iFileDetailsLabels[3];
//l->SetContainerWindowL(*this);
//
TInt KB2Transfer=(iFiletransferView->iTotalBytes2Transfer-iFiletransferView->iTotalBytesTransfered)/1024;
//load label text
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_KB_2TRANSFER,KB2Transfer);
//set the label and clean
l->SetTextL(*txt);
CleanupStack::PopAndDestroy(txt);
//label 4: Elapsed time (m,s):
l = iFileDetailsLabels[4];
//l->SetContainerWindowL(*this);
//create the array
CArrayFixFlat<TInt> *time=new(ELeave)CArrayFixFlat<TInt>(2);
CleanupStack::PushL(time);
time->AppendL(iFiletransferView->iElapsedTime/60); //minutes
time->AppendL(iFiletransferView->iElapsedTime%60); //seconds
//load label text
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_ELAPSED_TIME,*time);
//set the label and clean
l->SetTextL(*txt);
CleanupStack::PopAndDestroy(txt);
CleanupStack::PopAndDestroy(time);
//label 5: Estimated time (m, s):
l = iFileDetailsLabels[5];
//l->SetContainerWindowL(*this);
//create the array
time=new(ELeave)CArrayFixFlat<TInt>(2);
CleanupStack::PushL(time);
time->AppendL(iFiletransferView->iEstimatedTime/60); //minutes
time->AppendL(iFiletransferView->iEstimatedTime%60); //seconds
//load label text
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_ESTIMATED_TIME,*time);
//set the label and clean
l->SetTextL(*txt);
CleanupStack::PopAndDestroy(txt);
CleanupStack::PopAndDestroy(time);
//label 7: Speed (avrg, kbps):
l = iFileDetailsLabels[7];
//l->SetContainerWindowL(*this);
//load label text
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_SPEED,iFiletransferView->iAverageSpeed);
//set the label and clean
l->SetTextL(*txt);
CleanupStack::PopAndDestroy(txt);
}
示例13: new
void CFiletransferContainer::ResetLabelsL()
{
CEikLabel *l;
iFileDetailsLabels.ResetAndDestroy();
HBufC* txt;
TInt percent;
//label 0: Sending/Receiving
l = new (ELeave) CEikLabel;
l->SetContainerWindowL(*this);
//create the nr of files array
CArrayFixFlat<TInt> *nrFiles=new(ELeave)CArrayFixFlat<TInt>(2);
CleanupStack::PushL(nrFiles);
nrFiles->AppendL(iFiletransferView->iCurrentFileNo);
nrFiles->AppendL(iFiletransferView->iTotalFilesNo);
//load label text
if(iFiletransferView->iDirection==CFiletransferView::EDirectionSending)
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_SENDING_FILE,*nrFiles);
else
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_RECEIVING_FILE,*nrFiles);
//set the label and clean
l->SetTextL(*txt);
CleanupStack::PopAndDestroy(txt);
CleanupStack::PopAndDestroy(nrFiles);
iFileDetailsLabels.Append(l);
//label 1: filename
l = new (ELeave) CEikLabel;
l->SetContainerWindowL(*this);
iLabelTextFilename.Copy(iFiletransferView->iLabelTextFilename);
iLabelTextFilename.Append(_L(" ")); //5 white spaces
l->SetTextL(iLabelTextFilename);
iFileDetailsLabels.Append(l);
//label 2: KB sent/received + percent
l = new (ELeave) CEikLabel;
l->SetContainerWindowL(*this);
//create the KB array
CArrayFixFlat<TInt> *transferedKB=new(ELeave)CArrayFixFlat<TInt>(2);
CleanupStack::PushL(transferedKB);
transferedKB->AppendL(iFiletransferView->iTotalBytesTransfered/1024);
percent=(TInt)(iFiletransferView->iTotalBytesTransfered*100.0/iFiletransferView->iTotalBytes2Transfer);
transferedKB->AppendL(percent);
//load label text
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_KB_TRANSFERED,*transferedKB);
//set the label and clean
l->SetTextL(*txt);
CleanupStack::PopAndDestroy(txt);
CleanupStack::PopAndDestroy(transferedKB);
iFileDetailsLabels.Append(l);
//label 3: KB remaining to sent/received
l = new (ELeave) CEikLabel;
l->SetContainerWindowL(*this);
//
TInt KB2Transfer=(iFiletransferView->iTotalBytes2Transfer-iFiletransferView->iTotalBytesTransfered)/1024;
//load label text
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_KB_2TRANSFER,KB2Transfer);
//set the label and clean
l->SetTextL(*txt);
CleanupStack::PopAndDestroy(txt);
iFileDetailsLabels.Append(l);
//label 4: Elapsed time (m,s):
l = new (ELeave) CEikLabel;
l->SetContainerWindowL(*this);
//create the array
CArrayFixFlat<TInt> *time=new(ELeave)CArrayFixFlat<TInt>(2);
CleanupStack::PushL(time);
time->AppendL(iFiletransferView->iElapsedTime/60); //minutes
time->AppendL(iFiletransferView->iElapsedTime%60); //seconds
//load label text
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_ELAPSED_TIME,*time);
//set the label and clean
l->SetTextL(*txt);
CleanupStack::PopAndDestroy(txt);
CleanupStack::PopAndDestroy(time);
iFileDetailsLabels.Append(l);
//label 5: Estimated time (m, s):
l = new (ELeave) CEikLabel;
l->SetContainerWindowL(*this);
//create the array
time=new(ELeave)CArrayFixFlat<TInt>(2);
CleanupStack::PushL(time);
time->AppendL(iFiletransferView->iEstimatedTime/60); //minutes
time->AppendL(iFiletransferView->iEstimatedTime%60); //seconds
//load label text
txt=StringLoader::LoadLC(R_FILETRANSFER_LABEL_ESTIMATED_TIME,*time);
//set the label and clean
l->SetTextL(*txt);
CleanupStack::PopAndDestroy(txt);
CleanupStack::PopAndDestroy(time);
iFileDetailsLabels.Append(l);
//label 6: Link
l = new (ELeave) CEikLabel;
l->SetContainerWindowL(*this);
//load label text
//.........这里部分代码省略.........
示例14: CreateWindowL
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();
}
示例15: ShowImageError
void CUploadContainer::ShowImageError(const TDesC& Descr, TInt Code)
{
CALLSTACKITEM_N(_CL("CUploadContainer"), _CL("ShowImageError"));
if (!iImgPlaceHolder) return;
iImgPlaceHolder->MakeVisible(ETrue);
TBuf<30> msg;
msg.Append(Descr); msg.Append(_L(": "));
msg.AppendNum(Code);
iImgPlaceHolder->SetTextL(msg);
}