void Widget::onTouchEnded(Touch *touch, Event *unusedEvent) { _touchEndPos = touch->getLocation(); bool focus = _focus; setFocused(false); Widget* widgetParent = getWidgetParent(); if (widgetParent) { widgetParent->checkChildInfo(2,this,_touchEndPos); } if (focus) { releaseUpEvent(); } else { cancelUpEvent(); } }
void UIWidget::onTouchEnded(const CCPoint &touchPoint) { m_touchEndPos.x = touchPoint.x; m_touchEndPos.y = touchPoint.y; bool focus = m_bFocus; setFocus(false); if (m_pWidgetParent) { m_pWidgetParent->checkChildInfo(2,this,touchPoint); } if (focus) { releaseUpEvent(); } else { cancelUpEvent(); } }
void Widget::onTouchEnded(Touch *touch, Event *unusedEvent) { _touchEndPosition = touch->getLocation(); Widget* widgetParent = getWidgetParent(); if (widgetParent) { widgetParent->interceptTouchEvent(TouchEventType::ENDED, this, touch); } bool highlight = _highlight; setHighlighted(false); if (highlight) { releaseUpEvent(); } else { cancelUpEvent(); } }
void Widget::onTouchEnded(Touch *touch, Event *unusedEvent) { _touchEndPosition = touch->getLocation(); /* * Propagate touch events to its parents */ if (_propagateTouchEvents) { this->propagateTouchEvent(TouchEventType::ENDED, this, touch); } bool highlight = _highlight; setHighlighted(false); if (highlight) { releaseUpEvent(); } else { cancelUpEvent(); } }
void Widget::onTouchCancelled(Touch *touch, Event *unusedEvent) { setHighlighted(false); cancelUpEvent(); }
void UIWidget::onTouchCancelled(const CCPoint &touchPoint) { setFocused(false); cancelUpEvent(); }