C# Class SadConsole.Controls.ControlBase

Inheritance: CellSurface, IInput
Afficher le fichier Open project: Thraka/SadConsole Class Usage Examples

Protected Properties

Свойство Type Description
bounds Microsoft.Xna.Framework.Rectangle
isEnabled bool
isMouseOver bool
parent Consoles.ControlsConsole
position Point

Private Properties

Свойство Type Description
AfterDeserialized void

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
AfterDeserialized ( StreamingContext context ) : void

Method Details

Compose() public abstract méthode

Redraw the lastest appearance of the control.
This method is implemented by each derived control.
public abstract Compose ( ) : void
Résultat void

Compose() public méthode

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.
Résultat void

ControlBase() public méthode

Default constructor of the control.
public ControlBase ( int width, int height ) : System.Runtime.Serialization
width int
height int
Résultat System.Runtime.Serialization

DetermineAppearance() public abstract méthode

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
Résultat void

FocusLost() public méthode

Called when the control loses focus. Calls DetermineAppearance.
public FocusLost ( ) : void
Résultat void

Focused() public méthode

Called when the control is focused. Calls DetermineAppearance.
public Focused ( ) : void
Résultat void

OnLeftMouseClicked() protected méthode

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
Résultat void

OnMouseEnter() protected méthode

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
Résultat void

OnMouseExit() protected méthode

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
Résultat void

OnMouseIn() protected méthode

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
Résultat void

OnParentChanged() protected méthode

Called when the parent property is changed.
protected OnParentChanged ( ) : void
Résultat void

OnPositionChanged() protected méthode

Called when the control changes position.
protected OnPositionChanged ( ) : void
Résultat void

OnRightMouseClicked() protected méthode

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
Résultat void

ProcessKeyboard() public méthode

Called when the keyboard is used on this control.
public ProcessKeyboard ( KeyboardInfo info ) : bool
info SadConsole.Input.KeyboardInfo The state of the keyboard.
Résultat bool

ProcessMouse() public méthode

Checks if the mouse is the control and calls the appropriate mouse methods.
public ProcessMouse ( Input info ) : bool
info Input Mouse information.
Résultat bool

TransformConsolePositionByControlPosition() protected méthode

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.
Résultat Point

Update() public méthode

Update the control. Calls Compose() and then updates each cell effect if needed.
public Update ( ) : void
Résultat void

Property Details

bounds protected_oe property

protected Rectangle,Microsoft.Xna.Framework bounds
Résultat Microsoft.Xna.Framework.Rectangle

isEnabled protected_oe property

protected bool isEnabled
Résultat bool

isMouseOver protected_oe property

protected bool isMouseOver
Résultat bool

parent protected_oe property

protected Consoles.ControlsConsole parent
Résultat Consoles.ControlsConsole

position protected_oe property

protected Point position
Résultat Point