Exemplo n.º 1
0
void RadioMenu::onTouchMoved(Touch* touch, Event* event)
{
	CCMenuItem *curSelection = this->getItemForTouch(touch);
    if (curSelection != _curHighlighted && curSelection != NULL) {
        _curHighlighted->unselected();
        curSelection->selected();
        _curHighlighted = curSelection;
        return;
    }
}
Exemplo n.º 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;
			}
		}
	}