How to create editor with simple white background?

Login to reply to this topic.
Sat, 2007-12-22 14:23
Joined: 2006-06-27
Forum posts: 34

Good day.

I have added to my compound control new CEikEdwin component and faced with strange problem when instead white backround I see skin background in my editor, and also border in my editor does not drawing. During editing text in editor background and border of editor remain the same. What I need to do for enabling white bg and border?
My SDK is Symbian9 FP1.

//.H file

enum TControlId {
        EControlSearchField,
        EControlsCount
};



//.CPP file


void CScreenContainer::ConstructL(const TRect& aRect, CScreenView* aView)
{
        CreateWindowL();
        iBgContext = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, TRect(TPoint(0,0), aRect.Size()), EFalse);

        iSearchField = new(ELeave) CEikEdwin();
        iSearchField->ConstructL( 0, 0, 0, 1 /*lines count*/ );
        iSearchField->SetContainerWindowL( *this );
        iSearchField->SetFocusing( ETrue );
        iSearchField->SetBorder( TGulBorder::ESingleGray );

        SetRect(aRect);
        ActivateL();
        DrawNow();
}

TInt CScreenContainer::CountComponentControls() const
{
        return EControlsCount;
}



CCoeControl* CScreenContainer::ComponentControl(TInt aIndex) const
{
        switch(aIndex)
        {
                case EControlSearchField:
                        return iSearchField;
                default:
                        return NULL;
        }
}


void CMenuScreenContainer::SizeChanged()
{
        TInt searchFieldHeight = 50;
        iSearchField->SetExtent(
                TPoint( 0,  0),
                TSize( Rect().Width(), searchFieldHeight ) );
}


Wed, 2007-12-26 07:48
Joined: 2007-08-31
Forum posts: 54
Re: How to create editor with simple white background?

For Changing the back ground Color try with this code

CParaFormatLayer*pFormatLayer = CEikonEnv::NewDefaultParaFormatLayerL();
CleanupStack::PushL(pFormatLayer);
CParaFormat* paraFormat=CParaFormat::NewLC();
TParaFormatMask paraFormatMask;
pFormatLayer->SenseL(paraFormat,paraFormatMask);
paraFormat->iFillColor=aColor;
paraFormatMask.SetAttrib(EAttFillColor);
pFormatLayer->SetL(paraFormat, paraFormatMask);

iEdwin->SetParaFormatLayer(pFormatLayer); // Edwin takes the ownership

CleanupStack::PopAndDestroy(paraFormat);
CleanupStack::Pop(pFormatLayer);

thanks
praveenvlm

  • Login to reply to this topic.