예제 #1
0
void CAnimateFramesCtl::SetAnimationCtlWindowL(CCoeControl* aParent)
	{
	if (aParent)
		SetContainerWindowL(*aParent);
	else
		CreateWindowL();
	}
예제 #2
0
/**
 * Construct the control (second phase).
 *  Creates a window to contain the controls and activates it.
 * @param aRect bounding rectangle
 * @param aCommandObserver command observer
 * @param aParent owning parent, or NULL
 */ 
void CPluginsList::ConstructL( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver )
	{
	if ( aParent == NULL )
	    {
		CreateWindowL();
	    }
	else
	    {
	    SetContainerWindowL( *aParent );
	    }
	iFocusControl = NULL;
	iCommandObserver = aCommandObserver;
	InitializeControlsL();
	SetRect( aRect );
	
	iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue );
	iListBox->CreateScrollBarFrameL( ETrue );
	iListBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOn, CEikScrollBarFrame::EAuto );
	iListBox->UpdateScrollBarsL();
	TBuf<255> txt;
	CEikonEnv::Static()->ReadResource(txt,R_EMPTY_LISTBOX_TEXT);
	iListBox->View()->SetListEmptyTextL(txt);
	
	ActivateL();
	// [[[ begin generated region: do not modify [Post-ActivateL initializations]
	// ]]] end generated region [Post-ActivateL initializations]
	
	}
예제 #3
0
/**
  Second phase constructor for CConeBackgroundTestControl class.\n
  Sets the container window to the argument aParent.\n
  Sets the control's extenti.e; dimensions to aRect.\n
*/ 
void CConeBackgroundTestControl::ConstructL(const CCoeControl& aParent, const TRect& aRect)
    {
//	iConeBackgroundTestText = iCoeEnv->AllocReadResourceL(R_ConeBackgroundTest_TEXT_ZOOM);
    SetContainerWindowL(aParent);
    SetRect(aRect);
	iConeBackgroundTestText = KConeBackgroundTestText().AllocL();
	}
예제 #4
0
/**
   Auxiliary function for all Test Cases
  
   This method creates the user interface control on which tests are carried
   out.
   
 */
void CSimpleParentControl::ConstructL(CCoeControl& aContainer)
    {
    CreateWindowL();
    SetExtentToWholeScreen();
    SetContainerWindowL(aContainer);
    ActivateL();
	}
예제 #5
0
/**
  Second phase constructor for CTest5Control class.\n
  Sets the component control's container window to aContainer.\n
  Sets the parent control also to aContainer object.\n
  Sets the control's extent i.e; the dimensions to aRect.\n
  Sets the layout manager of the component to aLayoutMan object.\n
  Activate the control.\n
*/
void CTest5Control::ConstructL(CLayoutTest* aLayoutMan, 
	CCoeControl& aContainer, const TRect& aRect)
    {
	SetContainerWindowL(aContainer);
	SetParent(&aContainer);
	SetRect(aRect);
	SetLayoutManagerL(aLayoutMan);
	ActivateL();
	}
예제 #6
0
/**
  Second phase constructor for CConeBackgroundTestParentWithBg class.\n
  Sets the control's container window.\n
  Sets the control's extent, specifying a TRect.\n
  if the dummycontrol is ETrue, then CConeBackgroundTestParentWithNoBg object is instantiated as child control,\n
  else CConeBackgroundTestControl object is used.\n
  iBgDrawer object is set as the object responsible for drawing control's background.\n
*/
void CConeBackgroundTestParentWithBg::ConstructL(const CCoeControl& aParent, const TRect& aRect)
    {
    SetContainerWindowL(aParent);
    SetRect(aRect);
    if (iUseDummyCtrl)
    	iChildControl = CConeBackgroundTestParentWithNoBg::NewL(*this, aRect);
    else
		iChildControl = CConeBackgroundTestControl::NewL(*this, aRect);

	SetBackground(iBgDrawer);
	}
