C# Class MonoGameUi.Control

Basisklasse für alle Arten von Controls.
显示文件 Open project: OctoAwesome/monogameui Class Usage Examples

Public Methods

Method Description
CalculcateRequiredClientSpace ( Point available ) : Point

Ist für die Berechnung des Client-Contents zuständig und erleichtert das automatische Alignment.

Control ( BaseScreenComponent manager, string style = "" ) : System
Draw ( SpriteBatch batch, Rectangle renderMask, GameTime gameTime ) : void

Zeichenauruf für das Control (SpriteBatch ist bereits aktiviert)

Focus ( ) : void

Setzt den Fokus auf dieses Control.

GetExpectedSize ( Point available ) : Point

Methode zur Ermittlung des notwendigen Platzes.

GetMaxClientSize ( Point containerSize ) : Point

Ermittelt die maximale Größe des Client Bereichs für dieses Control.

GetMinClientSize ( Point containerSize ) : Point

Ermittelt die minimale Größe des Client Bereichs für dieses Control.

HasInvalidDimensions ( ) : bool

Gibt zurück, ob die Größenangaben nicht mehr aktuell sind.

InvalidateDimensions ( ) : void

Teilt dem Steuerelement mit, dass seine Größe neu berechnet werden muss.

InvalidateDrawing ( ) : void
OnResolutionChanged ( ) : void

Wird aufgerufen, wenn die Auflösung des Fensters geändert wird.

PreDraw ( GameTime gameTime ) : void
SetActualSize ( Point available ) : void

Legt die tatsächliche Größe für dieses Control fest.

StartTransition ( Transition transition ) : void
Unfocus ( ) : void

Entfernt den Fokus.

Update ( GameTime gameTime ) : void

Protected Methods

Method Description
ApplySkin ( Type type ) : void
OnCanFocusChanged ( PropertyEventArgs args ) : void
OnDraw ( SpriteBatch batch, Rectangle controlArea, GameTime gameTime ) : void

Malt das komplette Control

OnDrawBackground ( SpriteBatch batch, Rectangle backgroundArea, GameTime gameTime, float alpha ) : void

Malt den Hintergrund des Controls

OnDrawContent ( SpriteBatch batch, Rectangle contentArea, GameTime gameTime, float alpha ) : void

Malt den Content des Controls

OnDrawFocusFrame ( SpriteBatch batch, Rectangle contentArea, GameTime gameTime, float alpha ) : void

Malt den Fokusrahmen des Controls

OnDropEnter ( DragEventArgs args ) : void
OnDropLeave ( DragEventArgs args ) : void
OnDropMove ( DragEventArgs args ) : void
OnEnableChanged ( PropertyEventArgs args ) : void
OnEndDrop ( DragEventArgs args ) : void
OnGotFocus ( EventArgs args ) : void
OnHoveredChanged ( PropertyEventArgs args ) : void
OnInsertControl ( CollectionEventArgs args ) : void

Ein neues Control wurde in die Children-Liste eingefügt.

OnKeyDown ( KeyEventArgs args ) : void

Wird aufgerufen, wenn eine Taste gedrückt wird.

OnKeyPress ( KeyEventArgs args ) : void

Wird aufgerufen, wenn eine Taste gedrückt ist.

OnKeyTextPress ( KeyTextEventArgs args ) : void
OnKeyUp ( KeyEventArgs args ) : void

Wird aufgerufen, wenn eine Taste losgelassen wird.

OnLeftMouseClick ( MouseEventArgs args ) : void

Wird aufgerufen, wenn mit der linken Maustaste auf das Steuerelement geklickt wird.

OnLeftMouseDoubleClick ( MouseEventArgs args ) : void
OnLeftMouseDown ( MouseEventArgs args ) : void

Wird aufgerufen, wenn die linke Maustaste heruntergedrückt wird.

OnLeftMouseUp ( MouseEventArgs args ) : void

Wird aufgerufen, wenn die linke Maustaste losgelassen wird.

OnLostFocus ( EventArgs args ) : void
OnMouseEnter ( MouseEventArgs args ) : void
OnMouseLeave ( MouseEventArgs args ) : void
OnMouseMove ( MouseEventArgs args ) : void
OnMouseScroll ( MouseScrollEventArgs args ) : void
OnParentChanged ( PropertyEventArgs args ) : void

Der Parent dieses Controls hat sich geändert.

OnPreDraw ( GameTime gameTime ) : void
OnRemoveControl ( CollectionEventArgs args ) : void

Ein Control wurde aus der Children-Liste entfernt.

OnRightMouseClick ( MouseEventArgs args ) : void

Wird aufgerufen, wenn mit der rechten Maustaste auf das Steuerelement geklickt wird.

