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


C++ TPoint函数代码示例

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


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

示例1: clientRect

// -----------------------------------------------------------------------------
// CAafAppFileBrowserView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CAafAppFileBrowserView::SizeChanged()
{  
	if (iListBox)
	{/*
	 CAafAppUi* appUi = (CAafAppUi*)iCoeEnv->AppUi();
	 TRect clientRect(appUi->ClientRect());

	 iListBox->SetRect(clientRect);
	 iListBox->DrawNow();
	 */
		TRect clientRect = Rect();
		iListBox->SetExtent(TPoint(0, 0), clientRect.Size()); // Set rectangle
		iListBox->DrawNow();
	}
}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:20,代码来源:Aafappfilebrowserview.cpp

示例2: TPoint

CAircraft* CUSSVictory::CreateNewAircraft()
{
	CDauntless* lDauntless = CDauntless::New(false, TIntFloat::Convert(0), true, TPoint(0, 0));//position does matter since we reposition it anyway
	TPoint lCurrentPosition = GetCurrentPositionNormilized();
	//need to adjust it to be on the landing surface to the landing surface
	lCurrentPosition.iY += USS_VICTORY_LANDING_SURFACE_HEIGHT;
	lCurrentPosition.iY += USS_VICTORY_LANDING_SURFACE_HEIGHT_OFF_SET;
	if(iObjectReflected)
		lCurrentPosition.iX -= USS_VICTORY_AIRPLANE_POSITION_X_OFFSET;
	else
		lCurrentPosition.iX += USS_VICTORY_AIRPLANE_POSITION_X_OFFSET;
	lDauntless->SetPosition(lCurrentPosition);
	CFighterPilotThePacificWar::FighterGame->iGameData->GetMap()->GetObjectManager()->AddMoveableGameObject(lDauntless);
	return lDauntless;//all done
}
开发者ID:DavidAStoll,项目名称:FighterPilotGameCode,代码行数:15,代码来源:CUSSVictory.cpp

示例3: new

