示例#1
0
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();
}
示例#2
0
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 );

}
示例#3
0
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 );
	}
}