Class TextView | Terminal.Gui v2 (original) (raw)
Namespace
Assembly
Terminal.Gui.dll
Multi-line text editing View.
public class TextView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Inheritance
TextView
Implements
Inherited Members
Constructors
Initializes a TextView on the specified area, with dimensions controlled with the X, Y, Width and Height properties.
Properties
Gets or sets whether pressing ENTER in a TextView creates a new line of text in the view or invokes the Accepting event.
Gets or sets whether the TextView inserts a tab character into the text or ignores tab input. If set to false
and the user presses the tab key (or shift-tab) the focus will move to the next view (or previous with shift-tab). The default is true
; if the user presses the tab key, a tab character will be inserted into the text.
Provides autocomplete context menu based on suggestions at the current cursor position. ConfigureSuggestionGenerator to enable this feature
Get the Context Menu.
Gets the cursor column.
Gets the current cursor row.
Sets or gets the current cursor position.
Indicates whatever the text has history changes or not. true if the text has history changesfalse otherwise.
If true and the current Attribute is null will inherit from the previous, otherwise if false (default) do nothing. If the text is load withLoad(List) this property is automatically sets to true.
Indicates whatever the text was changed or not. true if the text was changedfalse otherwise.
Get or sets whether the user is currently selecting text.
Gets or sets the left column.
Gets the number of lines.
Gets the maximum visible length line.
Gets or sets a value indicating whether this TextView is a multiline text view.
Gets or sets whether the TextView is in read-only mode or not
Gets the selected text as List{List{Cell}}
Length of the selected text.
The selected text.
Start column position of the selected text.
Start row position of the selected text.
Gets or sets a value indicating the number of whitespace when pressing the TAB key.
Sets or gets the text in the TextView.
Gets or sets the top row.
Tracks whether the text view should be considered "used", that is, that the user has moved in the entry, so new input should be appended at the cursor position, rather than clearing the entry
Allows word wrap the to fit the available container width.
Methods
Allows clearing the Terminal.Gui.HistoryText.HistoryTextItemEventArgs items updating the original text.
Closes the contents of the stream into the TextView.
Copy the selected text to the clipboard contents.
Cut the selected text to the clipboard contents.
Deletes all text.
Deletes all the selected or a single character at left from the position of the cursor.
Deletes all the selected or a single character at right from the position of the cursor.
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
FindNextText(string, out bool, bool, bool, string?, bool)
Find the next text based on the match case with the option to replace it.
FindPreviousText(string, out bool, bool, bool, string?, bool)
Find the previous text based on the match case with the option to replace it.
Reset the flag to stop continuous find.
Gets all lines of characters.
Returns the characters on the current line (where the cursor is positioned). Use CurrentColumnto determine the position of the cursor within that line
Returns the characters on the line
.
Determines the current ColorScheme based on the Enabled value.
Inserts the given toAdd
text at the current cursor position exactly as if the user had just typed it
Loads the contents of the list of Cell list into the TextView.
Loads the contents of the Cell list into the TextView.
Loads the contents of the stream into the TextView.
Loads the contents of the file into the TextView.
Will scroll the TextView to the last line and position the cursor there.
Will scroll the TextView to the first line and position the cursor there.
Called when the contents of the TextView change. E.g. when the user types text or deletes text. Raises theContentsChanged event.
OnDrawNormalColor(List, int, int)
Sets the Driver to an appropriate color for rendering the given idxCol
of the current line
. Override to provide custom coloring by callingSetAttribute(Attribute) Defaults to Normal.
OnDrawReadOnlyColor(List, int, int)
Sets the Driver to an appropriate color for rendering the given idxCol
of the current line
. Override to provide custom coloring by callingSetAttribute(Attribute) Defaults to Focus.
OnDrawSelectionColor(List, int, int)
Sets the Driver to an appropriate color for rendering the given idxCol
of the current line
. Override to provide custom coloring by callingSetAttribute(Attribute) Defaults to Focus.
OnDrawUsedColor(List, int, int)
Sets the Driver to an appropriate color for rendering the given idxCol
of the current line
. Override to provide custom coloring by callingSetAttribute(Attribute) Defaults to HotFocus.
Called when the View's content is to be drawn. The default implementation does nothing.
OnHasFocusChanged(bool, View?, View?)
Invoked after HasFocus has changed. This method is called before the HasFocusChangedevent is raised.
Called when the user presses a key, allowing subscribers to pre-process the key down event. Called before key bindings are invoked and KeyDownNotHandled is raised. SetHandledto true to stop the key from being processed further.
Called when the user has pressed key it wasn't handled by KeyDown and was not bound to a key binding.
Called when a key is released. This method is called from NewKeyUpEvent(Key).
Called when a mouse event occurs within the view's Viewport.
OnUnwrappedCursorPosition(int?, int?)
Invoke the UnwrappedCursorPosition event with the unwrapped CursorPosition.
Paste the clipboard contents into the current selected position.
Positions the cursor on the current row and column
Open a dialog to set the foreground and background colors.
Redoes the latest changes.
ReplaceAllText(string, bool, bool, string?)
Replaces all the text based on the match case.
Will scroll the TextView to display the specified row at the top if isRow
is true or will scroll the TextView to display the specified column at the left ifisRow
is false.
Select all text.
Sets the driver to the default color for the control where no text is being rendered. Defaults toNormal.
Undoes the latest changes.
Events
Raised when the contents of the TextView are changed.
Invoked when the normal color is drawn.
Invoked when the ready only color is drawn.
Invoked when the selection color is drawn.
Invoked when the used color is drawn. The Used Color is used to indicate if the InsertCharwas pressed and enabled.
Invoked with the unwrapped CursorPosition.