TextBoxWrapPanel
The wrap layout of RadTextBoxControlElement
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class TextBoxWrapPanel : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, INotifyPropertyChangingEx
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementTextBoxWrapPanel...
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the TextBoxWrapPanel class.
public TextBoxWrapPanel()
Fields
public const char CarriageReturnSymbol = '\r'
public const char LineFeedSymbol = '\n'
protected static readonly Type TextBlockElementType
Properties
Gets the logical lines of TextBoxWrapPanel.
public LineInfoCollection Lines { get; }
Gets or sets the spacing between lines when the TextBoxWrapPanel is in multiline mode.
public int LineSpacing { get; set; }
The line spacing.
Gets or sets a value indicating whether this TextBoxWrapPanel is multiline.
public bool Multiline { get; set; }
true if multiline; otherwise, false.
Gets or sets the text displayed by this item.
public override string Text { get; set; }
The text content of the item. The default value is an empty string.
Overrides:
This property supports data binding and localization. The text can contain HTML markup when the HTML support is enabled for the containing control. Changes to this property will trigger layout updates and repainting of the item.
Gets or sets how the text is horizontally aligned in the element.
public HorizontalAlignment TextAlign { get; set; }
The horizontal text alignment.
Gets the length of the text.
public int TextLength { get; }
The length of the text.
Gets the bounds of the Viewport
public Rectangle ViewportBounds { get; }
Methods
Checks that tow block are splitted block
protected virtual bool AreSplittedBlock(ITextBlock firstBlock, ITextBlock secondBlock)
The first block.
secondBlockITextBlockThe second block.
Returns:Arranges the content and child elements within the final allocated space, positioning text, images, and child elements.
Clears the presented text
public void Clear()
protected virtual LineInfo CreateNewLine(ITextBlock block, ref SizeF desiredSize, ref int lineIndex)
Gets the baseline offset.
protected virtual float GetBaselineOffset(LineInfo line, ITextBlock textBlock)
The line.
textBlockITextBlockThe text block.
Returns:Gets the block's text.
protected virtual string GetBlockText(ITextBlock block, int start, int length)
The block.
startintThe start.
lengthintThe length.
Returns:Gets the next block for this index
Gets the previous block for this index
Gets the text between start and end position
public string GetTextRange(TextPosition startPosition, TextPosition endPosition)
The start position.
endPositionTextPositionThe end position.
Returns:Determines whether this panel has text.
Initializes the internal fields and components of the LightVisualElement. This method sets up text primitives, image primitives, and layout management components.
protected override void InitializeFields()
Overrides:
Performs measurement and arrangement of child elements.
protected void InvalidateLayout()
Measures the desired size of the element by calculating the space needed for content, padding, and borders.
protected void MeasureTextBlock(ITextBlock textBlock, SizeF availableSize)
protected virtual void MeasureTextBlockOverride(ITextBlock textBlock, SizeF availableSize)
Measures and perfroms wrapping for blocks in WordWrap mode
protected virtual bool MeasureWrap(SizeF availableSize, int blockIndex, ref SizeF desiredSize, ref int currentLineIndex, ref int offset)
The available size.
blockIndexintIndex of the current block.
desiredSizeSizeFDocument desired size.
currentLineIndexintIndex of the current line.
offsetintThe current block offset.
Returns:Merge and measure block.
protected virtual void MergeAndMeasureBlock(ITextBlock textBlock, SizeF availableSize)
The text block.
availableSizeSizeFThe available size.
protected ITextBlock NotifyCreateTextBlock(ITextBlock block, string text)
Notifies the text changed.
protected virtual void NotifyTextChanged(string text, int caretPosition, TextBoxChangeAction action)
The text.
caretPositionintThe caret position.
actionTextBoxChangeActionThe action.
Notifies the text changing.
protected virtual bool NotifyTextChanging(int startPosition, int length, string oldText, string newText, TextBoxChangeAction action)
The start position.
lengthintThe length.
oldTextstringThe old text.
newTextstringThe new text.
actionTextBoxChangeActionThe action.
Returns:Raises the event.
protected virtual void OnCreateTextBlock(CreateTextBlockEventArgs e)
The CreateTextBlockEventArgs instance containing the event data.
Raises the event.
protected virtual void OnPropertyChanging(PropertyChangingEventArgsEx e)
The PropertyChangingEventArgs instance containing the event data.
Called when text block is formatting.
protected void OnTextBlockFormatting(ITextBlock textBlock)
The text block.
Raises the event.
protected virtual void OnTextBlockFormatting(TextBlockFormattingEventArgs e)
The TextBlockFormattingEventArgs instance containing the event data.
Raises the TextChanged event.
Renders the text content of the element, including horizontal line effects when enabled.
protected override void PaintText(IGraphics graphics)
The graphics context used for rendering text.
Overrides:
protected virtual bool SplitBlock(LineInfo currentLine, SizeF availableSize, ref ITextBlock textBlock, ref int offset)
Toggles the text primitive when text related properties are change.
protected override void ToggleTextPrimitive(RadProperty property)
The changed property.
Overrides:
Events
Occurs when an instance of ITextBlock is created
public event CreateTextBlockEventHandler CreateTextBlock
Occurs when a property value is changing.
public event PropertyChangingEventHandlerEx PropertyChanging
Implements:
Occurs when text block is formatting.
public event TextBlockFormattingEventHandler TextBlockFormatting