CompositeControl Class
Definition
Section titled “Definition”Base class for controls that host and render other controls.
public abstract class CompositeControl : ControlBase, IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerableInheritance object → ControlBase
Implements IContainer, IList<ControlBase>, ICollection<ControlBase>, IEnumerable<ControlBase>, IEnumerable
Constructors
Section titled “Constructors”CompositeControl(int, int)
Section titled “CompositeControl(int, int)”Creates a new control with the specified width and height.
public CompositeControl(int width, int height)Parameters
Section titled “Parameters”width int
Width of the control in cells.
height int
Height of the control in cells.
Fields
Section titled “Fields”MouseLastHandledByChild
Section titled “MouseLastHandledByChild”protected bool MouseLastHandledByChildControls
Section titled “Controls”The controls this composite control is hosting. Use AddControl(ControlBase) and RemoveControl(ControlBase) to manage the collection.
protected List<ControlBase> ControlsNamedControls
Section titled “NamedControls”The controls added which contain a Name value.
protected Dictionary<string, ControlBase> NamedControlsProperties
Section titled “Properties”public int Count { get; }this[int]
Section titled “this[int]”protected ControlBase this[int index] { get; }Methods
Section titled “Methods”CreateChildControls()
Section titled “CreateChildControls()”Create each control and add it to Controls.
protected virtual void CreateChildControls()ProcessMouse(MouseScreenObjectState)
Section titled “ProcessMouse(MouseScreenObjectState)”Processes the mouse on each control hosted by this control.
public override bool ProcessMouse(MouseScreenObjectState state)Parameters
Section titled “Parameters”state MouseScreenObjectState
The mouse state based on the parent screen object.
Returns
Section titled “Returns”bool
true when a control processes the mouse; otherwise false.
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
AddControl(ControlBase)
Section titled “AddControl(ControlBase)”Adds a child control to this control.
protected void AddControl(ControlBase control)Parameters
Section titled “Parameters”control ControlBase
The control to add.
RemoveControl(ControlBase)
Section titled “RemoveControl(ControlBase)”Removes a child control from this control.
protected void RemoveControl(ControlBase control)Parameters
Section titled “Parameters”control ControlBase
The control to remove.
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.