예제 #1
0
        /// <summary>
        /// Called when the mouse is down on the pathway canvas
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnMouseDown(object sender, PInputEventArgs e)
        {
            base.OnMouseDown(sender, e);
            // if Button != MouseButtons.Left, return.
            if (e.Button != MouseButtons.Left)
                return;
            // if PickedNode
            if (e.PickedNode is PPathwayObject || e.PickedNode is PPathwayEdge)
                return;

            m_canvas = m_con.Canvas;
            m_selectedPath.Reset();

            if (e.PickedNode is PCamera)
            {
                m_surSystem = m_canvas.GetSurroundingSystemKey(e.Position);

                if (string.IsNullOrEmpty(m_surSystem))
                {
                    Util.ShowErrorDialog(MessageResources.ErrOutRoot);
                    return;
                }

                m_startPoint = e.Position;
                e.Canvas.Layer.AddChild(m_selectedPath);
            }
        }