Class ScrollView
Scrollviews are views that present a window into a virtual space where subviews are added. Similar to the iOS UIScrollView.
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize
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)
Namespace: Terminal.Gui
Assembly: Terminal.Gui.dll
Syntax
public class ScrollView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Remarks
The subviews that are added to this ScrollView are offset by the ContentOffset property. The view itself is a window into the space represented by the ContentSize.
Use the
Constructors
ScrollView()
Initializes a new instance of the ScrollView class using Computed positioning.
Declaration
public ScrollView()
ScrollView(Rect)
Initializes a new instance of the ScrollView class using Absolute positioning.
Declaration
public ScrollView(Rect frame)
Parameters
Type | Name | Description |
---|---|---|
Rect | frame |
Properties
AutoHideScrollBars
If true the vertical/horizontal scroll bars won't be showed if it's not needed.
Declaration
public bool AutoHideScrollBars { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ContentOffset
Represents the top left corner coordinate that is displayed by the scrollview
Declaration
public Point ContentOffset { get; set; }
Property Value
Type | Description |
---|---|
Point | The content offset. |
ContentSize
Represents the contents of the data shown inside the scrollview
Declaration
public Size ContentSize { get; set; }
Property Value
Type | Description |
---|---|
Size | The size of the content. |
KeepContentAlwaysInViewport
Get or sets if the view-port is kept always visible in the area of this ScrollView
Declaration
public bool KeepContentAlwaysInViewport { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowHorizontalScrollIndicator
Gets or sets the visibility for the horizontal scroll indicator.
Declaration
public bool ShowHorizontalScrollIndicator { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if show horizontal scroll indicator; otherwise, false . |
ShowVerticalScrollIndicator
Gets or sets the visibility for the vertical scroll indicator.
Declaration
public bool ShowVerticalScrollIndicator { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if show vertical scroll indicator; otherwise, false . |
Methods
Add(View)
Adds the view to the scrollview.
Declaration
public override void Add(View view)
Parameters
Type | Name | Description |
---|---|---|
View | view | The view to add to the scrollview. |
Overrides
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
Overrides
MouseEvent(MouseEvent)
Declaration
public override bool MouseEvent(MouseEvent me)
Parameters
Type | Name | Description |
---|---|---|
MouseEvent | me |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
OnEnter(View)
Declaration
public override bool OnEnter(View view)
Parameters
Type | Name | Description |
---|---|---|
View | view |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
PositionCursor()
Declaration
public override void PositionCursor()
Overrides
ProcessKey(KeyEvent)
Declaration
public override bool ProcessKey(KeyEvent kb)
Parameters
Type | Name | Description |
---|---|---|
KeyEvent | kb |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Redraw(Rect)
Declaration
public override void Redraw(Rect region)
Parameters
Type | Name | Description |
---|---|---|
Rect | region |
Overrides
RemoveAll()
Removes all widgets from this container.
Declaration
public override void RemoveAll()
Overrides
Remarks
ScrollDown(Int32)
Scrolls the view down.
Declaration
public bool ScrollDown(int lines)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lines | Number of lines to scroll. |
Returns
Type | Description |
---|---|
System.Boolean | true , if left was scrolled, false otherwise. |
ScrollLeft(Int32)
Scrolls the view to the left
Declaration
public bool ScrollLeft(int cols)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | cols | Number of columns to scroll by. |
Returns
Type | Description |
---|---|
System.Boolean | true , if left was scrolled, false otherwise. |
ScrollRight(Int32)
Scrolls the view to the right.
Declaration
public bool ScrollRight(int cols)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | cols | Number of columns to scroll by. |
Returns
Type | Description |
---|---|
System.Boolean | true , if right was scrolled, false otherwise. |
ScrollUp(Int32)
Scrolls the view up.
Declaration
public bool ScrollUp(int lines)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | lines | Number of lines to scroll. |
Returns
Type | Description |
---|---|
System.Boolean | true , if left was scrolled, false otherwise. |
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize