using System;
namespace Terminal.Gui {
///
///
///
///
///
/// 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.
///
///
///
///
///
public class ScrollView : View {
public ScrollView (Rect frame) : base (frame)
{
}
Rect contentSize;
Point contentOffset;
bool showHorizontalScrollIndicator;
bool showVerticalScrollIndicator;
///
/// Represents the contents of the data shown inside the scrolview
///
/// The size of the content.
public Rect ContentSize {
get {
return contentSize;
}
set {
contentSize = value;
}
}
///
/// Represents the top left corner coordinate that is displayed by the scrollview
///
/// The content offset.
public Point ContentOffset {
get {
return contentOffset;
}
set {
contentOffset = value;
}
}
///
/// Gets or sets the visibility for the horizontal scroll indicator.
///
/// true if show vertical scroll indicator; otherwise, false.
public bool ShowHorizontalScrollIndicator {
get => showHorizontalScrollIndicator;
set {
showHorizontalScrollIndicator = value;
SetNeedsDisplay ();
}
}
///
/// /// Gets or sets the visibility for the vertical scroll indicator.
///
/// true if show vertical scroll indicator; otherwise, false.
public bool ShowVerticalScrollIndicator {
get => showVerticalScrollIndicator;
set {
showVerticalScrollIndicator = value;
SetNeedsDisplay ();
}
}
///
/// This event is raised when the contents have scrolled
///
public event Action Scrolled;
public override void Redraw(Rect region)
{
base.Redraw(region);
}
}
}