Class SurfaceViewer
Draws a ICellSurface within an area. Optionally supports scroll bars.
Implements
Inherited Members
Namespace: SadConsole.UI.Controls
Assembly: SadConsole.dll
Syntax
[DataContract]
public class SurfaceViewer : CompositeControl, IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable
Constructors
SurfaceViewer(int, int, ICellSurface?)
Creates a new drawing surface control with the specified width and height.
Declaration
public SurfaceViewer(int width, int height, ICellSurface? surface = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | width | Width of the control. |
| int | height | Height of the control. |
| ICellSurface | surface | The surface to view. |
Fields
HorizontalScroller
The horizontal scroll bar. This shouldn't be changed.
Declaration
public ScrollBar HorizontalScroller
Field Value
| Type | Description |
|---|---|
| ScrollBar |
VerticalScroller
The vertical scroll bar. This shouldn't be changed.
Declaration
public ScrollBar VerticalScroller
Field Value
| Type | Description |
|---|---|
| ScrollBar |
Properties
ScrollBarMode
Sets the visual behavior of the scroll bars for the control.
Declaration
[DataMember]
public SurfaceViewer.ScrollBarModes ScrollBarMode { get; set; }
Property Value
| Type | Description |
|---|---|
| SurfaceViewer.ScrollBarModes |
Methods
OnSurfaceChanged(ICellSurface, ICellSurface)
Handles and dehandles the IsDirtyChanged event for the backing surface.
Declaration
protected override void OnSurfaceChanged(ICellSurface oldSurface, ICellSurface newSurface)
Parameters
| Type | Name | Description |
|---|---|---|
| ICellSurface | oldSurface | The previous surface instance. |
| ICellSurface | newSurface | The new surface instance. |
Overrides
ResetSurface()
Resets the control's surface to a 1x1 surface transparent surface.
Declaration
public void ResetSurface()
UpdateAndRedraw(TimeSpan)
Updates each control hosted by this control.
Declaration
public override void UpdateAndRedraw(TimeSpan time)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | time | The game frame time delta. |