OnRightMouseDoubleClick ( MouseEventArgs args ) : void
OnRightMouseDown ( MouseEventArgs args ) : void

Wird aufgerufen, wenn die rechte Maustaste heruntergedrückt wird.

OnRightMouseUp ( MouseEventArgs args ) : void

Wird aufgerufen, wenn die rechte Maustaste losgelassen wird.

OnStartDrag ( DragEventArgs args ) : void
OnTabOrderChanged ( PropertyEventArgs args ) : void
OnTabStopChanged ( PropertyEventArgs args ) : void
OnTouchDoubleTap ( TouchEventArgs args ) : void
OnTouchDown ( TouchEventArgs args ) : void
OnTouchMove ( TouchEventArgs args ) : void
OnTouchTap ( TouchEventArgs args ) : void
OnTouchUp ( TouchEventArgs args ) : void
OnUpdate ( GameTime gameTime ) : void
OnVisibleChanged ( PropertyEventArgs args ) : void
OnZOrderChanged ( PropertyEventArgs args ) : void
SetDimension ( Point actualSize, Point containerSize ) : void

Führt eine automatische Anordnung auf Basis der aktuellen Size und den Alignment-Parametern durch.

Private Methods

Method Description
CalculateLocalPosition ( Point global, Control control ) : Point
ControlCollectionInsert ( Control item, int index ) : void
ControlCollectionRemove ( Control item, int index ) : void
HandleTransitions ( GameTime gameTime ) : void
InternalDropMove ( DragEventArgs args ) : bool
InternalEndDrop ( DragEventArgs args ) : bool
InternalKeyDown ( KeyEventArgs args ) : void
InternalKeyPress ( KeyEventArgs args ) : void
InternalKeyTextPress ( KeyTextEventArgs args ) : void
InternalKeyUp ( KeyEventArgs args ) : void
InternalLeftMouseClick ( MouseEventArgs args ) : bool
InternalLeftMouseDoubleClick ( MouseEventArgs args ) : bool
InternalLeftMouseDown ( MouseEventArgs args ) : bool
InternalLeftMouseUp ( MouseEventArgs args ) : void
InternalMouseMove ( MouseEventArgs args ) : bool

Wird vom Parent aufgerufen wenn sich die Maus bewegt

InternalMouseScroll ( MouseScrollEventArgs args ) : bool
InternalRightMouseClick ( MouseEventArgs args ) : bool
InternalRightMouseDoubleClick ( MouseEventArgs args ) : bool
InternalRightMouseDown ( MouseEventArgs args ) : bool
InternalRightMouseUp ( MouseEventArgs args ) : void
InternalStartDrag ( DragEventArgs args ) : bool
InternalTabbedBackward ( ) : bool

Tabbt den aktuellen Fokus eines Controls eine Stelle zurück.

InternalTabbedForward ( ) : bool

Tabbt den aktuellen Fokus eines Controls eine Stelle weiter.

InternalTouchDoubleTap ( TouchEventArgs args ) : bool
InternalTouchDown ( TouchEventArgs args ) : bool
InternalTouchMove ( TouchEventArgs args ) : void
InternalTouchTap ( TouchEventArgs args ) : bool
InternalTouchUp ( TouchEventArgs args ) : void
SetFocus ( Control control ) : void

Setzt den Fokus auf das angegebene Control für den kompletten Visual Tree ab diesem Control abwärts.

Method Details

ApplySkin() protected method

protected ApplySkin ( Type type ) : void
type System.Type
return void

CalculcateRequiredClientSpace() public method

Ist für die Berechnung des Client-Contents zuständig und erleichtert das automatische Alignment.
public CalculcateRequiredClientSpace ( Point available ) : Point
available Point
return Point

Control() public method

public Control ( BaseScreenComponent manager, string style = "" ) : System
manager BaseScreenComponent
style string
return System

Draw() public method