/**
Ensure the text-drawer is propagated from the super-container, 
via the sub-container to the component control	
test case PREQ641.2
*/
TBool CCone7TestAppUi::TestTextDrawer_2L()
	{
	CCtlSuperContainer641* testSuperContainer = new (ELeave)CCtlSuperContainer641;
	CleanupStack::PushL(testSuperContainer);
	testSuperContainer->ConstructL( _L("SuperContainer") );
	testSuperContainer->SetExtent( TPoint(20,20),TSize(600,200) );			
	testSuperContainer->ActivateL();
	testSuperContainer->DrawNow();
	
	const TInt err = testSuperContainer->iSubContainer->iContainee->TestContainerTextDrawer();
	User::After( TTimeIntervalMicroSeconds32(2000000) );
	
	CleanupStack::PopAndDestroy(testSuperContainer);
	return err;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:20,代码来源:TCONE7STEP.CPP

示例4: HideLines_Ctrl

/**
 * Tries to hide the specified control. The control will be hidden, if it doesn't
 * fit to the specified clipping rectangle. Checks if the control exists.
 *
 * @return How many subcontrols were hidden
 */
static TInt HideLines_Ctrl(CCoeControl *aControl, TRect aClipRect)
{
    if ( !aControl )
        return 1;   // It doesn't exist and hence not visible
    TRect rect( aControl->Rect() );
    if ( !aClipRect.Contains(rect.iTl) || aClipRect.iBr.iY <= rect.iBr.iY )
        // Never use TRect::Contains() for checking the bottom right corner, see documentation
    {
        // hide it
        aControl->SetPosition( TPoint(-666,-666) );
        return 1;
    }
    else
        return 0;
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:21,代码来源:EIKCAPCA.CPP

示例5: CountColorsL

TInt CAnimationTestStep::CountColorsL(const TRect& aRect, TInt aMin, TInt aMax)
	{
	TDisplayMode displayMode = iScreen->DisplayMode();
	TInt width = CFbsBitmap::ScanLineLength(aRect.Width(),displayMode);
	HBufC8* buf=HBufC8::NewMaxLC(width);
	TPtr8 ptr=buf->Des();
	iColors.Reset();
	TInt inc = width/aRect.Width();
	for (TInt row = aRect.iTl.iY; row < aRect.iBr.iY; ++row)
		{
		ptr.SetLength(0);
		iScreen->GetScanLine(ptr,TPoint(aRect.iTl.iX,row),aRect.Width(),displayMode);
		for (TInt col = 0; col < ptr.Length(); col+=inc)
			{
			TUint clr = ptr[col];
			// Pixel buffer represented in block of bytes, if color mode is 8bpp (1byte) we can
			// simply access the buffer sequentially eg clr = ptr[col], however if the color mode
			// is 16bpp or more, access must be adjusted accordingly. 
			// The "inc" variable indicates how many bytes each pixel's colour takes
			// and could be any value from 1 to 4 depending on the color mode.
			for (TInt byteNumber = 1; byteNumber < inc; byteNumber++)
				{
				clr = clr << 8;
				clr += ptr[col + byteNumber];
				}
			if (iColors.Find(clr) == KErrNotFound)
				{
				iColors.Append(clr);
				}
			}
		}
	TInt count = iColors.Count();
	CleanupStack::PopAndDestroy(buf);
	
	if (count < aMin)
		{
		return (count - aMin);	// This is a good place for a break point
		}
	else if (count > aMax)
		{
		return (count - aMax);	// This is a good place for a break point
		}
	else
		{
		return 0;
		}
	
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:48,代码来源:AnimationTestStep.cpp

示例6: Size

void CPrimaryColoursWin::Draw()
	{
	iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
	iGc->SetPenStyle(CGraphicsContext::ESolidPen);
	iGc->SetPenColor(TRgb(255, 255, 255));
	iGc->SetBrushColor(TRgb(0, 0, 0));
	TSize winSize = Size();
	iGc->DrawRect(TRect(winSize));
	
	CFont* font;
	TFontSpec fontSpec(_L(""), 300);
	TheClient->iScreen->GetNearestFontInTwips(font, fontSpec);
	
	if (font)
		{
		iGc->UseFont(font);
		TRect r(TPoint(0, 0), Size());
		r.Shrink(kMinHeight, kMinHeight);
		iGc->DrawText(iDisplayText, r, font->AscentInPixels(), iGc->ECenter, 0);
		iGc->DiscardFont();
		TheClient->iScreen->ReleaseFont(font);
		}
	
	iNumColours = 0;
	TPoint lhsAbs = Win()->AbsPosition();
	
	for(TInt channelnum = 0, channelmul = 1, xoordinate = kPlotMargin; channelnum < KNumChannels; channelnum++, channelmul <<= 8, xoordinate += kPlotWithMargin)
		{
		TRgb lastPixel(255, 255, 255, 255);
		
		for(TInt colour = 0; colour < KNumColours; colour++)
			{
			if(!iBadPixels[channelnum][colour])
				{
				iGc->SetPenColor(TRgb(colour * channelmul));				
				}
			else
				{
				iGc->SetPenColor(TRgb(255, 255, 255));			
				}

			TPoint point = TPoint(xoordinate + (colour & 0x0f), kPlotMargin + (colour >> 4));
			iGc->Plot(point);
			}
		}
		
	iDrawn=ETrue;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:48,代码来源:TSCRDEVRESSWITCH.CPP

示例7: SetSize

void CEdgedWin::SetSize(const TSize & aSize)
	{
	CCompWin::SetSize(aSize);

	iOpaqueRect.iTl.iX = 10;
	iOpaqueRect.iTl.iY = 10;
	iOpaqueRect.iBr.iX = iSize.iWidth - 10;
	iOpaqueRect.iBr.iY = iSize.iHeight - 10;
	if (iTransparent)
		{
		iTransparentRegion.Clear();
		iTransparentRegion.AddRect(TRect(TPoint(0,0), iSize));
		iTransparentRegion.SubRect(iOpaqueRect);
		iRedrawWindow->SetTransparentRegion(iTransparentRegion); //TRANSPARENCY must be defined in wsini.ini
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:16,代码来源:edgedwin.cpp

示例8: CRKWindow

void CTKRepeat::ConstructL()
{
    TheClient->iWs.SetFocusScreen(iTest->iScreenNumber);
    iWin=new(ELeave) CRKWindow(this);
    TSize screenSize=Client()->iGroup->Size();
    iWin->SetUpL(TPoint(5,5),TSize(Min(Max(screenSize.iWidth/2,250),screenSize.iWidth-10),screenSize.iHeight-10),Client()->iGroup,*Client()->iGc);
    Client()->iGroup->WinTreeNode()->SetOrdinalPosition(0);
    Client()->iGroup->SetCurrentWindow(iWin);
    Client()->iWs.GetKeyboardRepeatRate(iOldInitialTime, iOldTime);
    iTest->SimulateKeyDownUp(EStdKeyLeftCtrl);
    iTest->SimulateKeyDownUp(EStdKeyRightCtrl);
    TInt mods=Client()->iWs.GetModifierState();
    TheClient->WaitForRedrawsToFinish();		//Let all pending events be processed before test begins
    _LIT(KLog,"Initial Modifiers state 0x%x (ideally should be zero)");
    LOG_MESSAGE2(KLog,mods);
}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:16,代码来源:TKRepeat.CPP

示例9: TSize

QRect S60VideoWidgetDisplay::extentRect() const
{
    QRect rect;
    if (const RWindow *window = windowHandle()) {
        const TSize size = window ? window->Size() : TSize();
        if (m_explicitExtentRect.isValid())
            rect = m_explicitExtentRect;
        else
            rect = QRect(0, 0, size.iWidth, size.iHeight);
#ifndef VIDEOOUTPUT_GRAPHICS_SURFACES
        const TPoint pos = window ? window->AbsPosition() : TPoint();
        rect.moveTopLeft(QPoint(pos.iX, pos.iY));
#endif
    }
    return rect;
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:16,代码来源:s60videowidgetdisplay.cpp

示例10: qt_symbian_show_pointer_sprite

/*
 * shows the pointer sprite by constructing a native handle, and registering
 * it with the window server.
 * Only used when the sprite workaround is in use.
 */
void qt_symbian_show_pointer_sprite()
{
    if (cursorSprite.d) {
        if (cursorSprite.d->scurs.WsHandle())
            cursorSprite.d->scurs.Close();
    } else {
        cursorSprite = QCursor(Qt::ArrowCursor);
    }

    cursorSprite.d->scurs = RWsSprite(S60->wsSession());
    QPoint pos = QCursor::pos();
    cursorSprite.d->scurs.Construct(S60->windowGroup(), TPoint(pos.x(), pos.y()), ESpriteNoChildClip | ESpriteNoShadows);

    cursorSprite.d->constructCursorSprite(cursorSprite.d->scurs);
    cursorSprite.d->scurs.Activate();
}
开发者ID:Marforius,项目名称:qt,代码行数:21,代码来源:qcursor_s60.cpp

示例11: StepDone

	virtual void StepDone() {
		++iDone;
		CWindowGc& gc = SystemGc();
		ActivateGc();

		TRgb front(216, 214, 214);
		TRect progress( TPoint(progress_left, progress_top), TSize(progress_width, progress_height) );
		progress.SetSize( TSize( progress_width * iDone/iSteps, progress_height ) );
		gc.SetPenStyle(CGraphicsContext::ENullPen);
		gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
		gc.SetBrushColor(front);
		progress.SetSize( TSize( progress_width * iDone/iSteps, progress_height ) );
		gc.DrawRect(progress);
		iEikonEnv->Flush();
		DeactivateGc();
	}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:16,代码来源:splash.cpp

示例12: TSize

//
/// Constructs a TCelArray from a device independent bitmap (DIB) by slicing the DIB
/// into a horizontal array of evenly sized cels. If numRows is 0, the number of
/// rows is calculated using the bitmap height and the celSize y parameter.
//
TCelArray::TCelArray(const TDib& dib, int numCels, int numRows)
{
  NGrowBy = 1;
  NCels = NCelsUsed = std::max(1, numCels);
  NRows  = std::max(1, numRows);
  CSize = TSize(dib.Width() / NCels, dib.Height() / NRows);
  NCurRow = 0;
  Offs = TPoint(0, 0);
  ShouldDelete = true;

  TPalette palette((HPALETTE)::GetStockObject(DEFAULT_PALETTE));
  Bitmap = new TBitmap(dib, &palette);

  TRACEX(OwlGadget, OWL_CDLEVEL, "TCelArray constructed @" << (void*)this <<
    " from slicing the dib @" << (void*)&dib);
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:21,代码来源:celarray.cpp

示例13: TPoint

void CEglTest_TestStep_StressLoad::LoadGpuProcessorL()
    {
    CSurface  *surface = CSurface::SurfaceFactoryL(ESurfTypeEglWindow);
    CleanupStack::PushL(surface);
    surface->CreateL(EStandard128sqSurface, TPoint(128, 128));
    TRgb bg = TRgb(0x55, 0x88, 0xff);   // Cyan/turqoise-ish.  
    TRgb fg = TRgb(0xff, 0x11, 0x22);   // Red (sort of)
    while(!__e32_atomic_load_acq32(&iStopThreadFlag[EThreadLoadGpuProcessor])) 
        {
            surface->DrawContentL(bg);
            surface->DrawComplexL(fg);
            surface->SubmitContent(ETrue);
        }
    CleanupStack::PopAndDestroy(surface);
    eglReleaseThread();
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:16,代码来源:egltest_endpoint_stressload.cpp

示例14: Draw

	virtual void Draw(const TRect& aRect) const {
		TRgb back(127, 120, 120);
		TRgb front(216, 214, 214);
		CWindowGc& gc = SystemGc();
		gc.DrawBitmap(Rect(), iBitmap);

		gc.SetPenStyle(CGraphicsContext::ENullPen);
		gc.SetBrushColor(back);
		gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
		TRect progress( TPoint(progress_left, progress_top), TSize(progress_width, progress_height) );
		gc.DrawRect(progress);

		progress.SetSize( TSize( progress_width * iDone/iSteps, progress_height ) );
		gc.SetBrushColor(front);
		gc.DrawRect(progress);
	}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:16,代码来源:splash.cpp

示例15:

void CTap2MenuAppUi::CopyBitmapL(CFbsBitmap *aSource, CFbsBitmap *aTarget)
	{
	if(aSource != NULL && aTarget != NULL)
		{
		if(aSource->SizeInPixels() != aTarget->SizeInPixels() || aSource->DisplayMode() != aTarget->DisplayMode())
			{User::Leave(KErrArgument);}
		CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(aTarget);
		CleanupStack::PushL(device);
		CFbsBitGc* gc = NULL;
		User::LeaveIfError(device->CreateContext(gc));
		CleanupStack::PushL(gc);
		gc->BitBlt(TPoint(0, 0), aSource);
		CleanupStack::PopAndDestroy(gc);
		CleanupStack::PopAndDestroy(device);
		}
	}
开发者ID:kolayuk,项目名称:Tap2Menu,代码行数:16,代码来源:Tap2MenuAppUi.cpp


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