C# Класс SadConsole.Controls.ControlBase

Наследование: CellSurface, IInput
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
bounds Microsoft.Xna.Framework.Rectangle
isEnabled bool
isMouseOver bool
parent Consoles.ControlsConsole
position Point

Private Properties

Свойство Тип Описание
AfterDeserialized void

Открытые методы

Метод Описание
Compose ( ) : void

Redraw the lastest appearance of the control.

This method is implemented by each derived control.

Compose ( bool force ) : void

Redraw the latest appearance of the control if IsDirty is set to true.

ControlBase ( int width, int height ) : System.Runtime.Serialization

Default constructor of the control.

DetermineAppearance ( ) : void

Sets the appropriate theme for the control based on the current state of the control.

Called by the control as the mouse state changes, like when the mouse is clicked on top of the control or leaves the area of the control. This method is implemented by each derived control.

FocusLost ( ) : void

Called when the control loses focus. Calls DetermineAppearance.

Focused ( ) : void

Called when the control is focused. Calls DetermineAppearance.

ProcessKeyboard ( KeyboardInfo info ) : bool

Called when the keyboard is used on this control.

ProcessMouse ( Input info ) : bool

Checks if the mouse is the control and calls the appropriate mouse methods.

Update ( ) : void

Update the control. Calls Compose() and then updates each cell effect if needed.

Защищенные методы

Метод Описание
OnLeftMouseClicked ( Input info ) : void

Called when the left mouse button is clicked. Raises the MouseButtonClicked event and calls the DetermineAppearance method.

OnMouseEnter ( Input info ) : void

Called when the mouse first enters the control. Raises the MouseEnter event and calls the DetermineAppearance method.

OnMouseExit ( Input info ) : void

Called when the mouse exits the area of the control. Raises the MouseExit event and calls the DetermineAppearance method.

OnMouseIn ( Input info ) : void

Called as the mouse moves around the control area. Raises the MouseMove event and calls the DetermineAppearance method.

OnParentChanged ( ) : void

Called when the parent property is changed.

OnPositionChanged ( ) : void

Called when the control changes position.

OnRightMouseClicked ( Input info ) : void

Called when the right mouse button is clicked. Raises the MouseButtonClicked event and calls the DetermineAppearance method.

TransformConsolePositionByControlPosition ( Input info ) : Point

Helper method that returns the mouse x,y position for the control.

Приватные методы

Метод Описание
AfterDeserialized ( StreamingContext context ) : void

Описание методов

Compose() публичный абстрактный Метод

Redraw the lastest appearance of the control.
This method is implemented by each derived control.
public abstract Compose ( ) : void
Результат void

Compose() публичный Метод

Redraw the latest appearance of the control if IsDirty is set to true.
public Compose ( bool force ) : void
force bool Force the draw to happen by setting IsDirty as true.
Результат void

ControlBase() публичный Метод

Default constructor of the control.
public ControlBase ( int width, int height ) : System.Runtime.Serialization
width int
height int
Результат System.Runtime.Serialization

DetermineAppearance() публичный абстрактный Метод

Sets the appropriate theme for the control based on the current state of the control.
Called by the control as the mouse state changes, like when the mouse is clicked on top of the control or leaves the area of the control. This method is implemented by each derived control.
public abstract DetermineAppearance ( ) : void
Результат void

FocusLost() публичный Метод

Called when the control loses focus. Calls DetermineAppearance.
public FocusLost ( ) : void
Результат void

Focused() публичный Метод

Called when the control is focused. Calls DetermineAppearance.
public Focused ( ) : void
Результат void

OnLeftMouseClicked() защищенный Метод

Called when the left mouse button is clicked. Raises the MouseButtonClicked event and calls the DetermineAppearance method.
protected OnLeftMouseClicked ( Input info ) : void
info Input The current mouse data
Результат void

OnMouseEnter() защищенный Метод

Called when the mouse first enters the control. Raises the MouseEnter event and calls the DetermineAppearance method.
protected OnMouseEnter ( Input info ) : void
info Input The current mouse data
Результат void

OnMouseExit() защищенный Метод

Called when the mouse exits the area of the control. Raises the MouseExit event and calls the DetermineAppearance method.
protected OnMouseExit ( Input info ) : void
info Input The current mouse data
Результат void

OnMouseIn() защищенный Метод

Called as the mouse moves around the control area. Raises the MouseMove event and calls the DetermineAppearance method.
protected OnMouseIn ( Input info ) : void
info Input The current mouse data
Результат void

OnParentChanged() защищенный Метод

Called when the parent property is changed.
protected OnParentChanged ( ) : void
Результат void

OnPositionChanged() защищенный Метод

Called when the control changes position.
protected OnPositionChanged ( ) : void
Результат void

OnRightMouseClicked() защищенный Метод

Called when the right mouse button is clicked. Raises the MouseButtonClicked event and calls the DetermineAppearance method.
protected OnRightMouseClicked ( Input info ) : void
info Input The current mouse data
Результат void

ProcessKeyboard() публичный Метод

Called when the keyboard is used on this control.
public ProcessKeyboard ( KeyboardInfo info ) : bool
info SadConsole.Input.KeyboardInfo The state of the keyboard.
Результат bool

ProcessMouse() публичный Метод

Checks if the mouse is the control and calls the appropriate mouse methods.
public ProcessMouse ( Input info ) : bool
info Input Mouse information.
Результат bool

TransformConsolePositionByControlPosition() защищенный Метод

Helper method that returns the mouse x,y position for the control.
protected TransformConsolePositionByControlPosition ( Input info ) : Point
info Input The mouse information as used by a mouse event.
Результат Point

Update() публичный Метод

Update the control. Calls Compose() and then updates each cell effect if needed.
public Update ( ) : void
Результат void

Описание свойств

bounds защищенное свойство

protected Rectangle,Microsoft.Xna.Framework bounds
Результат Microsoft.Xna.Framework.Rectangle

isEnabled защищенное свойство

protected bool isEnabled
Результат bool

isMouseOver защищенное свойство

protected bool isMouseOver
Результат bool

parent защищенное свойство

protected Consoles.ControlsConsole parent
Результат Consoles.ControlsConsole

position защищенное свойство

protected Point position
Результат Point