Zeichenauruf für das Control (SpriteBatch ist bereits aktiviert)
public Draw ( SpriteBatch batch, Rectangle renderMask, GameTime gameTime ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Spritebatch
renderMask Microsoft.Xna.Framework.Rectangle
gameTime Microsoft.Xna.Framework.GameTime Vergangene Spielzeit
return void

Focus() public method

Setzt den Fokus auf dieses Control.
public Focus ( ) : void
return void

GetExpectedSize() public method

Methode zur Ermittlung des notwendigen Platzes.
public GetExpectedSize ( Point available ) : Point
available Point Verfügbarer Platz für dieses Control
return Point

GetMaxClientSize() public method

Ermittelt die maximale Größe des Client Bereichs für dieses Control.
public GetMaxClientSize ( Point containerSize ) : Point
containerSize Point
return Point

GetMinClientSize() public method

Ermittelt die minimale Größe des Client Bereichs für dieses Control.
public GetMinClientSize ( Point containerSize ) : Point
containerSize Point
return Point

HasInvalidDimensions() public method

Gibt zurück, ob die Größenangaben nicht mehr aktuell sind.
public HasInvalidDimensions ( ) : bool
return bool

InvalidateDimensions() public method

Teilt dem Steuerelement mit, dass seine Größe neu berechnet werden muss.
public InvalidateDimensions ( ) : void
return void

InvalidateDrawing() public method

public InvalidateDrawing ( ) : void
return void

OnCanFocusChanged() protected method

protected OnCanFocusChanged ( PropertyEventArgs args ) : void
args PropertyEventArgs
return void

OnDraw() protected method

Malt das komplette Control
protected OnDraw ( SpriteBatch batch, Rectangle controlArea, GameTime gameTime ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Spritebatch
controlArea Microsoft.Xna.Framework.Rectangle Bereich für das Control in absoluten Koordinaten
gameTime Microsoft.Xna.Framework.GameTime GameTime
return void

OnDrawBackground() protected method

Malt den Hintergrund des Controls
protected OnDrawBackground ( SpriteBatch batch, Rectangle backgroundArea, GameTime gameTime, float alpha ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Spritebatch
backgroundArea Microsoft.Xna.Framework.Rectangle Bereich für den Background in absoluten Koordinaten
gameTime Microsoft.Xna.Framework.GameTime GameTime
alpha float Die Transparenz des Controls.
return void

OnDrawContent() protected method

Malt den Content des Controls
protected OnDrawContent ( SpriteBatch batch, Rectangle contentArea, GameTime gameTime, float alpha ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Spritebatch
contentArea Microsoft.Xna.Framework.Rectangle Bereich für den Content in absoluten Koordinaten
gameTime Microsoft.Xna.Framework.GameTime GameTime
alpha float Die Transparenz des Controls.
return void

OnDrawFocusFrame() protected method

Malt den Fokusrahmen des Controls
protected OnDrawFocusFrame ( SpriteBatch batch, Rectangle contentArea, GameTime gameTime, float alpha ) : void
batch Microsoft.Xna.Framework.Graphics.SpriteBatch Spritebatch
contentArea Microsoft.Xna.Framework.Rectangle Bereich für den Content in absoluten Koordinaten
gameTime Microsoft.Xna.Framework.GameTime GameTime
alpha float Die Transparenz des Controls.
return void

OnDropEnter() protected method

protected OnDropEnter ( DragEventArgs args ) : void
args DragEventArgs
return void

OnDropLeave() protected method

protected OnDropLeave ( DragEventArgs args ) : void
args DragEventArgs
return void

OnDropMove() protected method

protected OnDropMove ( DragEventArgs args ) : void
args DragEventArgs
return void

OnEnableChanged() protected method

protected OnEnableChanged ( PropertyEventArgs args ) : void
args PropertyEventArgs
return void

OnEndDrop() protected method

protected OnEndDrop ( DragEventArgs args ) : void
args DragEventArgs
return void

OnGotFocus() protected method

protected OnGotFocus ( EventArgs args ) : void
args System.EventArgs
return void

OnHoveredChanged() protected method

protected OnHoveredChanged ( PropertyEventArgs args ) : void
args PropertyEventArgs
return void

OnInsertControl() protected method

Ein neues Control wurde in die Children-Liste eingefügt.
protected OnInsertControl ( CollectionEventArgs args ) : void
args CollectionEventArgs
return void

OnKeyDown() protected method

Wird aufgerufen, wenn eine Taste gedrückt wird.
protected OnKeyDown ( KeyEventArgs args ) : void
args KeyEventArgs Zusätzliche Daten zum Event.
return void

OnKeyPress() protected method

Wird aufgerufen, wenn eine Taste gedrückt ist.
protected OnKeyPress ( KeyEventArgs args ) : void
args KeyEventArgs Zusätzliche Daten zum Event.
return void

OnKeyTextPress() protected method

protected OnKeyTextPress ( KeyTextEventArgs args ) : void
args KeyTextEventArgs
return void

OnKeyUp() protected method

Wird aufgerufen, wenn eine Taste losgelassen wird.
protected OnKeyUp ( KeyEventArgs args ) : void
args KeyEventArgs Zusätzliche Daten zum Event.
return void

OnLeftMouseClick() protected method

Wird aufgerufen, wenn mit der linken Maustaste auf das Steuerelement geklickt wird.
protected OnLeftMouseClick ( MouseEventArgs args ) : void
args MouseEventArgs Weitere Informationen zum Ereignis.
return void

OnLeftMouseDoubleClick() protected method

protected OnLeftMouseDoubleClick ( MouseEventArgs args ) : void
args MouseEventArgs
return void

OnLeftMouseDown() protected method

Wird aufgerufen, wenn die linke Maustaste heruntergedrückt wird.
protected OnLeftMouseDown ( MouseEventArgs args ) : void
args MouseEventArgs Weitere Informationen zum Event.
return void

OnLeftMouseUp() protected method

Wird aufgerufen, wenn die linke Maustaste losgelassen wird.
protected OnLeftMouseUp ( MouseEventArgs args ) : void
args MouseEventArgs Weitere Informationen zum Event.
return void

OnLostFocus() protected method

protected OnLostFocus ( EventArgs args ) : void
args System.EventArgs
return void

OnMouseEnter() protected method

protected OnMouseEnter ( MouseEventArgs args ) : void
args MouseEventArgs
return void

OnMouseLeave() protected method

protected OnMouseLeave ( MouseEventArgs args ) : void
args MouseEventArgs
return void

OnMouseMove() protected method

protected OnMouseMove ( MouseEventArgs args ) : void
args MouseEventArgs
return void

OnMouseScroll() protected method

protected OnMouseScroll ( MouseScrollEventArgs args ) : void
args MouseScrollEventArgs
return void

OnParentChanged() protected method

Der Parent dieses Controls hat sich geändert.
protected OnParentChanged ( PropertyEventArgs args ) : void
args PropertyEventArgs
return void

OnPreDraw() protected method

protected OnPreDraw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

OnRemoveControl() protected method

Ein Control wurde aus der Children-Liste entfernt.
protected OnRemoveControl ( CollectionEventArgs args ) : void
args CollectionEventArgs
return void

OnResolutionChanged() public method

Wird aufgerufen, wenn die Auflösung des Fensters geändert wird.
public OnResolutionChanged ( ) : void
return void

OnRightMouseClick() protected method

Wird aufgerufen, wenn mit der rechten Maustaste auf das Steuerelement geklickt wird.
protected OnRightMouseClick ( MouseEventArgs args ) : void
args MouseEventArgs Weitere Informationen zum Ereignis.
return void

OnRightMouseDoubleClick() protected method

protected OnRightMouseDoubleClick ( MouseEventArgs args ) : void
args MouseEventArgs
return void

OnRightMouseDown() protected method

Wird aufgerufen, wenn die rechte Maustaste heruntergedrückt wird.
protected OnRightMouseDown ( MouseEventArgs args ) : void
args MouseEventArgs Weitere Informationen zum Event.
return void

OnRightMouseUp() protected method

Wird aufgerufen, wenn die rechte Maustaste losgelassen wird.
protected OnRightMouseUp ( MouseEventArgs args ) : void
args MouseEventArgs Weitere Informationen zum Event.
return void

OnStartDrag() protected method

protected OnStartDrag ( DragEventArgs args ) : void
args DragEventArgs
return void

OnTabOrderChanged() protected method

protected OnTabOrderChanged ( PropertyEventArgs args ) : void
args PropertyEventArgs
return void

OnTabStopChanged() protected method

protected OnTabStopChanged ( PropertyEventArgs args ) : void
args PropertyEventArgs
return void

OnTouchDoubleTap() protected method

protected OnTouchDoubleTap ( TouchEventArgs args ) : void
args TouchEventArgs
return void

OnTouchDown() protected method

protected OnTouchDown ( TouchEventArgs args ) : void
args TouchEventArgs
return void

OnTouchMove() protected method

protected OnTouchMove ( TouchEventArgs args ) : void
args TouchEventArgs
return void

OnTouchTap() protected method

protected OnTouchTap ( TouchEventArgs args ) : void
args TouchEventArgs
return void

OnTouchUp() protected method

protected OnTouchUp ( TouchEventArgs args ) : void
args TouchEventArgs
return void

OnUpdate() protected method

protected OnUpdate ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

OnVisibleChanged() protected method

protected OnVisibleChanged ( PropertyEventArgs args ) : void
args PropertyEventArgs
return void

OnZOrderChanged() protected method

protected OnZOrderChanged ( PropertyEventArgs args ) : void
args PropertyEventArgs
return void

PreDraw() public method

public PreDraw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void

SetActualSize() public method

Legt die tatsächliche Größe für dieses Control fest.
public SetActualSize ( Point available ) : void
available Point Erwartete Größe des Controls (inkl. Borders)
return void

SetDimension() protected method

Führt eine automatische Anordnung auf Basis der aktuellen Size und den Alignment-Parametern durch.
protected SetDimension ( Point actualSize, Point containerSize ) : void
actualSize Point
containerSize Point
return void

StartTransition() public method

public StartTransition ( Transition transition ) : void
transition Transition
return void

Unfocus() public method

Entfernt den Fokus.
public Unfocus ( ) : void
return void

Update() public method

public Update ( GameTime gameTime ) : void
gameTime GameTime
return void