Show / Hide Table of Contents

Class Panel

A control container that processes the mouse on each child. TabStop defaults to false.

Inheritance
object
ControlBase
CompositeControl
Panel
Implements
IContainer
IList<ControlBase>
ICollection<ControlBase>
IEnumerable<ControlBase>
IEnumerable
Inherited Members
CompositeControl.MouseLastHandledByChild
CompositeControl.Controls
CompositeControl.NamedControls
CompositeControl.CreateChildControls()
CompositeControl.ProcessMouse(MouseScreenObjectState)
CompositeControl.AddControl(ControlBase)
CompositeControl.RemoveControl(ControlBase)
CompositeControl.Count
ControlBase.MouseState_IsMouseOver
ControlBase.MouseState_EnteredWithButtonDown
ControlBase.MouseState_IsMouseLeftDown
ControlBase.MouseState_IsMouseRightDown
ControlBase.OnUnfocused()
ControlBase.OnFocused()
ControlBase.LostMouse(MouseScreenObjectState)
ControlBase.OnParentChanged()
ControlBase.OnPositionChanged()
ControlBase.PlaceRelativeTo(ControlBase, Direction.Types, int)
ControlBase.DetermineState()
ControlBase.OnStateChanged(ControlStates, ControlStates)
ControlBase.OnSurfaceChanged(ICellSurface, ICellSurface)
ControlBase.FindThemeFont()
ControlBase.FindThemeColors()
ControlBase.SetThemeColors(Colors)
ControlBase.HasThemeColors()
ControlBase.Resize(int, int)
ControlBase.OnResized()
ControlBase.CreateControlSurface()
ControlBase.RefreshThemeStateColors(Colors)
ControlBase.OnMouseEnter(ControlBase.ControlMouseState)
ControlBase.OnMouseIn(ControlBase.ControlMouseState)
ControlBase.OnLeftMouseClicked(ControlBase.ControlMouseState)
ControlBase.OnRightMouseClicked(ControlBase.ControlMouseState)
ControlBase.ThemeState
ControlBase.UseKeyboard
ControlBase.UseMouse
ControlBase.CanFocus
ControlBase.CanResize
ControlBase.AlternateFont
ControlBase.Surface
ControlBase.MouseArea
ControlBase.IsMouseButtonStateClean
ControlBase.Position
ControlBase.AbsolutePosition
ControlBase.IsVisible
ControlBase.Tag
ControlBase.TabStop
ControlBase.TabIndex
ControlBase.IsDirty
ControlBase.Name
ControlBase.FocusOnMouseClick
ControlBase.Width
ControlBase.Height
ControlBase.IsFocused
ControlBase.IsEnabled
ControlBase.Bounds
ControlBase.Parent
ControlBase.State
ControlBase.IsDirtyChanged
ControlBase.Focused
ControlBase.Unfocused
ControlBase.PositionChanged
ControlBase.MouseEnter
ControlBase.MouseExit
ControlBase.MouseMove
ControlBase.MouseButtonClicked
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadConsole.UI.Controls
Assembly: SadConsole.dll
Syntax
[DataContract]
public class Panel : CompositeControl, IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable

Constructors

Panel(int, int)

Creates a new drawing surface control with the specified width and height.

Declaration
public Panel(int width, int height)
Parameters
Type Name Description
int width

Width of the control.

int height

Height of the control.

Properties

Appearance

The current Appearance based on the control state.

Declaration
[DataMember]
public ColoredGlyphBase? Appearance { get; protected set; }
Property Value
Type Description
ColoredGlyphBase

DrawBorder

When true, indicates that the theme should draw along the inner bounds of the panel.

Declaration
[DataMember]
public bool DrawBorder { get; set; }
Property Value
Type Description
bool

this[int]

Gets or sets a control in the collection of controls.

Declaration
public ControlBase this[int index] { get; set; }
Parameters
Type Name Description
int index

The index of the control.

Property Value
Type Description
ControlBase

The control at the specified index.

Exceptions
Type Condition
IndexOutOfRangeException

Thrown when the index doesn't exist in the collection.

this[string]

