Class Panel
A control container that processes the mouse on each child. TabStop defaults to false.
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
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
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
this[string]
Declaration
public ControlBase this[string name] { get; }
Parameters
Type |
Name |
Description |
string |
name |
|
Property Value
SkipDrawing
When true, ignores all states and doesn't draw anything.
Declaration
[DataMember]
public bool SkipDrawing { get; set; }
Property Value
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
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
UseNormalStateOnly
When true, only uses Normal for drawing.
Declaration
[DataMember]
public bool UseNormalStateOnly { get; set; }
Property Value
Methods
Add(ControlBase)
Declaration
public void Add(ControlBase control)
Parameters
Clear()
Declaration
Contains(ControlBase)
Declaration
public bool Contains(ControlBase control)
Parameters
Returns
CopyTo(ControlBase[], int)
Declaration
public void CopyTo(ControlBase[] array, int arrayIndex)
Parameters
GetEnumerator()
Gets an enumerator that iterates over the controls in this panel.
Declaration
public IEnumerator<ControlBase> GetEnumerator()
Returns
GetNamedControl(string)
Declaration
public ControlBase GetNamedControl(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
HasNamedControl(string)
Declaration
public bool HasNamedControl(string name)
Parameters
Type |
Name |
Description |
string |
name |
|
Returns
HasNamedControl(string, out ControlBase?)
Declaration
public bool HasNamedControl(string name, out ControlBase? control)
Parameters
Returns
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
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
Overrides
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
Overrides
Remove(ControlBase)
Declaration
public bool Remove(ControlBase control)
Parameters
Returns
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
Implements