private void SetMouseCursor(int x, int y)
{
if (_SyntaxBox.LockCursorUpdate)
{
Cursor = _SyntaxBox.Cursor;
return;
}
if (View.Action == EditAction.DragText)
{
Cursor = Cursors.Hand;
//Cursor.Current = Cursors.Hand;
}
else
{
if (x < View.TotalMarginWidth)
{
if (x < View.GutterMarginWidth)
{
Cursor = Cursors.Arrow;
}
else
{
var ms = new MemoryStream(Properties.Resources.FlippedCursor);
Cursor = new Cursor(ms);
}
}
else
{
if (x > View.TextMargin - 8)
{
if (IsOverSelection(x, y))
Cursor = Cursors.Arrow;
else
{
TextPoint tp = Painter.CharFromPixel(x, y);
Word w = Document.GetWordFromPos(tp);
if (w != null && w.Pattern != null && w.Pattern.Category != null)
{
var e = new WordMouseEventArgs {
Pattern = w.Pattern,
Button = MouseButtons.None,
Cursor = Cursors.Hand,
Word = w
};
_SyntaxBox.OnWordMouseHover(ref e);
Cursor = e.Cursor;
}
else
Cursor = Cursors.IBeam;
}
}
else
{
Cursor = Cursors.Arrow;
}
}
}
}