Class RichTextBoxBase
Base class for all rich text box controls which can gather text input from the user and present text in highly formatted and stylized way.
Implements
Namespace: FlaxEngine.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
public abstract class RichTextBoxBase : TextBoxBase, IComparable, IDrawable
Constructors
RichTextBoxBase()
Fields
_textBlocks
The text blocks.
Declaration
protected List<TextBlock> _textBlocks
Field Value
System.
|
Methods
DrawSelf()
Draws the control.
Declaration
public override void DrawSelf()
Overrides
GetCharPosition(Int32, out Single)
Calculates character position for given character index.
Declaration
public override Float2 GetCharPosition(int index, out float height)
Parameters
System. The text position to get it's coordinates. |
System. The character height (at the given character position). |
Returns
Float2
The character position (upper left corner which can be used for a caret position). |
Overrides
GetNearestTextBlock(Int32, out TextBlock, Boolean)
Gets the text block or the nearest text block of the character at the given index.
Declaration
public bool GetNearestTextBlock(int index, out TextBlock result, bool snapToNext = false)
Parameters
System. The character index. |
Text The result text block descriptor. |
System. If true, when the index is between two text blocks, it will return the next block. |
Returns
System. True if a text block is found, otherwise false. |
GetTextBlock(Int32, out TextBlock)
Gets the text block of the character at the given index.
Declaration
public bool GetTextBlock(int index, out TextBlock result)
Parameters
System. The character index. |
Text The result text block descriptor. |
Returns
System. True if got text block, otherwise false. |
GetTextSize()
Calculates total text size. Called by On
Declaration
public override Float2 GetTextSize()
Returns
Float2
The total text size. |
Overrides
HitTestText(Float2)
Calculates hit character index at given location.
Declaration
public override int HitTestText(Float2 location)
Parameters
Float2
location
The location to test. |
Returns
System. The selected character position index (can be equal to text length if location is outside of the layout rectangle). |
Overrides
OnDestroy()
Method called when managed instance should be destroyed
Declaration
public override void OnDestroy()
Overrides
OnMouseDoubleClick(Float2, MouseButton)
When mouse double clicks over control's area
Declaration
public override bool OnMouseDoubleClick(Float2 location, MouseButton button)
Parameters
Float2
location
Mouse location in Control Space |
Mouse Mouse buttons state (flags) |
Returns
System. True if event has been handled, otherwise false |
Overrides
OnParseTextBlocks()
Called when text blocks needs to be updated from the current text.
Declaration
protected virtual void OnParseTextBlocks()
OnTextChanged()
Action called when text gets modified.
Declaration
protected override void OnTextChanged()
Overrides
SetSelection(Int32, Int32, Boolean)
Sets the selection.
Declaration
protected override void SetSelection(int start, int end, bool withScroll = true)
Parameters
System. The selection start character. |
System. The selection end character. |
System. If set to |
Overrides
UpdateTextBlocks()
Updates the text blocks.
Declaration
public virtual void UpdateTextBlocks()