예제 #7
0
/**
  Second phase constructor for CConeBackgroundTestParentWithNoBg class.\n
  Sets a container window for component control, if the container is a window-owning control.\n
  Creates two child controls, first one is placed at the top left while other is at the bottom right.\n
*/
void CConeBackgroundTestParentWithNoBg::ConstructL(const CCoeControl& aParent, const TRect& aRect)
    {
    SetContainerWindowL(aParent);
    SetRect(aRect);
	TRect tlRect = aRect;
	tlRect.iBr.iX = (aRect.iBr.iX - aRect.iTl.iX)/2 + aRect.iTl.iX;
	tlRect.iBr.iY = (aRect.iBr.iY - aRect.iTl.iY)/2 + aRect.iTl.iY;
	iChildControl1 = CConeBackgroundTestControl::NewL(*this, tlRect);
	TRect brRect = tlRect;
	brRect.Move(tlRect.Width(), tlRect.Height());
	iChildControl2 = CConeBackgroundTestControl::NewL(*this, brRect);
	}
예제 #8
0
void CTextList::ConstructL(const TRect& aRect,const CCoeControl* aParent)
    {
    User::LeaveIfError(iSemaphore.OpenGlobal(KSemaphore));
    iItemTextArray = new(ELeave) CDesCArrayFlat(KNumItems);
    TBuf<128> textBuf;
    for(TInt i = 0; i < KNumItems; ++i)
        {
        textBuf.Format(KItemText, i);
        iItemTextArray->AppendL(textBuf);
        }

    // Create a set of values. The amplitude is the max. number of pixels to 
    // scroll the list box by per frame. The frequency is 1 meaning that only
    // one series of values will be created. For example: the list box will
    // gradually scroll faster until the max rate is acheived before starting
    // to slow down again. If the frequency was two then this would occur twice
    // for this cycle of the test.
    // Data sets for each test.
    WaveGenerator::GenerateSineWave(iCurrentDataSet, KNumSamples, 7, 1, ETrue);
    WaveGenerator::GenerateSineWave(iCurrentDataSet, KNumSamples, 5, 1, EFalse);
    // A data set that starts scrolling quickly and gradually slows down.
    iCurrentDataSet.AppendL(8);
    iCurrentDataSet.AppendL(10);
    iCurrentDataSet.AppendL(8);
    iCurrentDataSet.AppendL(7);
    iCurrentDataSet.AppendL(6);
    iCurrentDataSet.AppendL(5);
    iCurrentDataSet.AppendL(4);
    iCurrentDataSet.AppendL(2);
    iCurrentDataSet.AppendL(1);
    iCurrentDataSet.AppendL(0);
    
    // No owner, so create an own window
    if(!aParent)     
        {
        CreateWindowL();
        DrawableWindow()->PointerFilter(EPointerFilterDrag, 0);
        ActivateL();
        }
    // Use parent window
    else
        {
        // This is component in a compound control
        SetContainerWindowL(*aParent);
        } 
    SetRect(aRect);

    iTimer = CPeriodic::NewL(EPriorityNormal);
    TCallBack callback(&CTextList::TimerExpired, (TAny*)this);
    iTimer->Start(KAdjustPixelRatePeriod, KAdjustPixelRatePeriod, callback);
    }
void CCoordinateLineDisplay::ConstructL(class CCoeControl& aParent, 
                                        TInt aPosId, TInt aNegId)
{
   SetContainerWindowL(aParent);
   const TInt letters[] = {aNegId, aPosId, aPosId};
   const TInt num = sizeof(letters)/sizeof(*letters);
   TBuf<2> tmp;
   for(TInt a = 0; a < num; ++a){
      iCoeEnv->ReadResource(tmp, letters[a]);
      iDirections.Append(tmp[0]);
   }
   Format(0); //must be after iDirections has been set up.
   ActivateL();
}
예제 #10
0
// -----------------------------------------------------------------------------
// CSIPExGameView::ConstructL
// Symbian 2nd phase constructor that might leave.
// -----------------------------------------------------------------------------
//
void CSIPExGameView::ConstructL( const TRect& aRect, const CCoeControl* aParent )
    {
    iLabelSize = 20;
	iXOffset = 5;
	iYOffset = 5;
	iBoxW = 18;
	iMidW = 4;

    iRect = aRect;
    SetContainerWindowL( *aParent );
    SetRect( iRect );

    ActivateL();
    }
