
Originally Posted by
bitnir
1) Check that your code supports themes. You AppUi ConstructL code should start like this:
BaseConstructL(EAknEnableSkin);
// Create view object
iAppView = CYourView::NewL( ClientRect() );
iAppView->SetMopParent(this);
AddToStackL(iAppView);
Your container should contain following variable:
MAknsControlContext* iBackGround; // for skins support
Your container needs to create iBackGround in ConstructL:
iBackGround = CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, Rect(), EFalse );
And you need to implement background drawinf in your containers Draw-function:
void CYourView::Draw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
// TODO: Add your drawing code here
// example code...
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
MAknsControlContext* cc = AknsDrawUtils::ControlContext( this );
AknsDrawUtils::Background( skin, cc, this, gc, aRect );
}
After this all contained controls should be "transparent" by default.
2) I'll just copy some of my code here:
TCharFormat check;
TCharFormatMask charFormatMask;
const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontTitleFont);
AknLayoutUtils::FontFromId(EAknLogicalFontPrimaryFont);
check.iFontSpec = font->FontSpecInTwips();
charFormatMask.SetAttrib(EAttFontStrokeWeight);
charFormatMask.SetAttrib(EAttFontPosture);
charFormatMask.SetAttrib(EAttFontUnderline);
charFormatMask.SetAttrib(EAttColor);
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
TRgb textcol;
AknsUtils::GetCachedColor(skin,textcol,KAknsIIDQsnTextColors,EAknsCIQsnTextColorsCG6);
--> check.iFontPresentation.iTextColor = TLogicalRgb(textcol);
text->ApplyCharFormatL(check,charFormatMask,iEditor->CursorPos(),aText.Length());
This sets the color that theme developer has suggested to be the main pane text color. Just change the line marked with an arrow to change the text color to any value you wish. (this code contains some unnecessary stuff for your use, just use the bits you need)
3) Could you clarify your question?