本文整理汇总了C++中CAListViewCell::getFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ CAListViewCell::getFrame方法的具体用法?C++ CAListViewCell::getFrame怎么用?C++ CAListViewCell::getFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAListViewCell
的用法示例。
在下文中一共展示了CAListViewCell::getFrame方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: recoveryCollectionCell
void CAListView::recoveryCollectionCell()
{
CCRect rect = this->getBounds();
rect.origin = getContentOffset();
rect.origin.y -= rect.size.height * 0.1f;
rect.size.height *= 1.2f;
std::map<unsigned int, CAListViewCell*>::iterator itr;
for (itr = m_pUsedListCells.begin(); itr != m_pUsedListCells.end(); itr++)
{
CAListViewCell* cell = itr->second;
CC_CONTINUE_IF(cell == NULL);
CCRect cellRect = cell->getFrame();
CC_CONTINUE_IF(rect.intersectsRect(cellRect));
m_pFreedListCells[cell->getReuseIdentifier()].pushBack(cell);
cell->removeFromSuperview();
cell->resetListViewCell();
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;
}
}
示例2: ccTouchBegan
bool CAListView::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<unsigned int, CAListViewCell*>::iterator itr;
for (itr = m_mpUsedListCells.begin(); itr != m_mpUsedListCells.end(); ++itr)
{
CAListViewCell* pCell = itr->second;
CC_CONTINUE_IF(pCell == NULL);
if (pCell->getFrame().containsPoint(point) && pCell->isVisible())
{
CC_BREAK_IF(pCell->getControlState() == CAControlStateDisabled);
if (m_pHighlightedListCells != pCell)
{
if (m_pHighlightedListCells)
{
m_pHighlightedListCells->setControlStateNormal();
}
m_pHighlightedListCells = pCell;
}
CC_BREAK_IF(pCell->getControlState() == CAControlStateSelected);
CAViewAnimation::beginAnimations(m_s__StrID, NULL);
CAViewAnimation::setAnimationDuration(0.05f);
CAViewAnimation::setAnimationDidStopSelector(pCell, CAViewAnimation0_selector(CAListViewCell::setControlStateHighlighted));
CAViewAnimation::commitAnimations();
break;
}
}
}
return true;
}
示例3: ccTouchBegan
bool CAListView::ccTouchBegan(CATouch *pTouch, CAEvent *pEvent)
{
if (m_pTouches->count() > 0)
{
m_pTouches->replaceObjectAtIndex(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)
{
CCPoint point = m_pContainer->convertTouchToNodeSpace(pTouch);
std::map<unsigned int, CAListViewCell*>::iterator itr;
for (itr = m_pUsedListCells.begin(); itr != m_pUsedListCells.end(); ++itr)
{
CAListViewCell* pCell = itr->second;
CC_CONTINUE_IF(pCell == NULL);
if (pCell->getFrame().containsPoint(point) && pCell->isVisible())
{
CC_BREAK_IF(pCell->getControlState() == CAControlStateDisabled);
if (m_pHighlightedListCells)
{
m_pHighlightedListCells->setControlStateNormal();
}
m_pHighlightedListCells = pCell;
CC_BREAK_IF(pCell->getControlState() == CAControlStateSelected);
CCDelayTime* delayTime = CCDelayTime::create(0.05f);
CCCallFunc* func = CCCallFunc::create(pCell, callfunc_selector(CAListViewCell::setControlStateHighlighted));
CCSequence* actions = CCSequence::create(delayTime, func, NULL);
m_pContainer->runAction(actions);
break;
}
}
}
return true;
}
示例4: mouseMoved
void CAListView::mouseMoved(CATouch* pTouch, CAEvent* pEvent)
{
if (m_bAllowsSelection)
{
DPoint point = m_pContainer->convertTouchToNodeSpace(pTouch);
std::map<unsigned int, CAListViewCell*>::iterator itr;
for (itr = m_mpUsedListCells.begin(); itr != m_mpUsedListCells.end(); ++itr)
{
CAListViewCell* pCell = itr->second;
CC_CONTINUE_IF(pCell == NULL);
if (pCell->getFrame().containsPoint(point) && pCell->isVisible())
{
CC_BREAK_IF(pCell->getControlState() == CAControlStateDisabled);
if (m_pHighlightedListCells)
{
unsigned int index = m_pHighlightedListCells->getIndex();
if (m_pSelectedListCells.count(index))
{
m_pHighlightedListCells->setControlStateHighlighted();
}
else
{
m_pHighlightedListCells->setControlStateNormal();
}
}
m_pHighlightedListCells = pCell;
pCell->setControlStateHighlighted();
break;
}
}
}
}