Search Results for

    Show / Hide Table of Contents

    Class ScrollView

    Scrollviews are views that present a window into a virtual space where subviews are added. Similar to the iOS UIScrollView.
    Inheritance
    object
    Responder
    View
    ScrollView
    Implements
    IDisposable
    ISupportInitializeNotification
    ISupportInitialize
    Inherited Members
    View.Added
    View.Removed
    View.Enter
    View.Leave
    View.MouseEnter
    View.MouseLeave
    View.MouseClick
    View.CanFocusChanged
    View.EnabledChanged
    View.VisibleChanged
    View.HotKeyChanged
    View.HotKey
    View.HotKeySpecifier
    View.Shortcut
    View.ShortcutTag
    View.ShortcutAction
    View.Data
    View.Driver
    View.Subviews
    View.TabIndexes
    View.TabIndex
    View.TabStop
    View.CanFocus
    View.Id
    View.IsCurrentTop
    View.WantMousePositionReports
    View.WantContinuousButtonPressed
    View.Frame
    View.LayoutStyle
    View.Bounds
    View.X
    View.Y
    View.Width
    View.Height
    View.ForceValidatePosDim
    View.GetMinWidthHeight(out Size)
    View.SetMinWidthHeight()
    View.TextFormatter
    View.SuperView
    View.UpdateTextFormatterText()
    View.ProcessResizeView()
    View.SetNeedsDisplay()
    View.ClearLayoutNeeded()
    View.SetNeedsDisplay(Rect)
    View.SetChildNeedsDisplay()
    View.Add(params View[])
    View.BringSubviewToFront(View)
    View.SendSubviewToBack(View)
    View.SendSubviewBackwards(View)
    View.BringSubviewForward(View)
    View.Clear()
    View.Clear(Rect)
    View.ScreenToView(int, int)
    View.ClipToBounds()
    View.SetClip(Rect)
    View.DrawFrame(Rect, int, bool)
    View.DrawHotString(ustring, Attribute, Attribute)
    View.DrawHotString(ustring, bool, ColorScheme)
    View.Move(int, int, bool)
    View.HasFocus
    View.OnAdded(View)
    View.OnRemoved(View)
    View.OnLeave(View)
    View.Focused
    View.MostFocused
    View.ColorScheme
    View.AddRune(int, int, Rune)
    View.ClearNeedsDisplay()
    View.DrawContent
    View.OnDrawContent(Rect)
    View.DrawContentComplete
    View.OnDrawContentComplete(Rect)
    View.SetFocus()
    View.KeyPress
    View.InvokeKeybindings(KeyEvent)
    View.AddKeyBinding(Key, params Command[])
    View.ReplaceKeyBinding(Key, Key)
    View.ContainsKeyBinding(Key)
    View.ClearKeybindings()
    View.ClearKeybinding(Key)
    View.ClearKeybinding(params Command[])
    View.AddCommand(Command, Func<bool?>)
    View.GetSupportedCommands()
    View.GetKeyFromCommand(params Command[])
    View.ProcessHotKey(KeyEvent)
    View.ProcessColdKey(KeyEvent)
    View.KeyDown
    View.OnKeyDown(KeyEvent)
    View.KeyUp
    View.OnKeyUp(KeyEvent)
    View.EnsureFocus()
    View.FocusFirst()
    View.FocusLast()
    View.FocusPrev()
    View.FocusNext()
    View.LayoutStarted
    View.LayoutComplete
    View.Initialized
    View.LayoutSubviews()
    View.Text
    View.AutoSize
    View.PreserveTrailingSpaces
    View.TextAlignment
    View.VerticalTextAlignment
    View.TextDirection
    View.IsInitialized
    View.IsAdded
    View.Enabled
    View.ClearOnVisibleFalse
    View.Visible
    View.Border
    View.IgnoreBorderPropertyOnRedraw
    View.ToString()
    View.GetAutoSize()
    View.GetHotKeySpecifierLength(bool)
    View.GetTextFormatterBoundsSize()
    View.GetBoundsTextFormatterSize()
    View.OnMouseEnter(MouseEvent)
    View.OnMouseLeave(MouseEvent)
    View.OnMouseEvent(MouseEvent)
    View.OnMouseClick(View.MouseEventArgs)
    View.OnCanFocusChanged()
    View.OnEnabledChanged()
    View.OnVisibleChanged()
    View.BeginInit()
    View.EndInit()
    View.SetWidth(int, out int)
    View.SetHeight(int, out int)
    View.GetCurrentWidth(out int)
    View.GetCurrentHeight(out int)
    View.GetNormalColor()
    View.GetFocusColor()
    View.GetHotNormalColor()
    View.GetTopSuperView()
    Responder.Dispose()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, 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

    | Edit this page View Source

    ScrollView()

    Initializes a new instance of the ScrollView class using Computed positioning.
    Declaration
    public ScrollView()
    | Edit this page View Source

    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

    | Edit this page View Source

    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
    bool
    | Edit this page View Source

    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.
    | Edit this page View Source

    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.
    | Edit this page View Source

    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
    bool
    | Edit this page View Source

    ShowHorizontalScrollIndicator

    Gets or sets the visibility for the horizontal scroll indicator.
    Declaration
    public bool ShowHorizontalScrollIndicator { get; set; }
    Property Value
    Type Description
    bool true if show horizontal scroll indicator; otherwise, false.
    | Edit this page View Source

    ShowVerticalScrollIndicator

    Gets or sets the visibility for the vertical scroll indicator.
    Declaration
    public bool ShowVerticalScrollIndicator { get; set; }
    Property Value
    Type Description
    bool true if show vertical scroll indicator; otherwise, false.

    Methods

    | Edit this page View Source

    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
    View.Add(View)
    | Edit this page View Source

    Dispose(bool)

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing
    Overrides
    View.Dispose(bool)
    Remarks
    If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed.
    | Edit this page View Source

    MouseEvent(MouseEvent)

    Method invoked when a mouse event is generated
    Declaration
    public override bool MouseEvent(MouseEvent me)
    Parameters
    Type Name Description
    MouseEvent me
    Returns
    Type Description
    bool true, if the event was handled, false otherwise.
    Overrides
    Responder.MouseEvent(MouseEvent)
    | Edit this page View Source

    OnEnter(View)

    Method invoked when a view gets focus.
    Declaration
    public override bool OnEnter(View view)
    Parameters
    Type Name Description
    View view The view that is losing focus.
    Returns
    Type Description
    bool true, if the event was handled, false otherwise.
    Overrides
    View.OnEnter(View)
    | Edit this page View Source

    PositionCursor()

    Positions the cursor in the right position based on the currently focused view in the chain.
    Declaration
    public override void PositionCursor()
    Overrides
    View.PositionCursor()
    | Edit this page View Source

    ProcessKey(KeyEvent)

    If the view is focused, gives the view a chance to process the keystroke.
    Declaration
    public override bool ProcessKey(KeyEvent kb)
    Parameters
    Type Name Description
    KeyEvent kb
    Returns
    Type Description
    bool
    Overrides
    View.ProcessKey(KeyEvent)
    Remarks

    Views can override this method if they are interested in processing the given keystroke. If they consume the keystroke, they must return true to stop the keystroke from being processed by other widgets or consumed by the widget engine. If they return false, the keystroke will be passed using the ProcessColdKey method to other views to process.

    The View implementation does nothing but return false, so it is not necessary to call base.ProcessKey if you derive directly from View, but you should if you derive other View subclasses.

    | Edit this page View Source

    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 region)
    Parameters
    Type Name Description
    Rect region
    Overrides
    View.Redraw(Rect)
    Remarks

    Always use Bounds (view-relative) when calling Redraw(Rect), NOT Frame (superview-relative).

    Views should set the color that they want to use on entry, as otherwise this will inherit the last color that was set globally on the driver.

    Overrides of Redraw(Rect) must ensure they do not set Driver.Clip to a clip region larger than the parameter, as this will cause the driver to clip the entire region.

    | Edit this page View Source

    Remove(View)

    Removes the view from the scrollview.
    Declaration
    public override void Remove(View view)
    Parameters
    Type Name Description
    View view The view to remove from the scrollview.
    Overrides
    View.Remove(View)
    | Edit this page View Source

    RemoveAll()

    Removes all widgets from this container.
    Declaration
    public override void RemoveAll()
    Overrides
    View.RemoveAll()
    | Edit this page View Source

    ScrollDown(int)

    Scrolls the view down.
    Declaration
    public bool ScrollDown(int lines)
    Parameters
    Type Name Description
    int lines Number of lines to scroll.
    Returns
    Type Description
    bool true, if left was scrolled, false otherwise.
    | Edit this page View Source

    ScrollLeft(int)

    Scrolls the view to the left
    Declaration
    public bool ScrollLeft(int cols)
    Parameters
    Type Name Description
    int cols Number of columns to scroll by.
    Returns
    Type Description
    bool true, if left was scrolled, false otherwise.
    | Edit this page View Source

    ScrollRight(int)

    Scrolls the view to the right.
    Declaration
    public bool ScrollRight(int cols)
    Parameters
    Type Name Description
    int cols Number of columns to scroll by.
    Returns
    Type Description
    bool true, if right was scrolled, false otherwise.
    | Edit this page View Source

    ScrollUp(int)

    Scrolls the view up.
    Declaration
    public bool ScrollUp(int lines)
    Parameters
    Type Name Description
    int lines Number of lines to scroll.
    Returns
    Type Description
    bool true, if left was scrolled, false otherwise.

    Implements

    IDisposable
    ISupportInitializeNotification
    ISupportInitialize
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX