本文整理汇总了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;
}
}
示例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;
};
}
示例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);
}
}
示例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;
}
}
示例5: SystemGc
void CExampleShellContainer::Draw(const TRect& /*aRect*/) const
{
CWindowGc& gc = SystemGc();
gc.SetPenStyle(CGraphicsContext::ENullPen);
gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
gc.DrawRect(Rect());
}
示例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();
}
示例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);
}
}
}
示例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));
}
示例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 );
}
}
示例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());
}
示例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();
}
示例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);
}
}
示例13: SystemGc
void CPanControl::Draw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
TRect sourceRect = Rect();
sourceRect.Move(iCurrentPointerPos);
gc.DrawBitmap(aRect, iSourceBitmap, sourceRect);
}
示例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();
}
示例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);
}