Exemplo n.º 1
0
void Game::Draw()
{
	//spr->Draw(0, 220);

	DrawRect(0, 220, 800, 210, 214, 237, 227);

	//text->Draw(850, 10, "Profit: $" + ThousandString(std::to_string(profit)) + ".00" );
	//text->Draw(850, 40, "Total waiting time caused: " + SecondsToTime(timeWasted) + " (+" + std::to_string(noOfWaitingCars) + ") per second");

	textTime->Draw(850, 100, ToTime((int)gTime));
	
	if (!gPause)
	{
		// Always have an array ready of cars waiting.
		carsWaiting.clear();
		for (unsigned i = 0; i < cars.size(); i++)
		{
			if (cars.at(i)->GetChargeMe())
			{
				carsWaiting.push_back(cars.at(i));
			}
		}

		ChargeCars();
		CalcWaitingTime();

		btnPause->Draw();
	}
	else
	{
		btnPlay->Draw();
	}

	for (unsigned i = 0; i < cars.size(); i++)
	{
		cars.at(i)->Draw();
	}
	
	DrawSchedule();
	UpdateButtons();

	text->Draw(825, 470, "Late Seconds: " + ToTime((int)dueLateness));
	text->Draw(825, 490, "Late Cars:    " + std::to_string(dueLatenessAmm));

	text->Draw(825, 570, "Late Seconds: " + ToTime((int)hodgeLateness));
	text->Draw(825, 590, "Late Cars:    " + std::to_string(hodgeLatenessAmm));

	
	
}
Exemplo n.º 2
0
/**
 *	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;
//			}
//		}
	}