virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent){ if(!isVisible()){ return; } CCTableViewCell *cell = cellForTouch(pTouch); if(cell){ CCTableViewDelegate *dele = getTableViewDelegate(); LuaEventHandler *h = dynamic_cast<LuaEventHandler *>(dele); #if COCOS2D_VERSION >= 0x00030000 Array *touches = _touches; #else CCArray *touches = m_pTouches; #endif if(touches->count() == 1 && !isTouchMoved()){ if(h){ h->tableCellTouched(this, cell, pTouch);} else{ dele->tableCellTouched(this, cell);} dele->tableCellUnhighlight(this, cell); }else if(h){ h->tableCellTouchEnded(this, cell, pTouch); } }else{ printf("LuaTableView.touchEnded cell is null %f,%f\n", pTouch->getLocation().x, pTouch->getLocation().y); } CCScrollView::ccTouchEnded(pTouch, pEvent); }
void LuaTableView::ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent){ if(!isVisible()){ return; } CCTableViewCell *cell = cellForTouch(pTouch); if(cell){ LuaEventHandler *h = dynamic_cast<LuaEventHandler *>(m_pTableViewDelegate); if(m_pTouches->count() == 1 && !isTouchMoved()){ if(h){ h->tableCellTouched(this, cell, pTouch);} else{ m_pTableViewDelegate->tableCellTouched(this, cell);} }else if(h){ h->tableCellTouchEnded(this, cell, pTouch); } }else{ printf("LTV.touchEnded cell is null %f,%f\n", pTouch->getLocation().x, pTouch->getLocation().y); } CCScrollView::ccTouchEnded(pTouch, pEvent); }