void CheckBox::releaseUpEvent() { Widget::releaseUpEvent(); if (_isSelected){ setSelected(false); unSelectedEvent(); } else { setSelected(true); selectedEvent(); } }
void UICheckBox::onTouchEnded(const Point &touchPoint) { if (_focus) { releaseUpEvent(); if (_isSelected){ setSelectedState(false); unSelectedEvent(); } else { setSelectedState(true); selectedEvent(); } } setFocused(false); _widgetParent->checkChildInfo(2,this,touchPoint); }
void UICheckBox::onTouchEnded(cocos2d::CCPoint &touchPoint) { if (m_bFocus) { releaseUpEvent(); if (m_bIsSelected){ setSelectedState(false); unSelectedEvent(); } else { setSelectedState(true); selectedEvent(); } } setFocus(false); m_pWidgetParent->checkChildInfo(2,this,touchPoint); }
void CheckBox::onTouchEnded(Touch *touch, Event *unusedEvent) { _touchEndPos = touch->getLocation(); if (_focus) { releaseUpEvent(); if (_isSelected){ setSelectedState(false); unSelectedEvent(); } else { setSelectedState(true); selectedEvent(); } } setFocused(false); Widget* widgetParent = getWidgetParent(); if (widgetParent) { widgetParent->checkChildInfo(2,this,_touchEndPos); } }