Exemplo n.º 1
0
        public override void TouchCancelled(CCTouch touch)
        {
            base.TouchCancelled(touch);

            if (m_pTouchedCell != null)
            {
                if (m_pTableViewDelegate != null)
                {
                    m_pTableViewDelegate.TableCellUnhighlight(this, m_pTouchedCell);
                }

                m_pTouchedCell = null;
            }
        }
Exemplo n.º 2
0
		public virtual void TableCellTouched(CCTableView table, CCTableViewCell cell)
		{
            CCLog.Log("cell touched at index: {0}", cell.Index);
		}
Exemplo n.º 3
0
        public override void TouchEnded(CCTouch pTouch)
        {
            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);
        }
Exemplo n.º 4
0
        public override bool TouchBegan(CCTouch pTouch)
        {
            if (!Visible)
            {
                return false;
            }
            
            bool touchResult = base.TouchBegan(pTouch);

            if (m_pTouches.Count == 1)
            {
                var point = Container.ConvertTouchToNodeSpace(pTouch);
                var index = _indexFromOffset(point);
                if (index == CCArrayForObjectSorting.CC_INVALID_INDEX)
                {
                    m_pTouchedCell = null;
                }
                else
                {
                    m_pTouchedCell = CellAtIndex(index); 
                }

                if (m_pTouchedCell != null && m_pTableViewDelegate != null)
                {
                    m_pTableViewDelegate.TableCellHighlight(this, m_pTouchedCell);
                }
            }
            else if (m_pTouchedCell != null)
            {
                if (m_pTableViewDelegate != null)
                {
                    m_pTableViewDelegate.TableCellUnhighlight(this, m_pTouchedCell);
                }

                m_pTouchedCell = null;
            }

            return touchResult;
        }
Exemplo n.º 5
0
        protected void _moveCellOutOfSight(CCTableViewCell cell)
        {
            if (m_pTableViewDelegate != null)
            {
                m_pTableViewDelegate.TableCellWillRecycle(this, cell);
            }

            m_pCellsFreed.Add(cell);
            m_pCellsUsed.RemoveSortedObject(cell);
            m_pIndices.Remove(cell.Index);
            cell.Reset();
            if (cell.Parent == Container)
            {
                Container.RemoveChild(cell, true);
            }
        }
Exemplo n.º 6
0
 protected void _setIndexForCell(int index, CCTableViewCell cell)
 {
     cell.AnchorPoint = CCPoint.Zero;
     cell.Position = _offsetFromIndex(index);
     cell.Index = index;
 }
Exemplo n.º 7
0
 protected void _addCellIfNecessary(CCTableViewCell cell)
 {
     if (cell.Parent != Container)
     {
         Container.AddChild(cell);
     }
     m_pCellsUsed.InsertSortedObject(cell);
     m_pIndices.Add(cell.Index);
 }
Exemplo n.º 8
0
        public override void TouchMoved(CCTouch touch)
        {
            base.TouchMoved(touch);

            if (_touchedCell != null && IsTouchMoved)
            {
                if (_tableViewDelegate != null)
                {
                    _tableViewDelegate.TableCellUnhighlight(this, _touchedCell);
                }

                _touchedCell = null;
            }
        }
Exemplo n.º 9
0
 public void TableCellWillRecycle(CCTableView table, CCTableViewCell cell)
 {
 }
Exemplo n.º 10
0
 public void TableCellUnhighlight(CCTableView table, CCTableViewCell cell)
 {
 }
Exemplo n.º 11
0
        protected void _moveCellOutOfSight(CCTableViewCell cell)
        {
            m_pCellsFreed.Add(cell);
            m_pCellsUsed.RemoveSortedObject(cell);
            m_pIndices.Remove(cell.Index);
            cell.Reset();

            if (cell.Parent == Container)
            {
                Container.RemoveChild(cell, true);
            }
        }