本文整理汇总了C++中CC_CONTINUE_IF函数的典型用法代码示例。如果您正苦于以下问题:C++ CC_CONTINUE_IF函数的具体用法?C++ CC_CONTINUE_IF怎么用?C++ CC_CONTINUE_IF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CC_CONTINUE_IF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getContentOffset
void CACollectionView::loadCollectionCell()
{
CCRect rect = this->getBounds();
rect.origin = getContentOffset();
rect.origin.y -= rect.size.height * 0.1f;
rect.size.height *= 1.2f;
std::map<CAIndexPath3E, CACollectionViewCell*>::iterator itr;
for (itr = m_pUsedCollectionCells.begin(); itr != m_pUsedCollectionCells.end(); itr++)
{
CC_CONTINUE_IF(itr->second != NULL);
CAIndexPath3E r = itr->first;
CCRect cellRect = m_rUsedCollectionCellRects[r];
CC_CONTINUE_IF(!rect.intersectsRect(cellRect));
CACollectionViewCell* cell = m_pCollectionViewDataSource->collectionCellAtIndex(this, cellRect.size, r.section, r.row, r.item);
if (cell)
{
cell->m_nSection = r.section;
cell->m_nRow = r.row;
cell->m_nItem = r.item;
cell->updateDisplayedAlpha(this->getAlpha());
this->addSubview(cell);
cell->setFrame(cellRect);
itr->second = cell;
if (m_pSelectedCollectionCells.count(r))
{
cell->setControlStateSelected();
}
}
}
}
示例2: getContentOffset
void CAListView::recoveryCell()
{
DRect rect = this->getBounds();
rect.origin = getContentOffset();
rect.origin.y -= rect.size.height * 0.1f;
rect.origin.x -= rect.size.width * 0.1f;
rect.size.width *= 1.2f;
rect.size.height *= 1.2f;
std::map<unsigned int, CAListViewCell*>::iterator itr;
for (itr = m_mpUsedListCells.begin(); itr != m_mpUsedListCells.end(); itr++)
{
CAListViewCell* cell = itr->second;
CC_CONTINUE_IF(cell == NULL);
DRect cellRect = cell->getFrame();
CC_CONTINUE_IF(rect.intersectsRect(cellRect));
m_mpFreedListCells[cell->getReuseIdentifier()].pushBack(cell);
cell->removeFromSuperview();
cell->resetCell();
itr->second = NULL;
m_vpUsedListCells.eraseObject(cell);
CAView* line = m_pUsedLines[itr->first];
CC_CONTINUE_IF(line == NULL);
m_pFreedLines.pushBack(line);
line->removeFromSuperview();
m_pUsedLines[itr->first] = NULL;
}
}
示例3: getContentOffset
void CATableView::recoveryTableCell()
{
CCRect rect = this->getBounds();
rect.origin = getContentOffset();
rect.origin.y -= rect.size.height * 0.1f;
rect.size.height *= 1.2f;
std::map<CAIndexPath2E, CATableViewCell*>::iterator itr;
for (itr=m_pUsedTableCells.begin();
itr!=m_pUsedTableCells.end();
itr++)
{
CATableViewCell* cell = itr->second;
CC_CONTINUE_IF(cell == NULL);
CCRect cellRect = cell->getFrame();
CC_CONTINUE_IF(rect.intersectsRect(cellRect));
m_pFreedTableCells[cell->getReuseIdentifier()].pushBack(cell);
cell->removeFromSuperview();
cell->resetTableViewCell();
itr->second = NULL;
CAView* line = m_pUsedLines[itr->first];
CC_CONTINUE_IF(line == NULL);
m_pFreedLines.pushBack(line);
line->removeFromSuperview();
m_pUsedLines[itr->first] = NULL;
}
}
示例4: CC_CONTINUE_IF
void CAListView::clearData()
{
std::map<unsigned int, CAView*>::iterator it = m_pUsedLines.begin();
for (; it != m_pUsedLines.end(); ++it)
{
CAView* view = it->second;
CC_CONTINUE_IF(view == NULL);
m_pFreedLines.pushBack(view);
view->removeFromSuperview();
}
m_pUsedLines.clear();
m_mpUsedListCells.clear();
for (int i = 0; i < m_vpUsedListCells.size(); i++)
{
CAListViewCell* cell = m_vpUsedListCells.at(i);
CC_CONTINUE_IF(cell == NULL);
m_mpFreedListCells[cell->getReuseIdentifier()].pushBack(cell);
cell->removeFromSuperview();
cell->resetCell();
}
m_vpUsedListCells.clear();
m_nIndexs = 0;
m_rIndexRects.clear();
m_rLineRects.clear();
m_rHeaderRect = m_rFooterRect = DRectZero;
m_pHighlightedListCells = NULL;
}
示例5: getContentOffset
void CAAutoCollectionView::updateSectionHeaderAndFooterRects()
{
DRect rect = this->getBounds();
rect.origin = getContentOffset();
for (int i = 0; i < m_rCollectionViewSection.size(); i++)
{
CollectionViewSection& cvs = m_rCollectionViewSection[i];
CC_CONTINUE_IF(!rect.intersectsRect(cvs.rSectionRect));
CAView* header = cvs.pSectionHeaderView;
CAView* footer = cvs.pSectionFooterView;
float headerHeight = cvs.nSectionHeaderHeight;
float footerHeight = cvs.nSectionFooterHeight;
if (header && m_bAlwaysTopSectionHeader)
{
DPoint p1 = rect.origin;
p1.y = MAX(p1.y, cvs.rSectionRect.origin.y);
p1.y = MIN(p1.y, cvs.rSectionRect.origin.y + cvs.rSectionRect.size.height
- headerHeight - footerHeight);
header->setFrameOrigin(p1);
}
if (footer && m_bAlwaysBottomSectionFooter)
{
DPoint p2 = DPointZero;
p2.y = MIN(rect.origin.y + this->getBounds().size.height - footerHeight,
cvs.rSectionRect.origin.y + cvs.rSectionRect.size.height - footerHeight);
p2.y = MAX(p2.y, cvs.rSectionRect.origin.y + headerHeight);
footer->setFrameOrigin(p2);
}
}
}
示例6: CC_CONTINUE_IF
void CAControl::setContentSize(const CCSize& var)
{
CAView::setContentSize(var);
for(int i=0; i<CAControlStateAll; i++)
{
CC_CONTINUE_IF(m_pBackGroundView[i] == NULL);
m_pBackGroundView[i]->setFrame(this->getBounds());
}
}
示例7: CC_CONTINUE_IF
void CAButton::updateWithPreferredSize()
{
for (int i=0; i<CAControlStateAll; i++)
{
CC_CONTINUE_IF(m_pBackGroundView[i] == NULL);
CC_CONTINUE_IF(this->getBounds().equals(m_pBackGroundView[i]->getBounds()));
if (CAScale9ImageView* _var = dynamic_cast<CAScale9ImageView*>(m_pBackGroundView[i]))
{
_var->setFrame(this->getBounds());
}
else
{
m_pBackGroundView[i]->setFrame(this->getBounds());
}
}
m_pLabel->setFontSize(this->getBounds().size.height * 0.667f);
}
示例8: MIN
void CATabBarController::pageViewDidEndTurning(CAPageView* pageView)
{
for (int i = MAX((int)m_nSelectedIndex - 1, 0);
i < MIN((int)m_nSelectedIndex + 2, m_pViewControllers.size());
i++)
{
CC_CONTINUE_IF(i == pageView->getCurrPage());
m_pViewControllers.at(i)->getView()->setVisible(false);
}
CC_RETURN_IF(m_nSelectedIndex == pageView->getCurrPage());
this->showSelectedViewControllerAtIndex(pageView->getCurrPage());
}
示例9: getLastResponder
CAResponder* getLastResponder(CATouch* touch, const CAVector<CAView*>& subviews)
{
CAResponder* lastResponder = NULL;
for (CAVector<CAView*>::const_reverse_iterator itr=subviews.rbegin();
itr!=subviews.rend();
itr++)
{
CAView* subview = *itr;
if (subview->isVisible())
{
if (CAViewController* viewController = dynamic_cast<CAViewController*>(subview->getContentContainer()))
{
CC_CONTINUE_IF(!viewController->isTouchEnabled());
DPoint point = subview->convertTouchToNodeSpace(touch);
if (subview->getBounds().containsPoint(point))
{
lastResponder = viewController;
break;
}
}
else
{
CC_CONTINUE_IF(!subview->isTouchEnabled());
DPoint point = subview->convertTouchToNodeSpace(touch);
if (subview->getBounds().containsPoint(point))
{
lastResponder = subview;
break;
}
}
}
}
return lastResponder;
}
示例10: MIN
void CATabBarController::pageViewDidEndTurning(CAPageView* pageView)
{
CAApplication::getApplication()->getTouchDispatcher()->setDispatchEventsTrue();
for (int i = MAX((int)m_nSelectedIndex - 1, 0);
i < MIN((int)m_nSelectedIndex + 2, m_pViewControllers.size());
i++)
{
CC_CONTINUE_IF(i == pageView->getCurrPage());
m_pViewControllers.at(i)->getView()->setVisible(false);
}
CC_RETURN_IF(m_nSelectedIndex == pageView->getCurrPage());
this->showSelectedViewControllerAtIndex(pageView->getCurrPage());
}
示例11: getContentOffset
void CACollectionView::recoveryCollectionCell()
{
DRect rect = this->getBounds();
rect.origin = getContentOffset();
rect.origin.y -= rect.size.height * 0.1f;
rect.size.height *= 1.2f;
std::map<CAIndexPath3E, CACollectionViewCell*>::iterator itr;
for (itr = m_mpUsedCollectionCells.begin(); itr != m_mpUsedCollectionCells.end(); itr++)
{
CACollectionViewCell* cell = itr->second;
CC_CONTINUE_IF(cell == NULL);
DRect cellRect = cell->getFrame();
CC_CONTINUE_IF(rect.intersectsRect(cellRect));
m_mpFreedCollectionCells[cell->getReuseIdentifier()].pushBack(cell);
cell->removeFromSuperview();
cell->resetCollectionViewCell();
itr->second = NULL;
m_vpUsedCollectionCells.eraseObject(cell);
}
}
示例12: MAX
void CAButton::setContentSize(const CCSize & var)
{
CCSize size = var;
size.height = MAX(size.height, _px(60));
size.width = MAX(size.width, size.height);
CAView::setContentSize(size);
for(int i=0; i<CAControlStateAll; i++)
{
CC_CONTINUE_IF(m_pBackGroundView[i] == NULL);
m_pBackGroundView[i]->setFrame(this->getBounds());
}
this->updateWithPreferredSize();
this->setControlState(m_eControlState);
}
示例13: CC_CONTINUE_IF
void CATouchController::touchBegan()
{
m_tFirstPoint = m_pTouch->getLocation();
std::vector<CAResponder*> vector;
CAView* view = dynamic_cast<CAView*>(CAApplication::getApplication()->getTouchDispatcher()->getFirstResponder());
bool isContainsFirstPoint = view && view->convertRectToWorldSpace(view->getBounds()).containsPoint(m_tFirstPoint);
if (isContainsFirstPoint)
{
vector = this->getEventListener(m_pTouch, view);
}
else
{
vector = this->getEventListener(m_pTouch, CAApplication::getApplication()->getRootWindow());
}
std::vector<CAResponder*>::iterator itr;
for (itr=vector.begin(); itr!=vector.end(); itr++)
{
CC_CONTINUE_IF(!(*itr)->isPriorityScroll());
CC_CONTINUE_IF(!(*itr)->isScrollEnabled());
CC_CONTINUE_IF(!(*itr)->isHorizontalScrollEnabled() && !(*itr)->isVerticalScrollEnabled());
m_vTouchMovedsViewCache.pushBack((*itr));
}
m_vTouchesViews.pushBack(vector.back());
if (!m_vTouchMovedsViewCache.empty())
{
CAScheduler::schedule(schedule_selector(CATouchController::passingTouchesViews), this, 0, 0, 0.05f);
}
else
{
this->passingTouchesViews();
}
}
示例14: CC_CONTINUE_IF
void CATouchDispatcher::touchesMoved(CCSet *touches, CAEvent *pEvent)
{
m_bLocked = true;
CATouch *pTouch;
CCSetIterator setIter;
for (setIter = touches->begin(); setIter != touches->end(); setIter++)
{
pTouch = (CATouch *)(*setIter);
CATouchController* touchController = m_vTouchControllers[pTouch->getID()];
CC_CONTINUE_IF(touchController == NULL);
touchController->touchMoved();
}
m_bLocked = false;
}
示例15: CC_CONTINUE_IF
bool CAAutoCollectionView::ccTouchBegan(CATouch *pTouch, CAEvent *pEvent)
{
if (!m_vTouches.empty())
{
m_vTouches.replace(0, pTouch);
return true;
}
bool isInertia = m_tInertia.getLength() < 1.0f;
if (!CAScrollView::ccTouchBegan(pTouch, pEvent))
return false;
if (m_bAllowsSelection && this->isScrollWindowNotOutSide() == false && isInertia)
{
DPoint point = m_pContainer->convertTouchToNodeSpace(pTouch);
std::map<CAIndexPath3E, CACollectionViewCell*>::iterator itr;
for (itr = m_mpUsedCollectionCells.begin(); itr != m_mpUsedCollectionCells.end(); ++itr)
{
CACollectionViewCell* pCell = itr->second;
CC_CONTINUE_IF(pCell == NULL);
if (pCell->getFrame().containsPoint(point) && pCell->isVisible())
{
CC_BREAK_IF(pCell->getControlState() == CAControlStateDisabled);
if (m_pHighlightedCollectionCells != pCell)
{
if (m_pHighlightedCollectionCells)
{
m_pHighlightedCollectionCells->setControlStateNormal();
}
m_pHighlightedCollectionCells = pCell;
}
CC_BREAK_IF(pCell->getControlState() == CAControlStateSelected);
CAViewAnimation::beginAnimations(m_s__StrID, NULL);
CAViewAnimation::setAnimationDuration(0.05f);
CAViewAnimation::setAnimationDidStopSelector(pCell, CAViewAnimation0_selector(CACollectionViewCell::setControlStateHighlighted));
CAViewAnimation::commitAnimations();
break;
}
}
}
return true;
}