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


C++ Rect::Bounds方法代码示例

本文整理汇总了C++中Rect::Bounds方法的典型用法代码示例。如果您正苦于以下问题:C++ Rect::Bounds方法的具体用法?C++ Rect::Bounds怎么用?C++ Rect::Bounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rect的用法示例。


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

示例1: AddChild

void Canvas::AddChild(Canvas *child, const Rect &childRect, window_flags flags)
{
	if (fWindow == 0)
		return;

	fWindow->fConnection->WriteInt8(OP_CREATE_WINDOW);
	fWindow->fConnection->WriteConnectionPort();
	fWindow->fConnection->WriteInt32(fID);					// My child
	fWindow->fConnection->WriteInt32(childRect.left);
	fWindow->fConnection->WriteInt32(childRect.top);
	fWindow->fConnection->WriteInt32(childRect.right);
	fWindow->fConnection->WriteInt32(childRect.bottom);
	fWindow->fConnection->WriteInt32(fWindow->fEventPort);
	fWindow->fConnection->WriteInt32(flags);
	fWindow->fConnection->Flush();
	child->fID = fWindow->fConnection->ReadInt32();
	child->fWindow = fWindow;
	child->fBounds = childRect.Bounds();

	// Stick window in the window's canvas list
	child->fWinListNext = fWindow->fCanvasList;
	child->fWinListPrev = &fWindow->fCanvasList;
	if (fWindow->fCanvasList)
		fWindow->fCanvasList->fWinListPrev = &child->fWinListNext;

	fWindow->fCanvasList = child;

	child->Show();
}
开发者ID:HTshandou,项目名称:newos,代码行数:29,代码来源:Canvas.cpp

示例2: FrameSized

void BlueDecorator::FrameSized( const Rect& cFrame )
{
    Layer* pcView = GetLayer();
    Point cDelta( cFrame.Width() - m_cBounds.Width(), cFrame.Height() - m_cBounds.Height() );
    m_cBounds = cFrame.Bounds();

    Layout();
    if ( cDelta.x != 0.0f )
    {
        Rect cDamage = m_cBounds;
        cDamage.left = m_cMinimizeRect.left - fabs(cDelta.x)  - 50.0f;
        pcView->Invalidate( cDamage );
    }
    if ( cDelta.y != 0.0f )
    {
        Rect cDamage = m_cBounds;
        cDamage.top = cDamage.bottom - std::max( m_vBottomBorder, m_vBottomBorder + cDelta.y ) - 1.0f;
        pcView->Invalidate( cDamage );
    }

    pcView->Invalidate( m_cBounds );

}
开发者ID:rickcaudill,项目名称:Pyro,代码行数:23,代码来源:BlueDecorator.cpp

示例3: FrameSized

void DefaultDecorator::FrameSized( const Rect & cFrame )
{
	Layer *pcView = GetLayer();
	Point cDelta( cFrame.Width() - m_cBounds.Width(  ), cFrame.Height(  ) - m_cBounds.Height(  ) );

	m_cBounds = cFrame.Bounds();

	Layout();

	if( cDelta.x != 0.0f )
	{
		Rect cDamage = m_cBounds;

		cDamage.left = m_cObjectFrame[HIT_MINIMIZE].left - fabs( cDelta.x ) - 2.0f;
		pcView->Invalidate( cDamage );
	}
	if( cDelta.y != 0.0f )
	{
		Rect cDamage = m_cBounds;

		cDamage.top = cDamage.bottom - std::max( m_vBottomBorder, m_vBottomBorder + cDelta.y ) - 1.0f;
		pcView->Invalidate( cDamage );
	}
}
开发者ID:rickcaudill,项目名称:Pyro,代码行数:24,代码来源:defaultdecorator.cpp


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