Table of Contents

Interface IRichTextBox

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Provides access to the RichTextBox methods and properties.

public interface IRichTextBox : ISimpleRichTextBox

Properties

HasBorder

Gets or sets a value indicating whether the control has a border.

Methods

AppendText(string)

Sets the insertion point to the end of the buffer and writes the text.

ApplyAlignmentToSelection(TextBoxTextAttrAlignment)

Applies the given alignment to the selection or the default style (undoable).

ApplyBoldToSelection()

Apples bold to the selection or default style (undoable).

ApplyItalicToSelection()

Applies italic to the selection or default style (undoable).

ApplyStyleToSelection(ITextBoxRichAttr, RichTextSetStyleFlags)

Sets specified style to the selection.

ApplyTextEffectToSelection(TextBoxTextAttrEffects)

Applies one or more TextBoxTextAttrEffects flags to the selection (undoable). If there is no selection, it is applied to the default style.

ApplyUnderlineToSelection()

Applies underline to the selection or default style (undoable).

BatchingUndo()

Returns true if undo commands are being batched.

BeginAlignment(TextBoxTextAttrAlignment)

Begins using alignment.

BeginBatchUndo(string)

Starts batching undo history for commands.

BeginBold()

Begins using bold.

BeginCharacterStyle(string)

Begins using the named character style.

BeginFont(Font?)

Begins using this font.

BeginFontSize(double)

Begins using the given point size.

BeginFontSize(int)

Begins using the given point size.

BeginItalic()

Begins using italic.

BeginLeftIndent(int, int)

Begins applying a left indent and subindent in tenths of a millimetre.

BeginLineSpacing(int)

Begins applying line spacing.

BeginListStyle(string, int, int)

Begins using a specified list style. Optionally, you can also pass a level and a number.

BeginNumberedBullet(int, int, int, TextBoxTextAttrBulletStyle)

Begins a numbered bullet.

BeginParagraphSpacing(int, int)

Begins paragraph spacing; pass the before-paragraph and after-paragraph spacing in tenths of a millimetre.

BeginParagraphStyle(string)

Begins applying the named paragraph style.

BeginRightIndent(int)

Begins a right indent, specified in tenths of a millimetre.

BeginStandardBullet(string, int, int, TextBoxTextAttrBulletStyle)

Begins applying a symbol bullet.

BeginStyle(ITextBoxRichAttr)

Begins applying a style.

BeginSuppressUndo()

Starts suppressing undo history for commands.

BeginSymbolBullet(string, int, int, TextBoxTextAttrBulletStyle)

Begins applying a symbol bullet, using a character from the current font. See BeginNumberedBullet(int, int, int, TextBoxTextAttrBulletStyle) for an explanation of how indentation is used to render the bulleted paragraph.

BeginTextColor(Color)

Begins using this color.

BeginURL(string, string?)

Begins applying Url to the content. Pass a URL and optionally, a character style to apply, since it is common to mark a URL with a familiar style such as blue text with underlining.

BeginUnderline()

Begins using underlining.

CanCopy()

Returns true if selected content can be copied to the clipboard.

CanCut()

Returns true if selected content can be copied to the clipboard and deleted.

CanDeleteSelection()

Returns true if selected content can be deleted.

CanPaste()

Returns true if the clipboard content can be pasted to the buffer.

CanRedo()

Returns true if there is a command in the command history that can be redone.

CanUndo()

Returns true if there is a command in the command history that can be undone.

Clear()

Clears the buffer content, leaving a single empty paragraph. Cannot be undone.

ClearListStyle(long, long, RichTextSetStyleFlags)

Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph.

Copy()

Copies the selected content (if any) to the clipboard.

CreateRichAttr()

Creates new custom rich text style.

CreateTextAttr()

Creates text attributes object.

CreateUrlAttr()

Creates default style for the urls.

Cut()

Copies the selected content (if any) to the clipboard and deletes the selection. This is undoable.

Delete(long, long)

Deletes the content within the given range.

DeleteSelectedContent()

Deletes content if there is a selection, e.g. when pressing a key. Returns the new caret position in @e newPos, or leaves it if there was no action. This is undoable.

DeleteSelection()

Deletes the content in the selection, if any. This is undoable.

DiscardEdits()

Sets the buffer's modified status to false, and clears the buffer's command history.

DoWriteText(string, TextBoxSetValueFlags)

Writes text.

DoesSelectionHaveTextEffectFlag(TextBoxTextAttrEffects)

