Exemplo n.º 1
0
        /// <summary>
        /// Initialise EventHandler.
        /// </summary>
        /// <param name="canvas"></param>
        /// <param name="e"></param>
        private void SetEventHandler(PToolBoxCanvas canvas, PInputEventArgs e)
        {
            if (m_con.Canvas == null)
                return;
            if (m_object != null)
            {
                ResetEventHandler();
                ResetCurrentStencil();
            }
            m_con.Menu.ResetEventHandler();

            // Set Cursor
            SetCursor(canvas);

            // Set Template.
            m_object = canvas.Setting.CreateTemplate();
            m_object.Pickable = false;
            m_canvas = m_con.Canvas;

            Point systemPos = GetSystemPos(e);
            m_object.Center = m_canvas.SystemPosToCanvasPos(systemPos);
            m_object.Pickable = false;
        }