internal protected override void MousePressed (MarginMouseEventArgs args)
		{
			base.MousePressed (args);
			
			if (args.Button != 1)
				return;
			Caret.Offset = args.Line * BytesInRow;
		}
        internal protected override void MouseHover(MarginMouseEventArgs args)
        {
            base.MouseHover(args);

            if (args.Button != 1)
            {
                return;
            }
            Caret.InTextEditor = true;

            long hoverOffset = GetOffset(args);

            if (Data.MainSelection == null)
            {
                Data.SetSelection(hoverOffset, hoverOffset);
            }
            else
            {
                Data.ExtendSelectionTo(hoverOffset);
            }
            Caret.PreserveSelection = true;
            Caret.Offset            = hoverOffset;
            Caret.PreserveSelection = false;
        }
Beispiel #3
0
		internal protected override void MousePressed (MarginMouseEventArgs args)
		{
			base.MousePressed (args);
			
			if (args.Button != PointerButton.Left)
				return;
			
			Caret.InTextEditor = true;
			Caret.Offset = GetOffset (args.X, args.Line);
		}
Beispiel #4
0
		internal protected virtual void MouseReleased (MarginMouseEventArgs args)
		{
			if (ButtonReleased != null)
				ButtonReleased (this, args);
		}
		internal protected virtual void MouseHover (MarginMouseEventArgs args)
		{
			if (MouseMoved != null)
				MouseMoved (this, args);
		}
		internal protected override void MouseHover (MarginMouseEventArgs args)
		{
			base.MouseHover (args);

			if (args.Button != 1)
				return;
			Caret.InTextEditor = false;
			
			int groupChar;
			long hoverOffset = GetOffset (args, out groupChar);
			if (Data.MainSelection == null) {
				Data.SetSelection (hoverOffset, hoverOffset);
			} else {
				Data.ExtendSelectionTo (hoverOffset);
			}
			Caret.PreserveSelection = true;
			Caret.Offset = hoverOffset;
			Caret.PreserveSelection = false;
		}
		long GetOffset (MarginMouseEventArgs args, out int groupChar)
		{
			int groupNumber = args.X / groupWidth;
			groupChar = (args.X % groupWidth) / Editor.textEditorMargin.charWidth;
			return args.Line * BytesInRow + groupNumber * Editor.Options.GroupBytes + groupChar / 2;
		}
		internal protected override void MousePressed (MarginMouseEventArgs args)
		{
			base.MousePressed (args);
			
			if (args.Button != 1)
				return;
			
			Caret.InTextEditor = false;
			int groupChar;
			Caret.Offset      = GetOffset (args, out groupChar);
			Caret.SubPosition = groupChar % 2;
		}
		long GetOffset (MarginMouseEventArgs args)
		{
			return args.Line * BytesInRow + args.X / charWidth;
		}
 long GetOffset(MarginMouseEventArgs args)
 {
     return(args.Line * BytesInRow + args.X / charWidth);
 }