예제 #1
0
파일: RadioMenu.cpp 프로젝트: Xeplon/game
void RadioMenu::onTouchMoved(Touch* touch, Event* event)
{
	CCMenuItem *curSelection = this->getItemForTouch(touch);
    if (curSelection != _curHighlighted && curSelection != NULL) {
        _curHighlighted->unselected();
        curSelection->selected();
        _curHighlighted = curSelection;
        return;
    }
}
예제 #2
0
///当点击CELL之后,判断是否点击到了某个菜单项,并置为选中状态
void CTableViewCell::selected(const CCPoint &touchPoint)
{
	CCObject *pObject = NULL;
	CCARRAY_FOREACH_REVERSE(m_pArrItems, pObject) 
	{
		CCMenuItem *pMenuItem = (CCMenuItem *) pObject;
		if(pMenuItem->isEnabled() && pMenuItem->isVisible())
		{
			if(pMenuItem->boundingBox().containsPoint(touchPoint))
			{
				pMenuItem->selected();
				m_pTouchItem = pMenuItem;
				break;
			}
		}
	}