Beispiel #1
0
        void OnCageMoving(Cage cage, Point position)
        {
            if (cage.Target == Parent || cage.Target == this)
            {
                return;
            }

            var pPos = Parent.CanvasPosToLocal(position);

            cage.Target.SetPosition(pPos.X, pPos.Y);
        }
Beispiel #2
0
        public void AddSelection(Gwen.Control.Base pControl, bool fireEvent)
        {
            Cage pCage = new Cage( this );
            pCage.Setup(pControl);
            pCage.Moving += OnCageMoving;

            m_Selected.Add( pControl );

            if (fireEvent && SelectionChanged != null)
                SelectionChanged.Invoke(m_Selected);

            Redraw();
        }
Beispiel #3
0
        public void AddSelection(Gwen.Control.Base pControl, bool fireEvent)
        {
            Cage pCage = new Cage(this);

            pCage.Setup(pControl);
            pCage.Moving += OnCageMoving;

            m_Selected.Add(pControl);

            if (fireEvent && SelectionChanged != null)
            {
                SelectionChanged.Invoke(m_Selected);
            }

            Redraw();
        }
Beispiel #4
0
        void SwitchCage(Gwen.Control.Base pControl, Gwen.Control.Base pTo)
        {
            foreach (var child in  Children)
            {
                Cage pCage = child as Cage;
                if (pCage == null)
                {
                    continue;
                }

                if (pCage.Target == pControl)
                {
                    pCage.Setup(pTo);
                }
            }
        }
Beispiel #5
0
        public void RemoveSelection(Gwen.Control.Base pControl)
        {
            foreach (var s in m_Selected)
            {
                Cage pCage = s as Cage;
                if (pCage == null)
                {
                    continue;
                }

                if (pCage.Target == pControl)
                {
                    pCage.DelayedDelete();
                }
            }

            m_Selected.Remove(pControl);

            Redraw();
        }
Beispiel #6
0
        void OnCageMoving(Cage cage, Point position )
        {
            if ( cage.Target == Parent || cage.Target == this)
                return;

            var pPos = Parent.CanvasPosToLocal( position );

            cage.Target.SetPosition(pPos.X, pPos.Y);
        }