コード例 #1
0
        public override void TouchEnded(CCTouch pTouch, CCEvent pEvent)
        {
            if (!Visible)
            {
                return;
            }
            if (m_pTouches.Count == 1 && !IsTouchMoved)
            {
                int             index;
                CCTableViewCell cell;

                CCPoint point = Container.ConvertTouchToNodeSpace(pTouch);

                if (m_eVordering == CCTableViewVerticalFillOrder.FillTopDown)
                {
                    CCSize cellSize = m_pDataSource.CellSizeForTable(this);
                    point.Y -= cellSize.Height;
                }
                index = _indexFromOffset(point);
                cell  = _cellWithIndex(index);

                if (cell != null)
                {
                    m_pTableViewDelegate.TableCellTouched(this, cell);
                }
            }
            base.TouchEnded(pTouch, pEvent);
        }
コード例 #2
0
        public override void TouchEnded(CCTouch pTouch, CCEvent pEvent)
        {
            if (!Visible)
            {
                return;
            }

            if (m_pTouchedCell != null)
            {
                CCRect bb = BoundingBox;
                bb.Origin = Parent.ConvertToWorldSpace(bb.Origin);

                if (bb.ContainsPoint(pTouch.Location) && m_pTableViewDelegate != null)
                {
                    m_pTableViewDelegate.TableCellUnhighlight(this, m_pTouchedCell);
                    m_pTableViewDelegate.TableCellTouched(this, m_pTouchedCell);
                }

                m_pTouchedCell = null;
            }

            base.TouchEnded(pTouch, pEvent);
        }