protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown (e); var point = new PointF (e.X, e.Y); var hitRect = _hitRects.FindNext (hr => hr.Rect.Contains (point)); if (!hitRect.IsEmpty) { _focusedPath = new SExprPath (_code, hitRect.First.SExp); Invalidate (); } }
private void Navigate(Keys key) { switch (key) { case Keys.Down: _focusedPath = _focusedPath.NextSibling (_code).Item2; break; case Keys.Up: _focusedPath = _focusedPath.PrevSibling (_code).Item2; break; case Keys.Left: _focusedPath = _focusedPath.Previous (_code).Item2; break; case Keys.Right: _focusedPath = _focusedPath.Next (_code).Item2; break; } Invalidate (); }