当前位置: 首页>>代码示例>>C++>>正文


C++ SystemGc函数代码示例

本文整理汇总了C++中SystemGc函数的典型用法代码示例。如果您正苦于以下问题:C++ SystemGc函数的具体用法?C++ SystemGc怎么用?C++ SystemGc使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SystemGc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: switch

void CTestContainer::Draw(const TRect& /*aRect*/) const
	{
	switch(iBackgroundType)
		{	
	case EBackgroundBlackRedGreenYellowStripes:
		{
		const TRect rect=Rect();
		CWindowGc& gc=SystemGc();
		gc.SetPenStyle(CGraphicsContext::ENullPen);
		gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
		gc.SetBrushColor(iColor);
		TInt yOffset = rect.Height() / 4;
		TRect portionRect(rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iTl.iY + yOffset);
		gc.DrawRect(portionRect);
		gc.SetBrushColor(KRgbRed);
		portionRect.iTl.iY = portionRect.iBr.iY;
		portionRect.iBr.iY += yOffset;
		gc.DrawRect(portionRect);
		gc.SetBrushColor(KRgbGreen);
		portionRect.iTl.iY = portionRect.iBr.iY;
		portionRect.iBr.iY += yOffset;
		gc.DrawRect(portionRect);
		gc.SetBrushColor(KRgbYellow);
		portionRect.iTl.iY = portionRect.iBr.iY;
		portionRect.iBr.iY = rect.iBr.iY;
		gc.DrawRect(portionRect);
		gc.SetBrushColor(KRgbWhite);
		}
		break;
	case EBackgroundYellow:
		{
		const TRect rect=Rect();
		CWindowGc& gc=SystemGc();
		gc.SetPenStyle(CGraphicsContext::ENullPen);
		gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
		gc.SetBrushColor(KRgbYellow);
		gc.DrawRect(rect);
		}
		break;
	case EBackgroundBlue:
		{
		const TRect rect=Rect();
		CWindowGc& gc=SystemGc();
		gc.SetPenStyle(CGraphicsContext::ENullPen);
		gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
		gc.SetBrushColor(KRgbBlue);
		gc.DrawRect(rect);
		}
		break;
	default:
		break;
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:53,代码来源:TBMPAnimStep.cpp

示例2: SystemGc

void CHelloControl::Draw(const TRect& /* aRect */) const
	{
	// draw surrounding rectangle
	SystemGc().DrawRect(Rect());
	// calculate rectangle to draw into
	TRect rect = Rect();
	rect.Shrink(1, 1);
	// calculate vertical centering
	CFont *font = iMessageFont;
	TInt ascent = (rect.Height() - font->HeightInPixels()) / 2
			+ font->AscentInPixels();
	// draw text in rectangle
	CWindowGc& gc = SystemGc();
	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
	gc.UseFont(iMessageFont);
	switch (Phase())
		{
		case 0:
			gc.DrawText(KTxtDrawCase0, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 1:
			gc.DrawText(KTxtDrawCase1, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 2:
			gc.DrawText(KTxtDrawCase2, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 3:
			gc.DrawText(KTxtDrawCase3, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 4:
			gc.DrawText(KTxtDrawCase4, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 5:
			gc.DrawText(KTxtDrawCase5, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		case 6:
			gc.DrawText(KTxtDrawCase6, rect, ascent, CGraphicsContext::ECenter,
					0);
			break;
		default:
			break;
		};
	}
开发者ID:huellif,项目名称:symbian-example,代码行数:49,代码来源:Hello.cpp

示例3: SystemGc

/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CShowString::Draw(const TRect& aRect) const
{
	CWindowGc& gc = SystemGc();
	gc.Clear(aRect);
	gc.DrawRect(aRect);

	if(iString && iMyFont)
	{
		TInt fontHeight = iMyFont->HeightInPixels();
		
		gc.UseFont(iMyFont);			
		
		TInt TextToDraw = iString->Des().Length() - iCurrentCut;
			
		if(TextToDraw < 1)
		{
			TextToDraw = 1;
		}
		if(TextToDraw > iString->Des().Length())
		{
			TextToDraw = iString->Des().Length();
		}
		
		gc.DrawText(iString->Des().Right(TextToDraw),TRect(5,(fontHeight / 2),aRect.Width() - 5,((fontHeight / 2) + fontHeight)),iMyFont->AscentInPixels(), CGraphicsContext::ELeft, 0);
	}
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:30,代码来源:ShowString.cpp

示例4: switch

void CMainWindow::HandlePointerEvent(TPointerEvent& aPointerEvent)
	{
	switch (aPointerEvent.iType)
		{
		case TPointerEvent::EButton1Down:
			{
			if (aPointerEvent.iModifiers & EModifierShift)
				{
				Window().EnablePointerMoveBuffer();
				CWindowGc* gc = SystemGc();
				gc->Activate(Window());
				gc->MoveTo(aPointerEvent.iPosition);
				gc->Deactivate();
				}
			break;
			}
		case TPointerEvent::EButton1Up:
			{
			Window().DisablePointerMoveBuffer();
			break;
			}
		default:
			break;
		}
	}
开发者ID:huellif,项目名称:symbian-example,代码行数:25,代码来源:PointerMoveBuffer.cpp

示例5: SystemGc

void CExampleShellContainer::Draw(const TRect& /*aRect*/) const
	{
	CWindowGc& gc = SystemGc();
	gc.SetPenStyle(CGraphicsContext::ENullPen);
	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
	gc.DrawRect(Rect());
	}
开发者ID:huellif,项目名称:symbian-example,代码行数:7,代码来源:GraphicsShell.cpp

示例6: SystemGc

//             Drawing the view - in this example, 
//             consists of drawing a simple outline rectangle
//             and then drawing the text in the middle.
//             We use the Normal font supplied by the UI.
//
//             In this example, we don't use the redraw
//             region because it's easier to redraw to
//             the whole client area.
//
void CExampleAppView::Draw(const TRect& /*aRect*/) const
	{
               // Window graphics context
	CWindowGc& gc = SystemGc();
	           // Area in which we shall draw
	TRect      drawRect = Rect();
			   // Font used for drawing text
	const CFont*     fontUsed;
	
	           // Start with a clear screen
	gc.Clear();
			   // Draw an outline rectangle (the default pen
	           // and brush styles ensure this) slightly
	           // smaller than the drawing area.
	drawRect.Shrink(10,10);		   	
	gc.DrawRect(drawRect);
               // Use the title font supplied by the UI
	fontUsed = iEikonEnv->TitleFont();
	gc.UseFont(fontUsed);
			   // Draw the text in the middle of the rectangle.
	TInt   baselineOffset=(drawRect.Height() - fontUsed->HeightInPixels())/2; 
	gc.DrawText(*iExampleText,drawRect,baselineOffset,CGraphicsContext::ECenter, 0);
               // Finished using the font
	gc.DiscardFont();
	}
开发者ID:fedor4ever,项目名称:default,代码行数:34,代码来源:ChildI_Main.cpp

示例7: SystemGc

/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CMySplashScreen::Draw(const TRect& /*aRect*/) const
{
	CWindowGc& gc = SystemGc();
 
	if(iBgContext)
	{
	  	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
		AknsDrawUtils::Background( skin, iBgContext, this, gc, Rect() );
	}
 
    if(iBgPic && iBgMsk)
	{
		if(iBgPic->Handle() && iBgMsk->Handle())
		{
			TSize ImgSiz(iBgPic->SizeInPixels());
			TSize RectSiz();
			
			TInt Xpoint = ((Rect().Width() - ImgSiz.iWidth) / 2);
			TInt Ypoint = ((Rect().Height()- ImgSiz.iHeight)/ 2);
		
			TRect DestRect(Xpoint,Ypoint,(Xpoint + ImgSiz.iWidth),(Ypoint + ImgSiz.iHeight));
			TRect SrcRect(0,0,ImgSiz.iWidth,ImgSiz.iHeight);
			
			gc.DrawBitmapMasked(DestRect,iBgPic,SrcRect,iBgMsk, EFalse);
		}	
	}
	else if(iBgPic)
	{
		if(iBgPic->Handle())
		{
			gc.DrawBitmap(Rect(),iBgPic);
		}	
	}
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:38,代码来源:Splash_Screen.cpp

示例8: SystemGc

void CTestViewControl::Draw(const TRect& /*aRect*/) const
	{
	CWindowGc& gc = SystemGc();
	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
	gc.SetBrushColor(KRgbDitheredLightGray);
	gc.DrawRect(Rect());

	gc.UseFont(iEikonEnv->TitleFont());

	TInt yPos = KYStart;
	TInt xPos = KXStart;

	gc.DrawText(APP_TEXT,TPoint(xPos,yPos));

	yPos+=30;

	TBuf<256> viewNameBuf;
	viewNameBuf.Append(_L("View "));
	TBuf<16> numBuf;
	numBuf.Num((TInt)iViewId.iViewUid.iUid);
	viewNameBuf.Append(numBuf);


	gc.DrawText(viewNameBuf,TPoint(xPos,yPos));

	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:26,代码来源:tview1.CPP

示例9: SystemGc

// -----------------------------------------------------------------------------
// CHelloWorldBasicAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CHelloWorldBasicAppView::Draw( const TRect& /*aRect*/ ) const
    {
    // note that the whole screen is drawn everytime, so aRect-parameter
    // is ignored

    // Get the standard graphics context
    CWindowGc& gc = SystemGc();
    gc.SetPenStyle( CGraphicsContext::ENullPen );
    gc.SetBrushColor( KRgbWhite);
    gc.SetBrushStyle( CGraphicsContext::ESolidBrush );

    // Gets the control's extent
    TRect rect( Rect());

    // draw also text, if user has given it via dialog
    if (iText.Length() > 0)
        {
        gc.UseFont(iFont);
        gc.DrawText(iText, rect, Rect().Height()/3, CGraphicsContext::ECenter );
        gc.DiscardFont();
        }
    else
        {
        gc.Clear( rect );
        }
    }
开发者ID:fedor4ever,项目名称:packaging,代码行数:31,代码来源:helloworldbasicappview.cpp

示例10: SystemGc

// Virtual, defined by CCoeControl; replaces the default implementation
// provided by CCoeControl.
void CPingContainer::Draw(const TRect& aRect) const
{
    CWindowGc& gc = SystemGc();
    gc.SetClippingRect(aRect);
    gc.DrawRect(Rect());

}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:9,代码来源:ping.cpp

示例11: SystemGc

void CTRuleBasedAppView::Draw(const TRect& aRect) const
	{
	// Window graphics context
	CWindowGc& gc = SystemGc();
	// Area in which we shall draw
	TRect	drawRect = Rect();
	
	// Font used for drawing text
	const CFont* fontUsed = NULL;
	
	// Start with a clear screen
	gc.Clear();
			
	gc.DrawRect(drawRect);

	TRAPD(err, fontUsed = CreateCustomFontL(_L("Times New Roman"),20,1));
	if (err!=KErrNone)
		{
		return;
		}
		
	gc.SetPenColor(KRgbGreen);
	gc.UseFont(fontUsed);
	// Draw the text in the middle of the rectangle.
	TInt baselineOffset=(aRect.Height() - fontUsed->HeightInPixels())/2;
	gc.DrawText(*iRuleBasedText,aRect,baselineOffset,CGraphicsContext::ECenter, 0);
	// Finished using the font
	gc.DiscardFont();
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:29,代码来源:tRuleBasedApp1.cpp

示例12: CALLSTACKITEM

// ---------------------------------------------------------
// CContextbookContainer::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CContextbookContainer::Draw(const TRect& aRect) const
{
	CALLSTACKITEM(_L("CContextbookContainer::Draw"));

	CWindowGc& gc = SystemGc();
	// TODO: Add your drawing code here
	// example code...
	gc.SetPenStyle(CGraphicsContext::ENullPen);

	gc.SetBrushColor(KRgbWhite);
	gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
	gc.DrawRect(aRect);

	if (edit) {
		TGulBorder border(TGulBorder::ESingleBlack);
		gc.SetPenStyle(CGraphicsContext::ESolidPen);
		gc.SetBrushStyle(CGraphicsContext::ENullBrush);
		gc.SetPenColor(KRgbBlack);
		TRect edit_rect=Rect();
		edit_rect.SetHeight(19);
		edit_rect.Resize(-8, 0);
		edit_rect.Move(4, Rect().Height()-20);
		border.Draw(gc, edit_rect);
	}
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:29,代码来源:ContextbookContainer.cpp

示例13: SystemGc

void CPanControl::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    TRect sourceRect = Rect();
    sourceRect.Move(iCurrentPointerPos);
    gc.DrawBitmap(aRect, iSourceBitmap, sourceRect); 
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:7,代码来源:tpan.cpp

示例14: SystemGc

void CUnRegisterView::Draw(const TRect& /* aRect */) const
{
	CWindowGc& gc = SystemGc();
	gc.Clear();

	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
	CleanupStack::PushL(bitmap);

	TBuf<128> path;
	path = CRippleVaultAppUi::ApplicationDriveAndPath();
	path.Append(KLogoMbmFileName);

	User::LeaveIfError(bitmap->Load(path, EMbmLogoLogo));
	TPoint pos(50,60);
	gc.BitBlt(pos, bitmap);	
	CleanupStack::PopAndDestroy();

	const CFont* fontUsed;  
	fontUsed = iEikonEnv->TitleFont();
	gc.UseFont(fontUsed);

	//TPoint pos1(50,30);
	//gc.DrawText(*(iEikonEnv->AllocReadResourceL(R_RIPPLE_VAULT)),pos1);
	TPoint pos2(30,180);
	gc.DrawText(*(iEikonEnv->AllocReadResourceL(R_PURPLEACE_WEB)),pos2);
	
    // Finished using the font
	gc.DiscardFont();

}
开发者ID:deepakprabhakara,项目名称:ripplevault,代码行数:30,代码来源:unregisterview_uiq.cpp

示例15: SystemGc

/*
-----------------------------------------------------------------------

-----------------------------------------------------------------------
*/
void CTraceContainer::Draw(const TRect& /*aRect*/) const
{
	CWindowGc& gc = SystemGc();
	
	if(iBgContext)
	{ 	
	  	MAknsSkinInstance* skin = AknsUtils::SkinInstance();
		AknsDrawUtils::Background( skin, iBgContext, this, gc, Rect() );
	}
	
	TRect DrawRect(Rect());
	DrawRect.Shrink(2,2);
	gc.SetPenColor(KRgbBlack);
	gc.DrawLine(DrawRect.iTl,TPoint(DrawRect.iTl.iX,DrawRect.iBr.iY));
	gc.DrawLine(DrawRect.iTl,TPoint(DrawRect.iBr.iX,DrawRect.iTl.iY));
	gc.DrawLine(DrawRect.iBr,TPoint(DrawRect.iTl.iX,DrawRect.iBr.iY));
	gc.DrawLine(DrawRect.iBr,TPoint(DrawRect.iBr.iX,DrawRect.iTl.iY)); 
	
	DrawRect.Shrink(2,2);

	TInt HeightMe = (DrawRect.Height() / 2);
	
	TRect CpuRect(DrawRect.iTl.iX,DrawRect.iTl.iY,DrawRect.iBr.iX,(DrawRect.iTl.iY + (HeightMe - 1)));
	TRect MemRect(DrawRect.iTl.iX,(DrawRect.iTl.iY + (HeightMe + 1)),DrawRect.iBr.iX,DrawRect.iBr.iY);

	DrawCPU(CpuRect,gc);
	DrawMemory(MemRect,gc);
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:33,代码来源:MainContainer.cpp


注:本文中的SystemGc函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。