Declaration
public ControlBase this[string name] { get; }
Parameters
Type Name Description
string name
Property Value
Type Description
ControlBase

SkipDrawing

When true, ignores all states and doesn't draw anything.

Declaration
[DataMember]
public bool SkipDrawing { get; set; }
Property Value
Type Description
bool

UseExtendedBorderGlyphs

When true, indicates that the lines of the theme should use the extended SadConsole font characters if available.

Declaration
[DataMember]
public bool UseExtendedBorderGlyphs { get; set; }
Property Value
Type Description
bool

UseInsetBorder

When true, indicates that the border colors should make it appear like the border is inset.

Declaration
[DataMember]
public bool UseInsetBorder { get; set; }
Property Value
Type Description
bool

UseNormalStateOnly

When true, only uses Normal for drawing.

Declaration
[DataMember]
public bool UseNormalStateOnly { get; set; }
Property Value
Type Description
bool

Methods

Add(ControlBase)

Declaration
public void Add(ControlBase control)
Parameters
Type Name Description
ControlBase control

Clear()

Removes all controls.

Declaration
public void Clear()

Contains(ControlBase)

Declaration
public bool Contains(ControlBase control)
Parameters
Type Name Description
ControlBase control
Returns
Type Description
bool

CopyTo(ControlBase[], int)

Declaration
public void CopyTo(ControlBase[] array, int arrayIndex)
Parameters
Type Name Description
ControlBase[] array
int arrayIndex

GetEnumerator()

Gets an enumerator that iterates over the controls in this panel.

Declaration
public IEnumerator<ControlBase> GetEnumerator()
Returns
Type Description
IEnumerator<ControlBase>

The enumerator.

GetNamedControl(string)

Declaration
public ControlBase GetNamedControl(string name)
Parameters
Type Name Description
string name
Returns
Type Description
ControlBase

HasNamedControl(string)

Declaration
public bool HasNamedControl(string name)
Parameters
Type Name Description
string name
Returns
Type Description
bool

HasNamedControl(string, out ControlBase?)

Declaration
public bool HasNamedControl(string name, out ControlBase? control)
Parameters
Type Name Description
string name
ControlBase control
Returns
Type Description
bool

IndexOf(ControlBase)

Returns the index of the specified control.

Declaration
public int IndexOf(ControlBase control)
Parameters
Type Name Description
ControlBase control

The control to search for.

Returns
Type Description
int

The index of the control.

Insert(int, ControlBase)

Inserts the control at the specified index.

Declaration
public void Insert(int index, ControlBase control)
Parameters
Type Name Description
int index

The index to insert at.

ControlBase control

The control to insert.

OnIsDirtyChanged()

When IsDirty is set to true, changes the child controls to also be dirty.

Declaration
protected override void OnIsDirtyChanged()
Overrides
ControlBase.OnIsDirtyChanged()

OnMouseExit(ControlMouseState)

Called when the mouse exits the area of the control. Raises the MouseExit event and calls the DetermineState() method.

Declaration
protected override void OnMouseExit(ControlBase.ControlMouseState state)
Parameters
Type Name Description
ControlBase.ControlMouseState state

The current mouse data

Overrides
CompositeControl.OnMouseExit(ControlBase.ControlMouseState)

ProcessKeyboard(Keyboard)

Called when the keyboard is used on this control.

Declaration
public override bool ProcessKeyboard(Keyboard state)
Parameters
Type Name Description
Keyboard state

The state of the keyboard.

Returns
Type Description
bool
Overrides
ControlBase.ProcessKeyboard(Keyboard)

Remove(ControlBase)

Declaration
public bool Remove(ControlBase control)
Parameters
Type Name Description
ControlBase control
Returns
Type Description
bool

RemoveAt(int)

Removes a control at the specified index.

Declaration
public void RemoveAt(int index)
Parameters
Type Name Description
int index

The index of the control to remove.

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.

Overrides
CompositeControl.UpdateAndRedraw(TimeSpan)

Implements

IContainer
IList<T>
ICollection<T>
IEnumerable<T>
IEnumerable

Extension Methods

ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX