Class TextView
Multi-line text editing
View
Inheritance
System.Object
TextView
Implements
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Terminal.Gui.dll
Syntax
public class TextView : View, IEnumerable
Constructors
TextView()
Initalizes a
TextView on the specified area,
with dimensions controlled with the X, Y, Width and Height properties.
Declaration
TextView(Rect)
Initalizes a
TextView on the specified area, with absolute position and size.
Declaration
public TextView(Rect frame)
Parameters
Type |
Name |
Description |
Rect |
frame |
|
Properties
CanFocus
Gets or sets a value indicating whether this
Responder can focus.
Declaration
public override bool CanFocus { get; set; }
Property Value
Type |
Description |
System.Boolean |
true if can focus; otherwise, false . |
Overrides
CurrentColumn
Gets the cursor column.
Declaration
public int CurrentColumn { get; }
Property Value
Type |
Description |
System.Int32 |
The cursor column. |
CurrentRow
Gets the current cursor row.
Declaration
public int CurrentRow { get; }
Property Value
Type |
Description |
System.Int32 |
|
ReadOnly
Gets or sets whether the
TextView is in read-only mode or not
Declaration
public bool ReadOnly { get; set; }
Property Value
Type |
Description |
System.Boolean |
Boolean value(Default false) |
Text
Declaration
public ustring Text { get; set; }
Property Value
Type |
Description |
NStack.ustring |
|
Methods
CloseFile()
Closes the contents of the stream into the
TextView.
Declaration
Returns
Type |
Description |
System.Boolean |
true , if stream was closed, false otherwise. |
LoadFile(String)
Loads the contents of the file into the
TextView.
Declaration
public bool LoadFile(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
Path to the file to load. |
Returns
Type |
Description |
System.Boolean |
true , if file was loaded, false otherwise. |
LoadStream(Stream)
Loads the contents of the stream into the
TextView.
Declaration
public void LoadStream(Stream stream)
Parameters
Type |
Name |
Description |
System.IO.Stream |
stream |
Stream to load the contents from. |
MouseEvent(MouseEvent)
Method invoked when a mouse event is generated
Declaration
public override bool MouseEvent(MouseEvent ev)
Parameters
Returns
Type |
Description |
System.Boolean |
true , if the event was handled, false otherwise. |
Overrides
PositionCursor()
Positions the cursor on the current row and column
Declaration
public override void PositionCursor()
Overrides
ProcessKey(KeyEvent)
If the view is focused, gives the view a
chance to process the keystroke.
Declaration
public override bool ProcessKey(KeyEvent kb)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Overrides
Redraw(Rect)
Redraws this view and its subviews; only redraws the views that have been flagged for a re-display.
Declaration
public override void Redraw(Rect bounds)
Parameters
Type |
Name |
Description |
Rect |
bounds |
The bounds (view-relative region) to redraw. |
Overrides
ScrollTo(Int32)
Will scroll the
TextView to display the specified row at the top
Declaration
public void ScrollTo(int row)
Parameters
Type |
Name |
Description |
System.Int32 |
row |
Row that should be displayed at the top, if the value is negative it will be reset to zero |
Events
TextChanged
Declaration
public event EventHandler TextChanged
Event Type
Type |
Description |
System.EventHandler |
|
Implements
System.Collections.IEnumerable