Panel Class
Definition
Section titled “Definition”A control container that processes the mouse on each child. TabStop defaults to false.
[DataContract]public class Panel : CompositeControl, IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerableInheritance object → ControlBase → CompositeControl
Implements IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable
Constructors
Section titled “Constructors”Panel(int, int)
Section titled “Panel(int, int)”Creates a new drawing surface control with the specified width and height.
public Panel(int width, int height)Parameters
Section titled “Parameters”width int
Width of the control.
height int
Height of the control.
Properties
Section titled “Properties”this[int]
Section titled “this[int]”Gets or sets a control in the collection of controls.
public ControlBase this[int index] { get; set; }this[string]
Section titled “this[string]”public ControlBase this[string name] { get; }UseNormalStateOnly
Section titled “UseNormalStateOnly”When true, only uses Normal for drawing.
[DataMember]public bool UseNormalStateOnly { get; set; }SkipDrawing
Section titled “SkipDrawing”When true, ignores all states and doesn’t draw anything.
[DataMember]public bool SkipDrawing { get; set; }DrawBorder
Section titled “DrawBorder”When true, indicates that the theme should draw along the inner bounds of the panel.
[DataMember]public bool DrawBorder { get; set; }UseExtendedBorderGlyphs
Section titled “UseExtendedBorderGlyphs”When true, indicates that the lines of the theme should use the extended SadConsole font characters if available.
[DataMember]public bool UseExtendedBorderGlyphs { get; set; }UseInsetBorder
Section titled “UseInsetBorder”When true, indicates that the border colors should make it appear like the border is inset.
[DataMember]public bool UseInsetBorder { get; set; }Appearance
Section titled “Appearance”The current Appearance based on the control state.
[DataMember]public ColoredGlyphBase? Appearance { get; protected set; }Methods
Section titled “Methods”Clear()
Section titled “Clear()”Removes all controls.
public void Clear()Add(ControlBase)
Section titled “Add(ControlBase)”public void Add(ControlBase control)Parameters
Section titled “Parameters”control ControlBase
Remove(ControlBase)
Section titled “Remove(ControlBase)”public bool Remove(ControlBase control)Parameters
Section titled “Parameters”control ControlBase
Returns
Section titled “Returns”RemoveAt(int)
Section titled “RemoveAt(int)”Removes a control at the specified index.
public void RemoveAt(int index)Parameters
Section titled “Parameters”index int
The index of the control to remove.
IndexOf(ControlBase)
Section titled “IndexOf(ControlBase)”Returns the index of the specified control.
public int IndexOf(ControlBase control)Parameters
Section titled “Parameters”control ControlBase
The control to search for.
Returns
Section titled “Returns”int
The index of the control.
Insert(int, ControlBase)
Section titled “Insert(int, ControlBase)”Inserts the control at the specified index.
public void Insert(int index, ControlBase control)Parameters
Section titled “Parameters”index int
The index to insert at.
control ControlBase
The control to insert.
Contains(ControlBase)
Section titled “Contains(ControlBase)”public bool Contains(ControlBase control)Parameters
Section titled “Parameters”control ControlBase
Returns
Section titled “Returns”CopyTo(ControlBase[], int)
Section titled “CopyTo(ControlBase[], int)”public void CopyTo(ControlBase[] array, int arrayIndex)Parameters
Section titled “Parameters”array ControlBase[]
arrayIndex int
OnMouseExit(ControlMouseState)
Section titled “OnMouseExit(ControlMouseState)”Called when the mouse exits the area of the control. Raises the MouseExit event and calls the DetermineState() method.
protected override void OnMouseExit(ControlBase.ControlMouseState state)Parameters
Section titled “Parameters”state ControlBase.ControlMouseState
The current mouse data
ProcessKeyboard(Keyboard)
Section titled “ProcessKeyboard(Keyboard)”Called when the keyboard is used on this control.
public override bool ProcessKeyboard(Keyboard state)Parameters
Section titled “Parameters”state Keyboard
The state of the keyboard.
Returns
Section titled “Returns”OnIsDirtyChanged()
Section titled “OnIsDirtyChanged()”When IsDirty is set to true, changes the child controls to also be dirty.
protected override void OnIsDirtyChanged()HasNamedControl(string)
Section titled “HasNamedControl(string)”public bool HasNamedControl(string name)Parameters
Section titled “Parameters”name string
Returns
Section titled “Returns”HasNamedControl(string, out ControlBase?)
Section titled “HasNamedControl(string, out ControlBase?)”public bool HasNamedControl(string name, out ControlBase? control)Parameters
Section titled “Parameters”name string
control ControlBase
Returns
Section titled “Returns”GetNamedControl(string)
Section titled “GetNamedControl(string)”public ControlBase GetNamedControl(string name)Parameters
Section titled “Parameters”name string
Returns
Section titled “Returns”GetEnumerator()
Section titled “GetEnumerator()”Gets an enumerator that iterates over the controls in this panel.
public IEnumerator<ControlBase> GetEnumerator()Returns
Section titled “Returns”IEnumerator<ControlBase>
The enumerator.
UpdateAndRedraw(TimeSpan)
Section titled “UpdateAndRedraw(TimeSpan)”Updates each control hosted by this control.
public override void UpdateAndRedraw(TimeSpan time)Parameters
Section titled “Parameters”time TimeSpan
The game frame time delta.