Class
MouseSelectionHandler

This class handles the mouse selection in RadRichTextBox.

Definition

Namespace:Telerik.Windows.Documents.Selection

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class MouseSelectionHandler

Inheritance: objectMouseSelectionHandler

Constructors

MouseSelectionHandler(RadDocument, IDocumentEditorPresenter)

Declaration

cs-api-definition
public MouseSelectionHandler(RadDocument document, IDocumentEditorPresenter presenter)

Parameters

document

RadDocument

presenter

IDocumentEditorPresenter

Fields

DoubleClickTime

This maximum time between click that is considered double click.

Declaration

cs-api-definition
public static double DoubleClickTime

Field Value

double

MouseDoubleClickThreshold

The number of pixels that is acceptable for the mouse to move when doble clicking.

Declaration

cs-api-definition
public static int MouseDoubleClickThreshold

Field Value

int

MouseDragThreshold

The number of pixels that is considered a drag operation.

Declaration

cs-api-definition
public static int MouseDragThreshold

Field Value

int

Properties

DropPosition

Gets the drop position for the mouse selection handler.

Declaration

cs-api-definition
public DocumentPosition DropPosition { get; }

Property Value

DocumentPosition

IsClickSelecting

Gets a value indicating whether the current mouse selection is a click selection.

Declaration

cs-api-definition
public bool IsClickSelecting { get; }

Property Value

bool

IsDragging

Gets a value indicating whether the mouse is currently dragging a selection.

Declaration

cs-api-definition
public bool IsDragging { get; }

Property Value

bool

IsMoveSelectionDragging

Determines whether the selection is currently being dragged.

Declaration

cs-api-definition
public bool IsMoveSelectionDragging { get; }

Property Value

bool

IsTracking

Gets a value indicating whether the mouse selection handler is currently tracking mouse movements.

Declaration

cs-api-definition
public bool IsTracking { get; }

Property Value

bool

Methods

CancelSelection()

Cancels the current mouse selection, resetting any selected elements to their unselected state.

Declaration

cs-api-definition
public bool CancelSelection()

Returns

bool

Returns a boolean indicating whether the selection was successfully canceled.

HandleDocumentCaretPositionChanged(bool, bool)

Handles changes to the document caret position in response to user interactions.

Declaration

cs-api-definition
public void HandleDocumentCaretPositionChanged(bool ctrlPressed, bool shiftPressed)

Parameters

ctrlPressed

bool

Indicates whether the Control key is presses

shiftPressed

bool

Indicates whether the Shift key is pressed

OnSelectionDragged(SelectionDragEventArgs)

Declaration

cs-api-definition
protected virtual void OnSelectionDragged(SelectionDragEventArgs e)

Parameters

e

SelectionDragEventArgs

RegisterDocumentMouseDown(bool, bool, Point, UIElement, SourceType)

Registers the mouse down event for a document, allowing for custom selection behavior.

Declaration

cs-api-definition
public virtual void RegisterDocumentMouseDown(bool ctrlPressed, bool shiftPressed, Point position, UIElement originalSource = null, SourceType source = SourceType.Mouse)

Parameters

ctrlPressed

bool

Indicates if the Control key is pressed during the mouse down event.

shiftPressed

bool

Indicates if the Shift key is pressed during the mouse down event.

position

Point

The position of the mouse cursor when the mouse down event occurred.

originalSource

UIElement

The UI element that is the target of the mouse down event.

source

SourceType

The source type of the selection event.

RegisterDocumentMouseMove(Point, SourceType)

Registers a mouse move event for the document selection handler.

Declaration

cs-api-definition
public virtual void RegisterDocumentMouseMove(Point position, SourceType source = SourceType.Mouse)

Parameters

position

Point

The point in the document where the mouse move event occurs.

source

SourceType

The source type that indicates where the mouse move event originated from.

RegisterDocumentMouseRightButtonDown(UIElement, SourceType)

Registers the mouse right button down event for the specified UI element in the document selection.

Declaration

cs-api-definition
public virtual void RegisterDocumentMouseRightButtonDown(UIElement originalSource, SourceType source = SourceType.Mouse)

Parameters

originalSource

UIElement

The UI element to which the mouse right button down event is registered.

source

SourceType

The source type indicating the origin of the selection action.

RegisterDocumentMouseUp(SourceType, Point?)

Registers a mouse up event handler for the document selection.

Declaration

cs-api-definition
public virtual void RegisterDocumentMouseUp(SourceType source = SourceType.Mouse, Point? position = null)

Parameters

source

SourceType

The type of source that triggered the mouse up event.

position

Point?

An optional point representing the location of the mouse up event.

RegisterDocumentMultipleMouseDown(bool, bool, Point)

Declaration

cs-api-definition
protected virtual void RegisterDocumentMultipleMouseDown(bool ctrlPressed, bool shiftPressed, Point position)

Parameters

ctrlPressed

bool

shiftPressed

bool

position

Point

RegisterDocumentSingleMouseDown(bool, bool, Point, UIElement)

Declaration

cs-api-definition
protected virtual void RegisterDocumentSingleMouseDown(bool ctrlPressed, bool shiftPressed, Point position, UIElement originalSource)

Parameters

ctrlPressed

bool

shiftPressed

bool

position

Point

originalSource

UIElement

Events

SelectionDragged

Declaration

cs-api-definition
public event EventHandler<SelectionDragEventArgs> SelectionDragged

Event Value

EventHandler<SelectionDragEventArgs>