Exemplo n.º 1
0
void CSmiley::DrawEyes(CWindowGc &aGc) const
	{
		// Draw the eyes
	TPoint leftEye(iSmileyWidth / 3, iSmileyHeight / 3);
	TPoint rightEye(iSmileyWidth * 2 / 3, iSmileyHeight / 3);
	aGc.SetPenSize(TSize(5, 5));
	aGc.Plot(iSmileyRect.iTl + leftEye);
	aGc.Plot(iSmileyRect.iTl + rightEye);
	}
Exemplo n.º 2
0
void CCalendarManagerContainer::DrawGrid(CWindowGc& gc, const TRect& aRect, const TRgb& p_Default_Grid_Color1) const
	{
	gc.SetPenColor(p_Default_Grid_Color1);
	gc.SetPenSize(TSize(2, 2));	
	gc.DrawLine(TPoint(0, g_Pos_Y), TPoint(aRect.Width(), g_Pos_Y));
		
	gc.SetPenSize(TSize(1, 1));
	TInt i_Pos_X = g_Space_X;
	for (TInt i = 0; i < 7; i++)
		{
		gc.DrawLine(TPoint(i_Pos_X, g_Pos_Y), TPoint(i_Pos_X, aRect.Height()));
		i_Pos_X += g_Space_X + 1;
		}
	
	g_Pos_Y += 1;
	TInt i_Pos_Y = g_Pos_Y;	
	for (TInt i = 0; i < 6; i++)
		{
		gc.DrawLine(TPoint(g_Space_X, i_Pos_Y), TPoint(aRect.Width(), i_Pos_Y));
		i_Pos_Y += g_Space_Y + 2;
		}
	}
Exemplo n.º 3
0
void CSmiley::DrawEyebrow(CWindowGc & aGc, TBool bSmiling) const
	{
	//Draw the mouth, smiling or looking sad.
	aGc.SetPenSize(TSize(1, 1));
	aGc.SetPenColor(KRgbWhite);
	if (bSmiling)
		{
		aGc.DrawArc(iFrownRect,
				iFrownRect.iTl + TPoint(iSmileyWidth / 2, iFrownRect.Height() / 2),
				iFrownRect.iTl + TPoint(0, iFrownRect.Height() / 2));
		}
	else
		{
		aGc.DrawArc(iSmileRect,
				iSmileRect.iTl + TPoint(0, iSmileRect.Height() / 2),
				iSmileRect.iTl + TPoint(iSmileyWidth / 2, iSmileRect.Height() / 2));
		}
	}
Exemplo n.º 4
0
void CMainWindow::HandlePointerMoveBufferReady()
	{
	TPoint pnts[KPointerMoveBufferSize];
	TPtr8 ptr((TUint8 *) &pnts, sizeof(pnts));
	TInt numPnts = Window().RetrievePointerMoveBuffer(ptr);
	TRect redrawRect(Window().Position(), Window().Size());

	CWindowGc* gc = SystemGc();
	gc->Activate(Window());
	gc->SetPenColor(KRgbBlue);
	gc->SetPenSize(TSize(2, 2));
	Window().Invalidate();
	Window().BeginRedraw(redrawRect); // N.B. Redrawer::RunL() gets called with this 
	// rectangle - must give it a non-zero value
	for (TInt index = 0; index < numPnts; index++)
		{
		gc->DrawLineTo(pnts[index]);
		}
	Window().EndRedraw();
	gc->Deactivate();
	}