Show / Hide Table of Contents

Class CompositeControl

Base class for controls that host and render other controls.

Inheritance
object
ControlBase
CompositeControl
ListBox
Panel
SurfaceViewer
TabControl
Table
Implements
IContainer
IList<ControlBase>
ICollection<ControlBase>
IEnumerable<ControlBase>
IEnumerable
Inherited Members
ControlBase.MouseState_IsMouseOver
ControlBase.MouseState_EnteredWithButtonDown
ControlBase.MouseState_IsMouseLeftDown
ControlBase.MouseState_IsMouseRightDown
ControlBase.OnUnfocused()
ControlBase.OnFocused()
ControlBase.OnIsDirtyChanged()
ControlBase.ProcessKeyboard(Keyboard)
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
public abstract class CompositeControl : ControlBase, IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable

Constructors

CompositeControl(int, int)

Creates a new control with the specified width and height.

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

Width of the control in cells.

int height

Height of the control in cells.

Fields

Controls

The controls this composite control is hosting. Use AddControl(ControlBase) and RemoveControl(ControlBase) to manage the collection.

Declaration
protected List<ControlBase> Controls
Field Value
Type Description
List<ControlBase>

MouseLastHandledByChild

Declaration
protected bool MouseLastHandledByChild
Field Value
Type Description
bool

NamedControls

The controls added which contain a Name value.

Declaration
protected Dictionary<string, ControlBase> NamedControls
Field Value
Type Description
Dictionary<string, ControlBase>

Properties

Count

Declaration
public int Count { get; }
Property Value
Type Description
int

this[int]

Declaration
protected ControlBase this[int index] { get; }
Parameters
Type Name Description
int index
Property Value
Type Description
ControlBase

Methods

AddControl(ControlBase)

Adds a child control to this control.

Declaration
protected void AddControl(ControlBase control)
Parameters
Type Name Description
ControlBase control

The control to add.

CreateChildControls()

Create each control and add it to Controls.

Declaration
protected virtual void CreateChildControls()

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
ControlBase.OnMouseExit(ControlBase.ControlMouseState)

ProcessMouse(MouseScreenObjectState)

Processes the mouse on each control hosted by this control.

Declaration
public override bool ProcessMouse(MouseScreenObjectState state)
Parameters
Type Name Description
MouseScreenObjectState state

The mouse state based on the parent screen object.

Returns
Type Description
bool

true when a control processes the mouse; otherwise false.

Overrides
ControlBase.ProcessMouse(MouseScreenObjectState)

RemoveControl(ControlBase)

Removes a child control from this control.

Declaration
protected void RemoveControl(ControlBase control)
Parameters
Type Name Description
ControlBase control

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
ControlBase.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