Interface IScreenObject
A generic object processed by SadConsole. Provides parent/child, components, position, and input callbacks.
Inherited Members
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
Declaration
bool UseKeyboard { get; set; }
Property Value
Type | Description |
---|---|
bool |
UseMouse
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
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
UpdateAbsolutePosition()
Sets a value for AbsolutePosition based on the Position of this instance and the Parent instance.
Declaration
void UpdateAbsolutePosition()
Events
FocusLost
Declaration
event EventHandler FocusLost
Event Type
Type | Description |
---|---|
EventHandler |
Focused
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>> |