コード例 #1
0
 private void _ViewerMouseMove(object sender, MouseEventArgs e)
 {
     if (e.Button != MouseButtons.Right)
     {
         return;
     }
     if (oldX != -1 && oldY != -1)
     {
         _viewer.Pan(e.X - oldX, e.Y - oldY);
     }
     oldX = e.X;
     oldY = e.Y;
 }
コード例 #2
0
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (_gViewer == null)
            {
                return(false);
            }
            if (keyData == (Keys.Up | Keys.Control))
            {
                _gViewer.ZoomOutPressed();
            }
            if (keyData == (Keys.Down | Keys.Control))
            {
                _gViewer.ZoomInPressed();
            }
            if (keyData == Keys.P)
            {
                if (_selectedNode != null)
                {
                    _client.GetProfiledGraphFor(_selectedNode.Id);
                }
            }
            if ((keyData & Keys.S) == Keys.S)
            {
                //if (_selectedNode != null)
                //    _client.GetProfiledGraphFor(_selectedNode.Id);
                //_gViewer.SaveButtonPressed();
            }
            if ((keyData & Keys.G) == Keys.G)
            {
                if (_selectedNode != null)
                {
                    _client.GetGraphFor(_selectedNode.Id);
                }
            }

            if (keyData == Keys.PageDown || keyData == Keys.Oemplus)
            {
                _gViewer.ZoomInPressed();
            }
            if (keyData == Keys.PageUp || keyData == Keys.OemMinus)
            {
                _gViewer.ZoomOutPressed();
            }
            if (keyData == (Keys.Down | Keys.Alt))
            {
                _gViewer.Pan(0, _gViewer.GraphHeight * -.05);
            }
            if (keyData == (Keys.Up | Keys.Alt))
            {
                _gViewer.Pan(0, _gViewer.GraphHeight * .05);
            }
            if (keyData == (Keys.Left | Keys.Alt))
            {
                _gViewer.Pan(_gViewer.GraphHeight * -.1, 0);
            }
            if (keyData == (Keys.Right | Keys.Alt))
            {
                _gViewer.Pan(_gViewer.GraphHeight * .1, 0);
            }
            if (keyData == Keys.H || keyData == Keys.Left)
            {
                selectNode(direction.left);
            }
            if (keyData == Keys.L || keyData == Keys.Right)
            {
                selectNode(direction.right);
            }
            if (keyData == Keys.K || keyData == Keys.Up)
            {
                selectNode(direction.up);
            }
            if (keyData == Keys.J || keyData == Keys.Down)
            {
                selectNode(direction.down);
            }
            if (keyData == Keys.Escape)
            {
                Close();
            }
            if (keyData == Keys.Enter || keyData == Keys.Return || keyData == Keys.Space)
            {
                if (_selectedNode != null)
                {
                    MethodFinder_Slow.GotoMethod(_selectedNode.Id, _dte);
                }
                Close();
            }
            return(true);
        }