void CContextMediaBoxDrawer::DrawItemText (TInt aItemIndex, const TRect &aItemTextRect, TBool aItemIsCurrent, TBool aViewIsEmphasized, TBool aItemIsSelected) const { CALLSTACKITEM_N(_CL("CContextMediaBoxDrawer"), _CL("DrawItemText")); /*CWindowGc& gc=CEikonEnv::Static()->SystemGc(); gc.SetPenStyle(CGraphicsContext::ENullPen); gc.SetBrushColor(KRgbWhite); gc.SetBrushStyle(CGraphicsContext::ESolidBrush); gc.DrawRect(aItemTextRect);*/ TInt unread = 0; TInt64 parentId=CPostStorage::RootId(); const CCMPost* post=iPostArray->GetPostAt(aItemIndex); if (post) { unread = post->iUnreadCounter(); parentId = post->iParentId(); } if (!iStandAlone) { if ((parentId != CPostStorage::RootId()) || (unread==0)) { itemd->SetSubCellSizeL(1, TSize(124, 20) ); itemd->SetSubCellPositionL(2, TPoint(176, 0) ); } else { itemd->SetSubCellSizeL(1, TSize(104, 20) ); itemd->SetSubCellPositionL(2, TPoint(156, 0) ); } } TListItemProperties prop; if (!post){ itemd->SetSubCellFontL(1, LatinBold12() ); prop.SetUnderlined(EFalse); } else { if (!iStandAlone) { prop.SetUnderlined(ETrue); if (unread) { itemd->SetSubCellFontL(1, LatinBold12() ); } else { itemd->SetSubCellFontL(1, LatinPlain12() ); } } else { if (unread) { itemd->SetSubCellFontL(0, iEikEnv->NormalFont() ); } else { itemd->SetSubCellFontL(0, iEikEnv->DenseFont() ); } } } ((CFormattedCellListBoxItemDrawer*)this)->SetPropertiesL(aItemIndex, prop); CFormattedCellListBoxItemDrawer::DrawItemText(aItemIndex, aItemTextRect, aItemIsCurrent, aViewIsEmphasized, aItemIsSelected); }
// ----------------------------------------------------------------------------- // CTestSDKLists::TestFCLBIDSetPropertiesL // ----------------------------------------------------------------------------- // TInt CTestSDKLists::TestFCLBIDSetPropertiesL( CStifItemParser& /*aItem*/ ) { // Print to UI _LIT( KTestModule, "EIKFRLBTestModule" ); _LIT( KTestFCLBIDSetPropertiesL, "In TestFCLBIDSetPropertiesL" ); TestModuleIf().Printf( 0, KTestModule, KTestFCLBIDSetPropertiesL ); // Print to log file iLog->Log( KTestFCLBIDSetPropertiesL ); CEikFormattedCellListBox* listBox = new( ELeave ) CAknDoubleStyle2ListBox(); CleanupStack::PushL( listBox ); listBox->SetContainerWindowL( *iContainer ); CDesCArray* textArray = CCoeEnv::Static()->ReadDesCArrayResourceL( R_TESTLIST_ITEM_ARRAY ); listBox->ConstructL( iContainer, EAknListBoxSelectionList ); listBox->Model()->SetItemTextArray( textArray ); listBox->Model()->SetOwnershipType( ELbmOwnsItemArray ); iContainer->SetControlL( listBox ); CFormattedCellListBoxItemDrawer* drawer = listBox->ItemDrawer(); TInt err = KErrNone; TListItemProperties itemProp; itemProp.SetBold( ETrue ); itemProp.SetItalics( ETrue ); itemProp.SetUnderlined( ETrue ); itemProp.SetDimmed( ETrue ); itemProp.SetColor( KRgbGray ); itemProp.SetSeparatorAfter( ETrue ); TRAP( err, drawer->SetPropertiesL( KNum, itemProp ) ); iContainer->ResetControl(); CleanupStack::Pop( listBox ); listBox = NULL; return KErrNone; }