ClassMouseSelectionHandler
This class handles the mouse selection in RadRichTextBox.
Definition
Namespace:Telerik.Windows.Documents.Selection
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class MouseSelectionHandler
Inheritance: objectMouseSelectionHandler
Constructors
MouseSelectionHandler(RadDocument, IDocumentEditorPresenter)
Declaration
public MouseSelectionHandler(RadDocument document, IDocumentEditorPresenter presenter)
Parameters
document
presenter
Fields
DoubleClickTime
This maximum time between click that is considered double click.
MouseDoubleClickThreshold
The number of pixels that is acceptable for the mouse to move when doble clicking.
MouseDragThreshold
The number of pixels that is considered a drag operation.
Properties
DropPosition
Gets the drop position for the mouse selection handler.
Declaration
public DocumentPosition DropPosition { get; }
Property Value
IsClickSelecting
Gets a value indicating whether the current mouse selection is a click selection.
IsDragging
Gets a value indicating whether the mouse is currently dragging a selection.
IsMoveSelectionDragging
Determines whether the selection is currently being dragged.
IsTracking
Gets a value indicating whether the mouse selection handler is currently tracking mouse movements.
Methods
CancelSelection()
Cancels the current mouse selection, resetting any selected elements to their unselected state.
Declaration
public bool CancelSelection()
Returns
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.
OnSelectionDragged(SelectionDragEventArgs)
Declaration
protected virtual void OnSelectionDragged(SelectionDragEventArgs e)
Parameters
e
RegisterDocumentMouseDown(bool, bool, Point, UIElement, SourceType)
Registers the mouse down event for a document, allowing for custom selection behavior.
Declaration
public virtual void RegisterDocumentMouseDown(bool ctrlPressed, bool shiftPressed, Point position, UIElement originalSource = null, SourceType source = SourceType.Mouse)
Parameters
ctrlPressed
Indicates if the Control key is pressed during the mouse down event.
shiftPressed
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
The source type of the selection event.
RegisterDocumentMouseMove(Point, SourceType)
Registers a mouse move event for the document selection handler.
Declaration
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
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
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
The source type indicating the origin of the selection action.
RegisterDocumentMouseUp(SourceType, Point?)
Registers a mouse up event handler for the document selection.
Declaration
public virtual void RegisterDocumentMouseUp(SourceType source = SourceType.Mouse, Point? position = null)
Parameters
source
The type of source that triggered the mouse up event.
position
Point?
An optional point representing the location of the mouse up event.
Events
SelectionDragged
Declaration
public event EventHandler<SelectionDragEventArgs> SelectionDragged
Event Value