/**
 * Construct the control (second phase).
 *  Creates a window to contain the controls and activates it.
 * @param aRect bounding rectangle
 * @param aCommandObserver command observer
 * @param aParent owning parent, or NULL
 */ 
void CNPRListBox::ConstructL(const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver)
	{
	if ( aParent == NULL )
	    {
		CreateWindowL();
	    }
	else
	    {
	    SetContainerWindowL( *aParent );
	    }
	iFocusControl = NULL;
	iCommandObserver = aCommandObserver;
	InitializeControlsL();
	SetRect( aRect );
	ActivateL();
	}
예제 #12
0
void CSliderForDialog :: ConstructL(CCoeControl* aParent )
{	   
	// ��� ����������� ����� ������������ ���� �� ��������� �������
    font = CEikonEnv::Static()->NormalFont();    
 iParent=aParent;
    // ������ ������������ ����� �������� ����� 
    TBuf<50> tmpLabel;		
    tmpLabel.Num(iMaxVal);
    iMaxLbWidth = font->TextWidthInPixels( tmpLabel);
    SetContainerWindowL(*aParent);
    SetPointerCapture(ETrue);
    EnableDragEvents();
    ActivateL();
    iBgColor=KRgbBlack;
    iBgColor.SetAlpha(255);
}
예제 #13
0
void CVoIPListBox::ConstructL(const TRect& aRect, const CCoeControl* aParent,
        MEikCommandObserver* aCommandObserver)
    {
    CEikonEnv::Static()->ReadResource(KUnnamedStr, R_UNNAMED);

    if (aParent == NULL)
        {
        CreateWindowL();
        }
    else
        {
        SetContainerWindowL(*aParent);
        }
    iCommandObserver = aCommandObserver;
    InitializeControlsL();
    SetRect(aRect);
    ActivateL();
    }
