本文整理汇总了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();
}
}
示例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;
}
示例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);
}
}