示例#1
0
void CDxDatePickerDay::Draw(CDCHandle dc)
{
    m_bVisible = FALSE;

    if (m_rcDay.IsRectEmpty())
        return;

    m_bVisible = DrawDay(dc);
}
/**
 *	Draw container contents.
 */				
void CCalendarManagerContainer::Draw( const TRect& aRect ) const
	{
	g_Space_X = (aRect.Width() - 7) / 8;
	g_Space_Y = (aRect.Height() - 8) / 8;
	g_Pos_Y = 0;
	// [[[ begin generated region: do not modify [Generated Contents]
	CWindowGc& gc = SystemGc();
	gc.Clear( aRect );
	
	// ]]] end generated region [Generated Contents]

	MAknsSkinInstance* i_BgSkin = AknsUtils::SkinInstance();
	MAknsControlContext* i_BgControl = AknsDrawUtils::ControlContext(this);			
	AknsDrawUtils::Background(i_BgSkin, i_BgControl, this, gc, aRect);	
	
	TRgb i_Default_Font_Color1;
	TRgb i_Default_Font_Color2;
	TRgb i_Default_Grid_Color1;
	TRgb i_Default_Grid_Color2;
	TRgb i_Default_Select_Color;
	AknsUtils::GetCachedColor(i_BgSkin, i_Default_Font_Color1, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG22);
	AknsUtils::GetCachedColor(i_BgSkin, i_Default_Font_Color2, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG21);	
	AknsUtils::GetCachedColor(i_BgSkin, i_Default_Grid_Color1, KAknsIIDQsnLineColors, EAknsCIQsnLineColorsCG1);
	AknsUtils::GetCachedColor(i_BgSkin, i_Default_Grid_Color2, KAknsIIDQsnLineColors, EAknsCIQsnLineColorsCG2);
	AknsUtils::GetCachedColor(i_BgSkin, i_Default_Select_Color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG11);		
		
	const CFont* i_Font = iEikonEnv->LegendFont();	
	gc.UseFont(i_Font);	
	DrawSchedule(gc, aRect, i_Default_Font_Color1, *i_Font);
	DrawRoundRect(gc, aRect, i_Default_Grid_Color2);
	DrawWeekName(gc, aRect, i_Default_Font_Color1, *i_Font);
	DrawGrid(gc, aRect, i_Default_Grid_Color1);
	DrawDay(gc, aRect, i_Default_Font_Color1, i_Default_Font_Color2, *i_Font);
	DrawCurrentDay(gc, i_BgSkin, i_Default_Select_Color, *i_Font);
	DrawWeek(gc, aRect, i_Default_Font_Color1, *i_Font);		
	gc.DiscardFont();
		
	CAknViewAppUi* i_AppUi = static_cast<CAknViewAppUi*>(iCoeEnv->AppUi());	
	CAknView* i_View = i_AppUi->View(TUid::Uid(ECalendarManagerContainerViewId));
	i_View->HandleCommandL(ECalendarManagerContainerView_KeyCommand);
		
//	TInt p = 20;
//	TInt q = 20;
//	TInt a = 0;
//	TInt b = 20;
//	
//	for (TInt i = 0;i <= 62;i++)
//		{
//		TRgb i_Color;
//		AknsUtils::GetCachedColor(i_BgSkin, i_Color, KAknsIIDQsnTextColors, i);
//		gc.SetPenColor(i_Color);
//		
//		TBuf<10> k;
//		k.AppendNum(i);
//				
//		gc.DrawText(k, TPoint(a, b));
//		a += p;
//		
//		if (i % 10 == 0 && i > 0)
//			{
//			a = 0;
//			b += q;
//			}
//		}
	}