Skip to content

Panel Class

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

C#
[DataContract]
public class Panel : CompositeControl, IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable

Inheritance objectControlBaseCompositeControl

Implements IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable

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

C#
public Panel(int width, int height)

width int
Width of the control.

height int
Height of the control.

Gets or sets a control in the collection of controls.

C#
public ControlBase this[int index] { get; set; }
C#
public ControlBase this[string name] { get; }

When true, only uses Normal for drawing.

C#
[DataMember]
public bool UseNormalStateOnly { get; set; }

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

C#
[DataMember]
public bool SkipDrawing { get; set; }

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

C#
[DataMember]
public bool DrawBorder { get; set; }

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

C#
[DataMember]
public bool UseExtendedBorderGlyphs { get; set; }

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

C#
[DataMember]
public bool UseInsetBorder { get; set; }

The current Appearance based on the control state.

C#
[DataMember]
public ColoredGlyphBase? Appearance { get; protected set; }

Removes all controls.

C#
public void Clear()
C#
public void Add(ControlBase control)

control ControlBase

C#
public bool Remove(ControlBase control)

control ControlBase

bool

Removes a control at the specified index.

C#
public void RemoveAt(int index)

index int
The index of the control to remove.

Returns the index of the specified control.

C#
public int IndexOf(ControlBase control)

control ControlBase
The control to search for.

int
The index of the control.

Inserts the control at the specified index.

C#
public void Insert(int index, ControlBase control)

index int
The index to insert at.

control ControlBase
The control to insert.

C#
public bool Contains(ControlBase control)

control ControlBase

bool

C#
public void CopyTo(ControlBase[] array, int arrayIndex)

array ControlBase[]

arrayIndex int

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

C#
protected override void OnMouseExit(ControlBase.ControlMouseState state)

state ControlBase.ControlMouseState
The current mouse data

Called when the keyboard is used on this control.

C#
public override bool ProcessKeyboard(Keyboard state)

state Keyboard
The state of the keyboard.

bool

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

C#
protected override void OnIsDirtyChanged()
C#
public bool HasNamedControl(string name)

name string

bool

C#
public bool HasNamedControl(string name, out ControlBase? control)

name string

control ControlBase

bool

C#
public ControlBase GetNamedControl(string name)

name string

ControlBase

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

C#
public IEnumerator<ControlBase> GetEnumerator()

IEnumerator<ControlBase>
The enumerator.

Updates each control hosted by this control.

C#
public override void UpdateAndRedraw(TimeSpan time)

time TimeSpan
The game frame time delta.