Returns true if all of the selection, or the content at the current caret position, has the supplied effects flag(s).

EnableDelayedImageLoading(bool)

Enable or disable delayed image loading.

EnableImages(bool)

Enable or disable images.

EnableVerticalScrollbar(bool)

Enable or disable the vertical scrollbar.

EnableVirtualAttributes(bool)

Pass true to let the control use attributes. The default is false.

EndAlignment()

Ends alignment.

EndAllStyles()

Ends application of all styles in the current style stack.

EndBatchUndo()

Ends batching undo command history.

EndBold()

Ends using bold.

EndCharacterStyle()

Ends application of a named character style.

EndFont()

Ends using a font.

EndFontSize()

Ends using a point size.

EndItalic()

Ends using italic.

EndLeftIndent()

Ends left indent.

EndLineSpacing()

Ends line spacing.

EndListStyle()

Ends using a specified list style.

EndNumberedBullet()

Ends application of a numbered bullet.

EndParagraphSpacing()

Ends paragraph spacing.

EndParagraphStyle()

Ends application of a named paragraph style.

EndRightIndent()

Ends right indent.

EndStandardBullet()

Begins applying a standard bullet.

EndStyle()

Ends the current style.

EndSuppressUndo()

Ends suppressing undo command history.

EndSymbolBullet()

Ends applying a symbol bullet.

EndTextColor()

Ends applying a text color.

EndURL()

Ends applying a URL.

EndUnderline()

End applying underlining.

ExtendSelection(long, long, RichTextMoveCaretFlags)

Helper function for extending the selection, returning true if the selection was changed. Selections are in caret positions.

FindNextWordPosition(int)

Helper function for finding the caret position for the next word. Direction is 1 (forward) or -1 (backwards).

ForceDelayedLayout()

Forces any pending layout due to delayed, partial layout when the control was resized.

GetAdjustedCaretPosition(long)

Gets the adjusted caret position.

GetBasicStyle()

Gets the basic (overall) style.

GetCaretAtLineStart()

Returns true if we are showing the caret position at the start of a line instead of at the end of the previous one.

GetCaretPosition()

Returns the current caret position.

GetCaretPositionForDefaultStyle()

Returns the caret position since the default formatting was changed. As soon as this position changes, we no longer reflect the default style in the UI. A value of -2 means that we should only reflect the style of the content under the caret.

GetDefaultStyleEx()

Returns the current default style, which can be used to change how subsequently inserted text is displayed.

GetDelayedImageLoading()

Returns true if delayed image loading is enabled.

GetDelayedImageProcessingRequired()

Gets the flag indicating that delayed image processing is required.

GetDelayedImageProcessingTime()

Returns the last time delayed image processing was performed.

GetDelayedLayoutThreshold()

Gets the size of the buffer beyond which layout is delayed during resizing. This optimizes sizing for large buffers. The default is 20000.

GetDragging()

Returns true if we are dragging a selection.

GetFileHandlerFlags()

Returns flags that change the behaviour of loading or saving. See the documentation for each handler class to see what flags are relevant for each handler.

GetFileName()

Gets name of the file loaded into the control.

GetFirstVisiblePoint()

Returns the first visible point in the control.

GetFirstVisiblePosition()

Returns the first visible position in the current view.

GetFontScale()

Returns the scale factor for displaying fonts, for example for more comfortable editing.

GetFullLayoutRequired()

Gets the flag indicating that full layout is required.

GetFullLayoutSavedPosition()

Returns the position that should be shown when full (delayed) layout is performed.

GetFullLayoutTime()

Returns the last time full layout was performed.

GetImagesEnabled()

Returns true if images are enabled.

GetInsertionPoint()

Returns the current insertion point.

GetLastPosition()

Returns the last position in the buffer.

GetLineHeight()

Gets the line increment height in pixels.

GetLineLength(long)

Returns the length of the specified line in characters.

GetLineText(long)

Returns the text for the given line.

GetLogicalPoint(PointI)

Transforms physical window position to logical (unscrolled) position.

GetNumberOfLines()

Returns the number of lines in the buffer.

GetPhysicalPoint(PointI)

Transforms logical (unscrolled) position to physical window position.

GetRange(long, long)

Returns the string containing the text starting in the positions from and up to to in the control.

GetRichStyle(long)

Gets the attributes at the given position.

GetRichStyleForRange(long, long)

Gets the attributes common to the specified range. Attributes that differ in value within the range will not be included in style flags.

GetSelectionAnchor()

Returns an anchor so we know how to extend the selection. It's a caret position since it's between two characters.

GetStringSelection()

Returns the text within the current selection range, if any.

GetStyle(long)

Gets the attributes at the given position.

GetStyleForRange(long, long)

Gets the attributes common to the specified range. Attributes that differ in value within the range will not be included in style flags.

GetTextCursor()

Returns the text (normal) cursor.

GetURLCursor()

Returns the cursor to be used over URLs.

GetValue()

Returns the content of the entire control as a string.

GetVerticalScrollbarEnabled()

Returns true if the vertical scrollbar is enabled.

GetVirtualAttributesEnabled()

Returns true if this control can use attributes and text. The default is false.

HasParagraphAttributes(long, long, ITextBoxRichAttr)

Test if this whole range has paragraph attributes of the specified kind.

HasSelection()

Returns true if there is a selection and the object containing the selection was the same as the current focus object.

HasUnfocusedSelection()

Returns true if there was a selection, whether or not the current focus object is the same as the selection's container object.

IsDefaultStyleShowing()

Returns true if the user has recently set the default style without moving the caret, and therefore the UI needs to reflect the default style and not the style at the caret.

IsEditable()

Returns true if the control is editable.

IsModified()

Returns true if the buffer has been modified.

IsMultiLine()

Returns true if the control is multiline.

IsPositionVisible(long)

Returns true if the given position is visible on the screen.

IsSelectionAligned(TextBoxTextAttrAlignment)

Returns true if all of the selection, or the content at the caret position, is aligned according to the specified flag.

IsSelectionBold()

Returns true if all of the selection, or the content at the caret position, is bold.

IsSelectionItalics()

Returns true if all of the selection, or the content at the caret position, is italic.

IsSelectionUnderlined()

Returns true if all of the selection, or the content at the caret position, is underlined.

IsSingleLine()

Returns true if the control is single-line. Currently RichTextBox does not support single-line editing.

LayoutContent(bool)

Lays out the buffer, which must be done before certain operations, such as setting the caret position. This function should not normally be required by the application.

LineBreak()

Inserts a line break at the current insertion point. A line break forces wrapping within a paragraph, and can be introduced by using this function or by typing Shift-Return.

LoadFromFile(string, RichTextFileType)

Loads content into the control's buffer using the given type.

LoadFromStream(Stream, RichTextFileType)

Loads the buffer content from Stream using the given data type.

MarkDirty()

Marks the buffer as modified.

MoveCaretBack(long)

Move the caret one visual step forward: this may mean setting a flag and keeping the same position if we're going from the end of one line to the start of the next, which may be the exact same caret position.

MoveCaretForward(long)

Move the caret one visual step forward: this may mean setting a flag and keeping the same position if we're going from the end of one line to the start of the next, which may be the exact same caret position.

MoveDown(int, RichTextMoveCaretFlags)

Moves the caret down.

MoveEnd(RichTextMoveCaretFlags)

Moves to the end of the buffer.

MoveHome(RichTextMoveCaretFlags)

Moves to the start of the buffer.

MoveLeft(int, RichTextMoveCaretFlags)

Moves left.

MoveRight(int, RichTextMoveCaretFlags)

Moves right.

MoveToLineEnd(RichTextMoveCaretFlags)

Moves to the end of the line.

MoveToLineStart(RichTextMoveCaretFlags)

Moves to the start of the line.

MoveToParagraphEnd(RichTextMoveCaretFlags)

Moves to the end of the paragraph.

MoveToParagraphStart(RichTextMoveCaretFlags)

Moves to the start of the paragraph.

MoveUp(int, RichTextMoveCaretFlags)

Moves to the start of the paragraph.

NewLine()

Inserts new paragraphs at the current insertion point. See LineBreak().

NumberList(long, long, string, RichTextSetStyleFlags, int, int)

Numbers the paragraphs in the given range.

PageDown(int, RichTextMoveCaretFlags)

Moves one or more pages down.

PageUp(int, RichTextMoveCaretFlags)

Moves one or more pages up.

Paste()

Pastes content from the clipboard to the buffer.

PositionToXY(long)

Converts a text position to zero-based column and line numbers.

ProcessDelayedImageLoading(bool)

Does delayed image loading and garbage-collect other images.

PromoteList(int, long, long, string, RichTextSetStyleFlags, int)

Promotes or demotes the paragraphs in the given range.

Redo()

Redoes the current command.

Remove(long, long)

Removes the content in the specified range.

Replace(long, long, string)

Replaces the content in the specified range with the string specified by @a value.

RequestDelayedImageProcessing()

Requests delayed image processing.

SaveToFile(string, RichTextFileType)

Saves the buffer content using the given type.

SaveToStream(Stream, RichTextFileType)

Saves the buffer content to Stream using the given data type.

SelectNone()

Cancels any selection.

SelectWord(long)

Selects the word at the given character position.

SetAndShowDefaultStyle(ITextBoxRichAttr)

Sets attr as the default style and tells the control that the UI should reflect this attribute until the user moves the caret.

SetBasicStyle(ITextBoxRichAttr)

Sets the basic (overall) style.

SetCaretAtLineStart(bool)

Sets a flag to remember that we are showing the caret position at the start of a line instead of at the end of the previous one.

SetCaretPosition(long, bool)

Sets the caret position.

SetCaretPositionForDefaultStyle(long)

Set the caret position for the default style that the user is selecting.

SetDefaultRichStyle(ITextBoxRichAttr)

Sets the current default style, which can be used to change how subsequently inserted text is displayed.

SetDefaultStyle(ITextBoxTextAttr)

Sets the current default style, which can be used to change how subsequently inserted text is displayed.

SetDefaultStyleToCursorStyle()

Sets the default style to the style under the cursor.

SetDelayedImageProcessingRequired(bool)

Sets the flag indicating that delayed image processing is required.

SetDelayedImageProcessingTime(long)

Sets the last time delayed image processing was performed.

SetDelayedLayoutThreshold(long)

Sets the size of the buffer beyond which layout is delayed during resizing. This optimizes sizing for large buffers. The default is 20000.

SetDragging(bool)

Sets a flag to remember if we are dragging a selection.

SetEditable(bool)

Makes the control editable, or not.

SetFileHandlerFlags(RichTextHandlerFlags, int)

Sets flags that change the behaviour of loading or saving. See the documentation for each handler class to see what flags are relevant for each handler.

SetFileName(string)

Sets name of the file loaded into the control.

SetFontScale(double, bool)

Sets the scale factor for displaying fonts, for example for more comfortableediting.

SetFullLayoutRequired(bool)

Sets the flag indicating that full layout is required.

SetFullLayoutSavedPosition(long)

Sets the position that should be shown when full (delayed) layout is performed.

SetFullLayoutTime(long)

Sets the last time full layout was performed.

SetInsertionPointEnd()

Sets the insertion point to the end of the text control.

SetLineHeight(int)

Sets the line increment height in pixels.

SetListStyle(long, long, string, RichTextSetStyleFlags, int, int)

Sets the list attributes for the given range, passing flags to determine how the attributes are set.

SetMaxLength(ulong)

Sets the maximum number of characters that may be entered in a single line text control. For compatibility only; currently does nothing.

SetRichStyle(long, long, ITextBoxRichAttr)

Sets the attributes for the given range.

SetSelection(long, long)

Sets the selection to the given range. The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the selection for a character at position 5, use the range (5,6).

SetSelectionAnchor(long)

Sets an anchor so we know how to extend the selection. It's a caret position since it's between two characters.

SetSelectionRange(long, long)

Sets the selection to the given range. The end point of range is specified as the last character position of the span of text, plus one. So, for example, to set the selection for a character at position 5, use the range (5,6).

SetStyle(long, long, ITextBoxTextAttr)

Sets the attributes for the given range.

SetStyleEx(long, long, ITextBoxRichAttr, RichTextSetStyleFlags)

Sets the attributes for the given range, passing flags to determine how the attributes are set.

SetTextCursor(Cursor?)

Sets the text (normal) cursor.

SetURLCursor(Cursor?)

Sets the cursor to be used over URLs.

SetValue(string)

Replaces existing content with the given text.

SuppressingUndo()

Returns true if undo history suppression is on.

Undo()

Undoes the command at the top of the command history, if there is one.

WordLeft(int, RichTextMoveCaretFlags)

Moves a number of words to the left.

WordRight(int, RichTextMoveCaretFlags)

Move a number of words to the right.

WriteImage(Image?, BitmapType, ITextBoxRichAttr?)

Writes a bitmap at the current insertion point. Supply an optional type to use for internal and file storage of the raw data.

WriteImage(string, BitmapType, ITextBoxRichAttr?)

Loads an image from a file and writes it at the current insertion point.

WriteTable(int, int, ITextBoxRichAttr?, ITextBoxRichAttr?)

Write a table at the current insertion point, returning the table.

WriteText(string)

Writes text at the current position.