Exemple #1
0
void UIListViewEx::interceptTouchEvent(int handleState, UIWidget *sender, const cocos2d::CCPoint &touchPoint)
{
    UIScrollView::interceptTouchEvent(handleState, sender, touchPoint);
    if (handleState != 1)
    {
        UIWidget* parent = sender;
        while (parent)
        {
            if (parent && parent->getParent() == m_pInnerContainer)
            {
                _curSelectedIndex = getIndex(parent);
                break;
            }
            parent = parent->getParent();
        }
        selectedItemEvent();
    }
}
void ListView::interceptTouchEvent(int handleState, Widget *sender, const Point &touchPoint)
{
    ScrollView::interceptTouchEvent(handleState, sender, touchPoint);
    if (handleState != 1)
    {
        Widget* parent = sender;
        while (parent)
        {
            if (parent && parent->getParent() == _innerContainer)
            {
                _curSelectedIndex = getIndex(parent);
                break;
            }
            parent = dynamic_cast<Widget*>(parent->getParent());
        }
        selectedItemEvent();
    }
}
Exemple #3
0
void ListView::interceptTouchEvent(TouchEventType event, Widget *sender, Touch* touch)
{
    ScrollView::interceptTouchEvent(event, sender, touch);
    if (event != TouchEventType::MOVED)
    {
        Widget* parent = sender;
        while (parent)
        {
            if (parent && parent->getParent() == _innerContainer)
            {
                _curSelectedIndex = getIndex(parent);
                break;
            }
            parent = dynamic_cast<Widget*>(parent->getParent());
        }
        selectedItemEvent(event);
    }
}