Show / Hide Table of Contents

Interface IScreenObject

A generic object processed by SadConsole. Provides parent/child, components, position, and input callbacks.

Inherited Members
IPositionable.Position
IPositionable.PositionChanging
IPositionable.PositionChanged
IComponentHost.GetSadComponent<TComponent>()
IComponentHost.GetSadComponents<TComponent>()
IComponentHost.HasSadComponent<TComponent>(out TComponent)
IComponentHost.CompareComponent(IComponent, IComponent)
IComponentHost.SadComponents
Namespace: SadConsole
Assembly: SadConsole.dll
Syntax
public interface IScreenObject : IPositionable, IComponentHost

Properties

AbsolutePosition

A position that's based on the current Position, as interpreted by the implementing class, in pixels.

Declaration
Point AbsolutePosition { get; }
Property Value
Type Description
Point
Remarks

Most objects will implement this property based on Position which usually depends on the Parent object's position.

Children

The child objects of this instance.

Declaration
ScreenObjectCollection Children { get; }
Property Value
Type Description
ScreenObjectCollection

FocusedMode

How the object should handle becoming active.

Declaration
FocusBehavior FocusedMode { get; set; }
Property Value
Type Description
FocusBehavior

IgnoreParentPosition

When true, this object should ignore it's parent position when calculating AbsolutePosition; otherwise false.

Declaration
bool IgnoreParentPosition { get; set; }
Property Value
Type Description
bool

IsEnabled

Gets or sets the visibility of this object.

Declaration
bool IsEnabled { get; set; }
Property Value
Type Description
bool

IsExclusiveMouse

Gets or sets whether or not this object has exclusive access to the mouse events.

Declaration
bool IsExclusiveMouse { get; set; }
Property Value
Type Description
bool

IsFocused

Gets or sets this console as the focused object for input.

Declaration
bool IsFocused { get; set; }
Property Value
Type Description
bool

IsVisible

Gets or sets the visibility of this object.

Declaration
bool IsVisible { get; set; }
Property Value
Type Description
bool

Parent

The parent object that this instance is a child of.

Declaration
IScreenObject? Parent { get; set; }
Property Value
Type Description
IScreenObject

SortOrder

Indicates the sorting order this object should use when parented. Sorting is a manual operation on the Children collection.

Declaration
uint SortOrder { get; set; }
Property Value
Type Description
uint

UseKeyboard

When true, this object will use the keyboard; otherwise false.

Declaration
bool UseKeyboard { get; set; }
Property Value
Type Description
bool

UseMouse

When true, this object will use the mouse; otherwise false.

Declaration
bool UseMouse { get; set; }
Property Value
Type Description
bool

Methods

LostMouse(MouseScreenObjectState)

Called when the mouse is being used by something else.

Declaration
void LostMouse(MouseScreenObjectState state)
Parameters
Type Name Description
MouseScreenObjectState state

The current state of the mouse based on this object.

OnFocusLost()

Called when this object's focus has been lost.

Declaration
void OnFocusLost()

OnFocused()

Called when this object is focused.

Declaration
void OnFocused()

ProcessKeyboard(Keyboard)

Called by the engine to process the keyboard.

Declaration
bool ProcessKeyboard(Keyboard keyboard)
Parameters
Type Name Description
Keyboard keyboard

Keyboard information.

Returns
Type Description
bool

True when the keyboard had data and this console did something with it.

ProcessMouse(MouseScreenObjectState)

Processes the mouse.

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

The mouse state related to this object.

Returns
Type Description
bool

True when this object should halt further mouse processing..

Render(TimeSpan)

Draws all SadComponents and Children.

Declaration
void Render(TimeSpan delta)
Parameters
Type Name Description
TimeSpan delta

The time that has elapsed since the last call.

Remarks

Only processes if IsVisible is true.

Update(TimeSpan)

Updates all SadComponents and Children.

Declaration
void Update(TimeSpan delta)
Parameters
Type Name Description
TimeSpan delta

The time that has elapsed since the last call.

Remarks

Only processes if IsEnabled is true.

UpdateAbsolutePosition()

Sets a value for AbsolutePosition based on the Position of this instance and the Parent instance.

Declaration
void UpdateAbsolutePosition()

Events

FocusLost

Raised when the IsFocused property is false.

Declaration
event EventHandler FocusLost
Event Type
Type Description
EventHandler

Focused

Raised when the IsFocused property is true.

Declaration
event EventHandler Focused
Event Type
Type Description
EventHandler

IsEnabledChanged

Raised when the IsEnabled property changes.

Declaration
event EventHandler IsEnabledChanged
Event Type
Type Description
EventHandler

IsVisibleChanged

Raised when the IsVisible property changes.

Declaration
event EventHandler IsVisibleChanged
Event Type
Type Description
EventHandler

ParentChanged

Raised when the Parent property changes.

Declaration
event EventHandler<ValueChangedEventArgs<IScreenObject?>> ParentChanged
Event Type
Type Description
EventHandler<ValueChangedEventArgs<IScreenObject>>

Extension Methods

Keyboard.RemoveKeyboardHook(IScreenObject, Func<IScreenObject, Keyboard, bool>)
Keyboard.RemoveKeyboardHooks(IScreenObject)
Keyboard.WithKeyboard(IScreenObject, Func<IScreenObject, Keyboard, bool>)
Mouse.RemoveMouseHook(IScreenObject, Func<IScreenObject, MouseScreenObjectState, bool>)
Mouse.RemoveMouseHooks(IScreenObject)
Mouse.WithMouse(IScreenObject, Func<IScreenObject, MouseScreenObjectState, bool>)
Update.RemoveUpdateHook(IScreenObject, Action<IScreenObject, TimeSpan>)
Update.RemoveUpdateHooks(IScreenObject)
Update.WithUpdate(IScreenObject, Action<IScreenObject, TimeSpan>)
ExtensionsSystem.GetDebuggerDisplayValue(object)
In this article

Back to top

Back to top Generated by DocFX