TextBoxViewElement
An editable and selectable TextBoxWrapPanel
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class TextBoxViewElement : TextBoxWrapPanel, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, INotifyPropertyChangingEx
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementTextBoxWrapPanelTextBoxViewElement...
Derived Classes:
Implements:
Inherited Members
Constructors
Creates the editable view that manages text blocks, selection, and scrolling.
public TextBoxViewElement()
Properties
Gets or sets the scroller for Horizontal Scrollbar
public TextBoxScroller HScroller { get; set; }
The Horizontal Scroller
Gets a value indicating whether this textbox is editing mode.
public bool IsEditing { get; }
true if this textbox is editing; otherwise, false.
Gets or sets a value indicating whether text in the text box is read-only.
public bool IsReadOnly { get; set; }
true if this is in read only mode; otherwise, false.
Gets or sets the character used to mask characters of a password in a single-line
public virtual char PasswordChar { get; set; }
Gets or sets the scroll offset.
public SizeF ScrollOffset { get; set; }
The scroll offset.
Gets or sets the selection primitive that renders the selection
public TextBoxSelectionPrimitive SelectionPrimitive { get; set; }
The selection primitive.
Gets or sets a value indicating whether the text in view should appear as the default password character.
public virtual bool UseSystemPasswordChar { get; set; }
Gets or sets the scroller for Vertical Scrollbar
public TextBoxScroller VScroller { get; set; }
The Vertical Scroller
Methods
Suspends notifcations when text is editing.
public void BeginEditUpdate()
Uses the base block-separation rule unless system password masking requires text to remain in one block.
Uses the base block-separation rule unless system password masking requires text to remain in one block.
Updates scroll ranges and clamps the view size, treating infinite or MaxValue constraints as unconstrained.
Deletes the text range
public bool Delete(TextPosition startPosition, TextPosition endPosition)
The start position.
endPositionTextPositionThe end position.
Returns:Disposes the horizontal and vertical scrollers owned by the view.
protected override void DisposeManagedResources()
Overrides:
Recalculates layout at the new DPI scale and invalidates any existing selection for repainting.
public override void DpiScaleChanged(SizeF scaleFactor)
The new DPI scale factor.
Overrides:
Resumes notifcations when text is editing.
public void EndEditUpdate()
Resumes notifcations when text is editing.
public virtual void EndEditUpdate(bool notify, string newText, int caretPosition, TextBoxChangeAction action)
if set to true the event is fired.
The new text.
caretPositionintThe caret position.
actionTextBoxChangeActionThe action.
Offsets the client rectangle by the current scroll position before arranging text blocks.
protected override RectangleF GetClientRectangle(SizeF finalSize)
The final size assigned to the view.
Returns:The client rectangle adjusted by the scroll offset.
Overrides:
Gets the location of TextPosition instance
public PointF GetLocation(TextPosition position)
The position.
Returns:Inserts the specified text in concerte position.
public bool Insert(TextPosition startPosition, string text)
The position.
textstringThe text.
Returns:Saves selection before measuring a wrapped multiline view when no edit update is in progress.
Restores the saved selection after multiline or word-wrap settings change.
protected override void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
The property-change notification.
Overrides:
Saves the current selection before multiline or word-wrap settings change, unless the change is cancelled.
protected override void OnPropertyChanging(PropertyChangingEventArgsEx e)
The property-changing notification.
Overrides:
Paints the selection primitive before the text-block children.
protected override void PaintChildren(IGraphics graphics, Rectangle clipRectange, float angle, SizeF scale, bool useRelativeTransformation)
The graphics context used for drawing.
clipRectangeRectangleThe clipping rectangle for the paint operation.
anglefloatThe element's rotation angle.
scaleSizeFThe scale applied to the element.
useRelativeTransformationboolWhether child painting uses relative transformations.
Overrides:
Restores selection state after painting when multiline word wrapping is active.
protected override void PostPaintChildren(IGraphics graphics, Rectangle clipRectange, float angle, SizeF scale)
The graphics context used for drawing.
clipRectangeRectangleThe clipping rectangle for the paint operation.
anglefloatThe element's rotation angle.
scaleSizeFThe scale applied to the element.
Overrides:
Removes a range spanning text blocks while retaining text before and after the range, and identifies where editing can continue.
protected virtual ITextBlock RemoveBlockRange(ITextBlock startBlock, int startCharPosition, ITextBlock endBlock, int endCharPosition, ref int position)
The block containing the beginning of the range.
startCharPositionintThe character position where removal begins.
endBlockITextBlockThe block containing the end of the range.
endCharPositionintThe character position where removal ends.
positionintReceives the insertion position within the returned block, or -1 when no block remains.
Returns:The editable block adjacent to the removed range, or null when no block remains.
Replaces the text ranged with a new text
public bool Replace(TextPosition startPosition, TextPosition endPosition, string text)
The start position.
endPositionTextPositionThe end position.
textstringThe text.
Returns:Replaces the text ranged with a new text
protected virtual void ReplaceOverride(TextPosition startPosition, TextPosition endPosition, string text)
The start position.
endPositionTextPositionThe end position.
textstringThe text.
Replaces the text range in concrete special ITextBlock
protected virtual void ReplaceSpecialTextBlock(ITextBlock targetBlock, int startCharPosition, int endCharPosition, string text)
The target block.
startCharPositionintThe start char position.
endCharPositionintThe end char position.
textstringThe text.
Replaces the text range in concrete non-special ITextBlock
protected virtual void ReplaceTextBlock(ITextBlock targetBlock, int startCharPosition, int endCharPosition, string text)
The target block.
startCharPositionintThe start char position.
endCharPositionintThe end char position.
textstringThe text.
Replaces the text range in ITextBlock
protected virtual void ReplaceTextRange(ITextBlock targetBlock, int startCharPosition, int endCharPosition, string text)
The target block.
startCharPositionintThe start char position.
endCharPositionintThe end char position.
textstringThe text.