Categories: How To | Code Examples | S60
I used CEikEdwin::SetBackgroundColorL() to draw a custom Background color in 2nd and it works fine, but not draw in 3rd. For 3rd edition, you should use CParaFormat and TextView.
void CMyEditorContainer::ConstructL(const TRect& aRect) { ... iEdwin = new (ELeave) CEikGlobalTextEditor; iEdwin->SetContainerWindowL(*this); iEdwin->SetBackgroundColorL(KMyCustomColor); iEdwin->TextView()->SetBackgroundColor(KMyCustomColor); ... } Everytime after you change the text: CParaFormat* pf = new (ELeave) CParaFormat(); CleanupStack::PushL(pf); pf->iFillColor = KMyCustomColor; TParaFormatMask mask; mask.SetAttrib(EAttFillColor); iEdwin->ApplyParaFormatL(pf, mask); CleanupStack::PopAndDestroy();
class CMyEditorContainer: public CCoeControl, MCoeControlObserver { ... private: CEikGlobalTextEditor* iEdwin; ... }
How to use custom background color for edwin in 2nd
--