本文整理汇总了C++中CAView::isScrollEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ CAView::isScrollEnabled方法的具体用法?C++ CAView::isScrollEnabled怎么用?C++ CAView::isScrollEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAView
的用法示例。
在下文中一共展示了CAView::isScrollEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: touchMoved
//.........这里部分代码省略.........
isTouchCancelled = false;
break;
}
}
}
}
if (isTouchCancelled)
{
if (!isScheduledPassing)
{
CAVector<CAResponder*>::iterator itr;
for (itr=m_vTouchesViews.begin(); itr!=m_vTouchesViews.end(); itr++)
{
this->touchCancelledWithResponder(*itr);
}
}
m_vTouchesViews.clear();
}
if (isScheduledPassing || m_vTouchesViews.empty())
{
for (int i=0; i<m_vTouchMovedsView.size(); i++)
{
CAResponder* responder = m_vTouchMovedsView.at(i);
DPoint pointOffSet = DPointZero;
if (CAView* v = dynamic_cast<CAView*>(responder))
{
pointOffSet = ccpSub(v->convertToNodeSpace(m_pTouch->getLocation()),
v->convertToNodeSpace(m_pTouch->getPreviousLocation()));
}
else if (CAViewController* c = dynamic_cast<CAViewController*>(responder))
{
pointOffSet = ccpSub(c->getView()->convertToNodeSpace(m_pTouch->getLocation()),
c->getView()->convertToNodeSpace(m_pTouch->getPreviousLocation()));
}
else
{
pointOffSet = ccpSub(m_pTouch->getLocation(), m_pTouch->getPreviousLocation());
}
if (responder->isReachBoundaryHandOverToSuperview())
{
if (responder->isHorizontalScrollEnabled()
&& fabsf(pointOffSet.x) >= fabsf(pointOffSet.y))
{
CC_CONTINUE_IF(responder->isReachBoundaryLeft() && pointOffSet.x > 0);
CC_CONTINUE_IF(responder->isReachBoundaryRight() && pointOffSet.x < 0);
}
else if (responder->isVerticalScrollEnabled()
&& fabsf(pointOffSet.x) < fabsf(pointOffSet.y))
{
CC_CONTINUE_IF(responder->isReachBoundaryUp() && pointOffSet.y > 0);
CC_CONTINUE_IF(responder->isReachBoundaryDown() && pointOffSet.y < 0);
}
}
if (this->touchBeganWithResponder(responder))
{
m_vTouchesViews.pushBack(responder);
}
break;
}
if (m_vTouchesViews.empty())
{
m_vTouchesViews.pushBack(m_vTouchMovedsView.front());
while (m_vTouchesViews.back())
{
if (this->touchBeganWithResponder(m_vTouchesViews.back()))
{
break;
}
m_vTouchesViews.popBack();
}
}
}
}
}
}
CAView* view = dynamic_cast<CAView*>(CAApplication::getApplication()->getTouchDispatcher()->getFirstResponder());
bool isContainsFirstPoint = view && view->convertRectToWorldSpace(view->getBounds()).containsPoint(m_tFirstPoint);
if (!isContainsFirstPoint && view && view->isScrollEnabled())
{
this->touchMovedWithResponder(view);
}
CAVector<CAResponder*>::iterator itr;
for (itr=m_vTouchesViews.begin(); itr!=m_vTouchesViews.end(); itr++)
{
CC_CONTINUE_IF(!(*itr)->isScrollEnabled());
this->touchMovedWithResponder(*itr);
}
}