Editor.GraphicsView/DragTypes DragType { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The DragType property of the Editor.GraphicsView class specifies the behavior that occurs when the user drags the mouse within the graphics view. This property is typically toggled in the OnMouseDown event handler to change the drag behavior based on different mouse buttons.

Usage

To use the DragType property, you should set it in response to mouse events, such as OnMouseDown, to define how the graphics view should respond to drag actions. This allows you to customize the interaction model of your graphics view, enabling different functionalities like panning, selecting, or other custom drag operations.

Example

public class MyGraphicsView : Editor.GraphicsView
{
    public override void OnMouseDown(MouseEvent e)
    {
        base.OnMouseDown(e);

        // Example: Set drag type based on mouse button
        if (e.Button == MouseButton.Left)
        {
            DragType = DragTypes.Pan;
        }
        else if (e.Button == MouseButton.Right)
        {
            DragType = DragTypes.Select;
        }
    }
}