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


C++ ShapeList::GetCount方法代码示例

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


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

示例1: DoLayout

void wxSFLayoutMesh::DoLayout(ShapeList& shapes)
{
	int i = 0, cols = floor( sqrt( (float)shapes.GetCount() ) );
	
	double roffset, coffset, maxh = -m_HSpace;
	roffset = coffset = 0;

	wxRealPoint nStart = GetTopLeft( shapes );

	for( ShapeList::iterator it = shapes.begin(); it != shapes.end(); ++ it )
	{
		wxSFShapeBase *pShape = *it;
		
		if( i++ % cols == 0 )
		{
			coffset = 0;
			roffset += maxh + m_HSpace;
			maxh = 0;
		}
		
		pShape->MoveTo( nStart.x + coffset, nStart.y + roffset );
		
		wxRect rctBB = pShape->GetBoundingBox();
		coffset += rctBB.GetWidth() + m_VSpace;
		
		if( rctBB.GetHeight() > maxh ) maxh = rctBB.GetHeight();
	}
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:28,代码来源:AutoLayout.cpp

示例2: GetShapesCenter

wxRealPoint wxSFLayoutAlgorithm::GetShapesCenter(const ShapeList& shapes)
{
	wxRealPoint nCenter;
	
	for( ShapeList::const_iterator it = shapes.begin(); it != shapes.end(); ++ it )
	{
		nCenter = nCenter + (*it)->GetAbsolutePosition();
	}
	
	nCenter.x /= shapes.GetCount();
	nCenter.y /= shapes.GetCount();
	
	return nCenter;
}
开发者ID:noriter,项目名称:wxWidgets,代码行数:14,代码来源:AutoLayout.cpp

示例3: _OnKey

void wxSFShapeBase::_OnKey(int key)
{
    if(!m_pParentManager)return;

    wxSFShapeCanvas *pCanvas = GetShapeManager()->GetShapeCanvas();

    if(!pCanvas)return;

	if( m_fVisible && m_fActive )
	{
		double dx = 1, dy = 1;
		bool fRefreshAll = false;
		wxRect prevBB;


		if( pCanvas->ContainsStyle(wxSFShapeCanvas::sfsGRID_USE) )
		{
			dx = pCanvas->GetGrid().x;
			dy = pCanvas->GetGrid().y;
		}

		ShapeList lstSelection;
		pCanvas->GetSelectedShapes(lstSelection);
		if((lstSelection.GetCount() > 1) && (lstSelection.IndexOf(this) != wxNOT_FOUND))
		{
		    fRefreshAll = true;
		}

		if(!fRefreshAll)
		{
            GetCompleteBoundingBox(prevBB, bbSELF | bbCONNECTIONS | bbCHILDREN | bbSHADOW);
		}

        if(this->OnKey(key))
        {
            switch(key)
            {
            case WXK_LEFT:
                if(ContainsStyle(sfsPOSITION_CHANGE))this->MoveBy(-dx, 0);
                break;

            case WXK_RIGHT:
                if(ContainsStyle(sfsPOSITION_CHANGE))this->MoveBy(dx, 0);
                break;

            case WXK_UP:
                if(ContainsStyle(sfsPOSITION_CHANGE))this->MoveBy(0, -dy);
                break;

            case WXK_DOWN:
                if(ContainsStyle(sfsPOSITION_CHANGE))this->MoveBy(0, dy);
                break;
            }
        }

        if(!fRefreshAll)
        {
            wxRect currBB;
            GetCompleteBoundingBox(currBB, bbSELF | bbCONNECTIONS | bbCHILDREN | bbSHADOW);

            prevBB.Union(currBB);
            Refresh(prevBB, sfDELAYED);
        }
        else
            pCanvas->Refresh(false);
	}
}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:67,代码来源:ShapeBase.cpp


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