void CPhotoModeListBox::ConstructL(CCoeControl* aWindowOwningContainer)
{
    // Application title
    iAppTitle = CCknAppTitle::NewL(CCknAppTitle::EWindow);
    iAppTitle->SetContainerWindowL(*this);
    iAppTitle->SetTextL(KTitleName, CCknAppTitle::EMainTitle);

    // Search results listbox
    iListbox = new(ELeave)CEikColumnListBox; // Column listbox with one column
    iListbox->ConstructL(aWindowOwningContainer,
                         CEikListBox::ENoExtendedSelection);
    iListbox->CreateScrollBarFrameL(ETrue);
    iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(
        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
    iListbox->SetObserver(this); // See HandleControlEventL
    iListbox->SetContainerWindowL(*aWindowOwningContainer);

    SetContainerWindowL(*aWindowOwningContainer);
}
예제 #15
0
// ---------------------------------------------------------------------------
// Symbian 2nd phase constructor can leave.
// ---------------------------------------------------------------------------
//
void CTactileExampleSquare::ConstructL(
    const TRect& aRect, const CCoeControl* aParent )
    {
    // Get a pointer to touch feedback instance
    iFeedback = MTouchFeedback::Instance();
    User::LeaveIfNull( iFeedback );

    SetContainerWindowL( *aParent );
    SetRect( aRect );
    
    // Set hit tester to be object itself
    SetHitTest( this );

    // Set feedback area for this control
    iFeedback->SetFeedbackArea( this, 0, Rect(),
        ETouchFeedbackBasic, ETouchEventStylusDown );

    ActivateL();
    }
void CMessageListBox::ConstructL(CCoeControl* aWindowOwningContainer)
{
    // Application title
    iAppTitle = CCknAppTitle::NewL(CCknAppTitle::EWindow);
    iAppTitle->SetContainerWindowL(*this);
    iAppTitle->SetTextL(*(iEikonEnv->AllocReadResourceL(R_LIST_SUBMENU_PUBLISH_SENDTOVAULT)), CCknAppTitle::EMainTitle);

    // Search results listbox
    iListbox = new(ELeave)CEikColumnListBox; // Column listbox with one column
    iListbox->ConstructL(aWindowOwningContainer,
                         CEikListBox::ENoExtendedSelection);
    iListbox->CreateScrollBarFrameL(ETrue);
    iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(
        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
    iListbox->SetObserver(this); // See HandleControlEventL
    iListbox->SetContainerWindowL(*aWindowOwningContainer);

    SetContainerWindowL(*aWindowOwningContainer);
}
void CFontSizeTestControl::ConstructL(const CCoeControl* aParent)
    {
    User::LeaveIfError(iSemaphore.OpenGlobal(KSemaphore));
    
    iBidiText = TBidiText::NewL(KFullScreenSampleText, EMaximumTextLines, TBidiText::ELeftToRight);
    if (aParent)
        {
        SetContainerWindowL(*aParent);
        }
    else
        {
        CreateWindowL();        
        }
    SetRect(TRect(TPoint(0,0), CTWindow::GetDisplaySizeInPixels()));
    if (!aParent)
        {
        ActivateL();
        }
    }
예제 #18
0
/**
 * Construct the control (second phase).
 *  Creates a window to contain the controls and activates it.
 * @param aRect bounding rectangle
 * @param aCommandObserver command observer
 * @param aParent owning parent, or NULL
 */ 
void CCalendarManagerContainer::ConstructL( const TRect& aRect, const CCoeControl* aParent, MEikCommandObserver* aCommandObserver )
	{
	if ( aParent == NULL )
	    {
		CreateWindowL();
	    }
	else
	    {
	    SetContainerWindowL( *aParent );
	    }
	iFocusControl = NULL;
	iCommandObserver = aCommandObserver;
	InitializeControlsL();
	SetRect( aRect );
	ActivateL();
	
	// [[[ begin generated region: do not modify [Post-ActivateL initializations]
	// ]]] end generated region [Post-ActivateL initializations]
	g_BgContext = CAknsBasicBackgroundControlContext::NewL(KAknsIIDQsnBgAreaMain, aRect, ETrue);		
	}
예제 #19
0
void CPanControl::ConstructL(const TRect& aRect, const CCoeControl* aParent)
    {
    User::LeaveIfError(iSemaphore.OpenGlobal(KSemaphore));
    iSourceBitmap = new(ELeave) CFbsBitmap;
    User::LeaveIfError(iSourceBitmap->Load(KBigBitmap, 0));
    
    // No owner, so create an own window
    if(!aParent)     
        {
        CreateWindowL();
        DrawableWindow()->PointerFilter(EPointerFilterDrag, 0);
        SetRect(aRect);
        ActivateL();
        }    
    else
        {
        // use parent window as compound control
        SetContainerWindowL(*aParent);
        SetRect(aRect);
        }
    }
예제 #20
0
/**
 * Construct the control (second phase).
 *  Creates a window to contain the controls and activates it.
 * @param aRect bounding rectangle
 * @param aCommandObserver command observer
 * @param aParent owning parent, or NULL
 */ 
void CSettingList::ConstructL( 
		const TRect& aRect, 
		const CCoeControl* aParent, 
		MEikCommandObserver* aCommandObserver )
	{
	if ( aParent == NULL )
	    {
		CreateWindowL();
	    }
	else
	    {
	    SetContainerWindowL( *aParent );
	    }
	iFocusControl = NULL;
	iCommandObserver = aCommandObserver;
	InitializeControlsL();
	SetRect( aRect );
	ActivateL();
	// [[[ begin generated region: do not modify [Post-ActivateL initializations]
	// ]]] end generated region [Post-ActivateL initializations]
	
	}
void CPositionDisplay::ConstructL(class CCoeControl& aParent, TInt aHeaderId,
                                  TInt aLatPlusId, TInt aLatMinusId, 
                                  TInt aLonPlusId, TInt aLonMinusId)
{
   SetContainerWindowL(aParent);

   iHeader = new (ELeave) CEikLabel();
   HBufC* hdr = iCoeEnv->AllocReadResourceLC(aHeaderId);
   iHeader->SetTextL(*hdr);
   CleanupStack::PopAndDestroy(hdr);

   const TInt KPIe8 = 314159265;
   const TInt LAT_MAX = KPIe8 / 2;
   const TInt LON_MAX = KPIe8;
   iLatControl = CCoordinateLineDisplay::NewL(*this, aLatPlusId,
                                              aLatMinusId, LAT_MAX,
                                              iFldClr, iTxtClr);
   iLonControl = CCoordinateLineDisplay::NewL(*this, aLonPlusId,
                                              aLonMinusId, LON_MAX,
                                              iFldClr, iTxtClr);
   ActivateL();
}
	void ConstructL(CCoeControl& aParent)
	{
		SetContainerWindowL( aParent );
		BaseConstructL();
		
		{
			MJuikSizer* sizer = Juik::CreateBoxSizerL( Juik::EVertical );				 
			RootContainer().SetRootSizerL( sizer );
		}

		TInt runningId = 1000;

		const TInt KMetaDataSizer = runningId++;
		const TInt KMetaTextSizer = runningId++;
		{
			MJuikSizer* sizer = Juik::CreateBoxSizerL( Juik::EHorizontal );	
			RootContainer().AddSizerL( sizer, KMetaDataSizer );
			RootContainer().GetRootSizerL()->AddL( *sizer, 1, Juik::EExpand );
		}
		
		{
			TJuikLayoutItem lay = Layout().GetLayoutItemL(LG_feed_controls, LI_feed_controls__jaicon);			
			TSize sz = TSize(40,40); //lay.Size();
			iStateIcon = CJuikImage::NewL( NULL, sz );
			RootContainer().AddControlL( iStateIcon, runningId++ );
			
			lay = Layout().GetLayoutItemL(LG_feed_controls_margins, LI_feed_controls_margins__jaicon);			
			iStateIcon->iMargin = lay.Margins();
			
			CGulIcon* icon = Jaicons().GetJaiconL( 106  ); // FIXME
			if ( icon )
				iStateIcon->UpdateL( *icon );
			
			RootContainer().GetSizerL( KMetaDataSizer )->AddL( *iStateIcon, 0, Juik::EExpandNot ); 
		}

		{
			MJuikSizer* sizer = Juik::CreateBoxSizerL( Juik::EVertical );	
			RootContainer().AddSizerL( sizer, KMetaTextSizer );
			RootContainer().GetSizerL( KMetaDataSizer )->AddL( *sizer, 1, Juik::EExpand );
		}
		
		
		{
			iState = CJuikLabel::NewL( PrimaryTextColor(), PrimaryHighlightTextColor(),
									   JuikFonts::Tiny(), RootContainer() );
			RootContainer().AddControlL( iState, runningId++ );
			iState->SetAlignment( EHCenterVCenter );
			iState->SetLabelAlignment( ELayoutAlignCenter );
			RootContainer().GetSizerL( KMetaTextSizer )->AddL( *iState, 0, Juik::EExpand ); 
		}

		{
			iDownloadButton = CJsuiButton::NewL( _L("Download image"), iDelegates );
			RootContainer().AddControlL( iDownloadButton, runningId++ );
			RootContainer().GetSizerL( KMetaTextSizer )->AddL( *iDownloadButton, 0, Juik::EExpandNot | Juik::EAlignCenterHorizontal ); 
		}


// 		{
// 			iDownloadAnimation = CDownloadAnimation::NewL( RootContainer() );
// 			RootContainer().AddControlL( iDownloadAnimation, runningId++ );
// 			RootContainer().GetSizerL( KMetaTextSizer )->AddL( *iDownloadAnimation, 0, Juik::EExpand ); 
// 		}
		
		
		{
			TSize sz = Layout().GetLayoutItemL(LG_feed_controls, 
											   LI_feed_controls__thumbnail).Size();
			if ( iFlags & FeedUi::EShowFullImage )
				{
					TSize screen = MJuikLayout::ScreenSize();
					if ( screen.iWidth >= 240 ||screen.iHeight >= 240 )
						sz = TSize(240,240);
					else
						sz = TSize(100,100);
				}
			iPhoto = CJuikPhoto::NewL( iContainer, sz, TSize(0,0) );
			RootContainer().AddControlL( iPhoto, runningId++ );
			iPhoto->SetBorderColor( KRgbWhite );
			if ( iFlags & FeedUi::EFocusInsideControl )
				{
					TRgb focusBgColor =  BubbleFocusColor();
					iPhoto->EnableFocusColor( focusBgColor );
				}
			RootContainer().GetRootSizerL()->AddL( *iPhoto, 0, Juik::EExpand ); 
			iPhoto->AddListenerL( *this );


		}
		
		
		FeedStorage().SubscribeL(this);		
	}
	void ConstructL(CCoeControl* aParent)
	{
		SetContainerWindowL( *aParent );
		iScrollList = CSoftScrollList::NewL(this);
		InitListL();
	}
예제 #24
0
/**
 * Constructs the text control with the complex fonts.
 */
void CComplexFontsControl::ConstructL(const CCoeControl* aParent)
    {
    User::LeaveIfError(iSemaphore.OpenGlobal(KSemaphore));
    if (aParent)
        {
        SetContainerWindowL(*aParent);
        }
    else
        {
        CreateWindowL();
        }
    // Create text object, text view and layout.
    iParaFormatLayer = CParaFormatLayer::NewL(); 
    iCharFormatLayer = CCharFormatLayer::NewL();
    // Create an empty rich text object
    iRichText = CRichText::NewL(iParaFormatLayer, iCharFormatLayer);
    
    iScreen = new(ELeave) CWsScreenDevice(ControlEnv()->WsSession());
    User::LeaveIfError(iScreen->Construct()); // default screen used
    
    TPixelsAndRotation pixelsAndRotation;
    iScreen->GetDefaultScreenSizeAndRotation(pixelsAndRotation);
    
    // Create the text layout, (required by text view),
    // with the text object and a wrap width (=width of view rect)
    iLayout = CTextLayout::NewL(iRichText,pixelsAndRotation.iPixelSize.iWidth);
    
    // Create text view
    iTextView = CTextView::NewL(iLayout, pixelsAndRotation.iPixelSize,
            iScreen, iScreen, &Window(), 0, // no window group
            &iCoeEnv->WsSession()); // new view
        
    SetRect(TRect(TPoint(0, 0), pixelsAndRotation.iPixelSize));

    // load up text
    iRichText->InsertL(0, KComplexFontsText);

    // break up into paragraphs for CRichText by replacing \n characters in original text
    // with CEditableText::EParagraphDelimiter
    TPtrC complexFontsTextPtr(KComplexFontsText);
    TInt eos = complexFontsTextPtr.Length();
    for (TInt paragraphBreakLocation = 0; paragraphBreakLocation < eos; paragraphBreakLocation++)
        {
        if (complexFontsTextPtr[paragraphBreakLocation] == '\n')
            {
            iRichText->DeleteL(paragraphBreakLocation, 1);
            iRichText->InsertL(paragraphBreakLocation, CEditableText::EParagraphDelimiter);
            }
        }
    
    TCharFormat charFormat;
    TCharFormatMask charFormatMask;
    // format the first paragraph "Class RWindow" as orange and a bit bigger than the body
    charFormat.iFontPresentation.iTextColor= TLogicalRgb(TRgb(0x0099ff));
    charFormatMask.SetAttrib(EAttColor);
    charFormat.iFontSpec.iHeight = KHeaderFontSize; 
    charFormatMask.SetAttrib(EAttFontHeight);
    
    TInt headerLength = 0;
    TInt headerStart = iRichText->CharPosOfParagraph(headerLength, KHeadingParagraph);
    iRichText->ApplyCharFormatL(charFormat, charFormatMask, headerStart, headerLength);
    charFormatMask.ClearAll();

    // format "Class" as Sans Serif
    charFormat.iFontSpec.iTypeface.iName = KNokiaSeries60Font;
    charFormatMask.SetAttrib(EAttFontTypeface);
    iRichText->ApplyCharFormatL(charFormat, charFormatMask, headerStart, 5);
    charFormatMask.ClearAll();

    // make the rest of the text smaller  
    charFormat.iFontSpec.iHeight = KBodyFontSize;
    charFormatMask.SetAttrib(EAttFontHeight);
    TInt textLength = iRichText->DocumentLength();
    iRichText->ApplyCharFormatL(charFormat, charFormatMask, headerLength, textLength - headerLength);
    charFormatMask.ClearAll();

    TParaFormatMask paraFormatMask;
    // crunch main body a bit closer together to show more on the little screen
    // and indent left margin 
    iParaFormat.iLineSpacingInTwips = KBodyLineSpacing;
    paraFormatMask.SetAttrib(EAttLineSpacing);
    iParaFormat.iLineSpacingControl = CParaFormat::ELineSpacingExactlyInPixels;
    paraFormatMask.SetAttrib(EAttLineSpacingControl);
    iParaFormat.iLeftMarginInTwips = KBodyIndent;
    paraFormatMask.SetAttrib(EAttLeftMargin);
    iRichText->ApplyParaFormatL(&iParaFormat, paraFormatMask, headerLength, textLength - headerLength);
    paraFormatMask.ClearAll();

    TInt length = 0;
    TInt start = 0;
    
    // put a grey background on "class RWindow : public RDrawableWindow;"
    start = iRichText->CharPosOfParagraph(length, KClassParagraph);
    iParaFormat.iFillColor = TLogicalRgb(TRgb(0xdddddd));
    paraFormatMask.SetAttrib(EAttFillColor);
    iRichText->ApplyParaFormatL(&iParaFormat, paraFormatMask, start, length);
    paraFormatMask.ClearAll();
    
    // make "Description" and "Derivation" subheadings bold
    charFormat.iFontSpec.iFontStyle.SetStrokeWeight(EStrokeWeightBold);
    charFormatMask.SetAttrib(EAttFontStrokeWeight);
    start = iRichText->CharPosOfParagraph(length, KDescriptionHeading);
    iRichText->ApplyCharFormatL(charFormat, charFormatMask, start, length);
    start = iRichText->CharPosOfParagraph(length, KDerivationHeading);
    iRichText->ApplyCharFormatL(charFormat, charFormatMask, start, length);
    charFormatMask.ClearAll();
    
    // all the paragraphs between and including "Description" and "Derivation" are in sans serif 
    // (the default CRichText font is serif)
    TInt paragraphNumber = 0;

    charFormat.iFontSpec.iTypeface.iName = KNokiaSeries60Font;
    charFormatMask.SetAttrib(EAttFontTypeface);
    for (paragraphNumber = KDescriptionHeading; paragraphNumber <= KDerivationHeading; paragraphNumber++)
        {
        start = iRichText->CharPosOfParagraph(length, paragraphNumber);
        iRichText->ApplyCharFormatL(charFormat, charFormatMask, start, length);
        }
    charFormatMask.ClearAll();
    
    // for each line in the "Derivation" section
    //  progressively indent left margin
    //  make class name blue underlined (it starts two characters after the 
    //    beginning of each paragraph and goes to the space before the '-')
    //  make descriptive text sans serif (from the '-' to the end of the paragraph)
    paraFormatMask.SetAttrib(EAttLeftMargin);
    charFormat.iFontPresentation.iTextColor= TLogicalRgb(TRgb(0xA27316));
    charFormat.iFontPresentation.iUnderline = EUnderlineOn;
    for (paragraphNumber = KFirstDerivation; paragraphNumber <= KLastDerivation; paragraphNumber++)
        {
        iParaFormat.iLeftMarginInTwips = (paragraphNumber - KFirstDerivation + 2)*KBodyIndent;
        start = iRichText->CharPosOfParagraph(length, paragraphNumber);
        iRichText->ApplyParaFormatL(&iParaFormat, paraFormatMask, start, length);
        TInt dash = 0;
        for (dash = start; dash < start + length; dash++)
            {
            if (complexFontsTextPtr[dash] == '-')
                {
                break;
                }
            }
        charFormatMask.SetAttrib(EAttColor);
        charFormatMask.SetAttrib(EAttFontUnderline);
        TInt classNameLength = (dash - 1) - (start + 2);
        iRichText->ApplyCharFormatL(charFormat, charFormatMask, start + 2, classNameLength);
        charFormatMask.ClearAll();
        charFormatMask.SetAttrib(EAttFontTypeface);
        TInt descriptionLength = length - classNameLength - 4;
        iRichText->ApplyCharFormatL(charFormat, charFormatMask, dash, descriptionLength);
        charFormatMask.ClearAll();
        }
    paraFormatMask.ClearAll();
    
    if (!aParent)
        {
        ActivateL();
        }
    }
void CContactsSubScreenView::ConstructL(CCoeControl* aWindowOwningContainer)
{
    // Application title
    iAppTitle = CCknAppTitle::NewL(CCknAppTitle::EWindow);
    iAppTitle->SetContainerWindowL(*this);

	TBuf<50> titlename;
	TBuf<50> formatBuf;

	titlename.Copy(_L(""));
	formatBuf.Copy(_L(""));
	formatBuf.Append(*(iEikonEnv->AllocReadResourceL(R_STATUSTEXT_CONTACTS_UPLOADED)));
	titlename.Format(formatBuf, 0);

    iAppTitle->SetTextL(titlename, CCknAppTitle::EMainTitle);

    // Search results listbox
    iListbox = new(ELeave)CEikColumnListBox; // Column listbox with one column
    iListbox->ConstructL(aWindowOwningContainer,
        CEikListBox::ENoExtendedSelection);
    iListbox->CreateScrollBarFrameL(ETrue);
    iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(
        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
    iListbox->SetObserver(this); // See HandleControlEventL
    iListbox->SetContainerWindowL(*aWindowOwningContainer);

    SetContainerWindowL(*aWindowOwningContainer);

	// Set the listbox's first column to fill the listbox's whole width
    CColumnListBoxData* colData = iListbox->ItemDrawer()->ColumnData();
    if(colData)
    {
		colData->SetColumnWidthPixelL(0, 200);       
    }

	iListbox->SetItemHeightL(30);

	if(iAppUi.iStoragePath == 1)
	{
	  CDesCArray* smsnames = iAppUi.GetSmsNameList();	

	  CDesCArray* smsmobiles = iAppUi.GetSmsMobileList();

	  if(smsnames->Count() == 0)
	  {
		iContactsArray = new (ELeave) CDesCArrayFlat(1);
		iMobileArray   = new (ELeave) CDesCArrayFlat(1);
	  }
	  else
	  {
		iContactsArray = new (ELeave) CDesCArrayFlat(smsnames->Count());
		iMobileArray   = new (ELeave) CDesCArrayFlat(smsnames->Count());
	  }

	  for(int i = 0 ; i < smsnames->Count() ; i++)
	  {
		 iContactsArray->AppendL(smsnames->MdcaPoint(i)); 
		 iMobileArray->AppendL(smsmobiles->MdcaPoint(i)); 
	  }	

	  SetData();
	}
	else
	{
		iContactsArray = new (ELeave) CDesCArrayFlat(12);
		iMobileArray   = new (ELeave) CDesCArrayFlat(12);
	}
}
예제 #26
0
void CConeBackgroundTestNonWindowOwningControl::ConstructL(const CCoeControl& aParent, const TRect& aRect)
    {
    SetContainerWindowL(aParent);
    SetRect(aRect);
	}