SelectBox ClassDelta Engine Documentation
Allows one value to be selected from a dropdown list of values View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    DeltaEngine.Entities DrawableEntity
      DeltaEngine.Rendering2D Entity2D
        DeltaEngine.Rendering2D HierarchyEntity2D
          DeltaEngine.Rendering2D Sprite
            DeltaEngine.Scenes.Controls Control
              DeltaEngine.Scenes.Controls Picture
                DeltaEngine.Scenes.Controls SelectBox

Namespace: DeltaEngine.Scenes.Controls
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class SelectBox : Picture

The SelectBox type exposes the following members.

Constructors

  NameDescription
Protected methodSelectBox 
Initializes a new instance of the SelectBox class
Public methodSelectBox(Rectangle, List Object )
Initializes a new instance of the SelectBox class
Public methodSelectBox(Theme, Rectangle, List Object )
Initializes a new instance of the SelectBox class
Top
Methods

  NameDescription
Public methodAdd(HierarchyObject2D) (Inherited from HierarchyEntity2D.)
Public methodAdd T (T) (Inherited from Sprite.)
Protected methodAddChild (Inherited from Control.)
Public methodAddTag (Inherited from Entity.)
Public methodClearTags (Inherited from Entity.)
Public methodClick (Inherited from Control.)
Public methodContains T  (Inherited from Entity2D.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Inherited from Entity.)
Public methodGet T  (Inherited from Sprite.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Public methodGetComponentsForEditing (Inherited from Entity2D.)
Protected methodGetComponentsForSaving (Inherited from Sprite.)
Protected methodGetDrawBehaviors (Inherited from DrawableEntity.)
Public methodGetFirstChildOfType T  (Inherited from HierarchyEntity2D.)
Public methodGetInterpolatedArray T  (Inherited from DrawableEntity.)
Public methodGetInterpolatedList T  (Inherited from DrawableEntity.)
Public methodGetLevel (Inherited from Control.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Protected methodNextUpdateStarted (Inherited from Sprite.)
Public methodOnDraw T  (Inherited from DrawableEntity.)
Protected methodOnPositionChanged (Inherited from HierarchyEntity2D.)
Protected methodOnRotationChanged (Inherited from HierarchyEntity2D.)
Public methodRemove(HierarchyObject2D) (Inherited from HierarchyEntity2D.)
Public methodRemove T   (Inherited from Entity.)
Protected methodRemoveChild (Inherited from Control.)
Public methodRemoveTag (Inherited from Entity.)
Public methodReset (Inherited from Sprite.)
Public methodRotatedDrawAreaContains (Inherited from Entity2D.)
Public methodSet (Overrides Sprite Set(Object).)
Public methodSetAppearance (Inherited from Picture.)
Public methodSetAppearanceWithoutInterpolation (Inherited from Picture.)
Public methodSetComponents (Inherited from Entity.)
Public methodSetWithoutInterpolation T  (Inherited from Sprite.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodToggleVisibility (Inherited from Control.)
Public methodToString (Inherited from Entity.)
Public methodUpdate (Overrides Control Update .)
Public methodUpdateGlobalsFromParent (Inherited from HierarchyEntity2D.)
Top
Extension Methods

  NameDescription
Public Extension MethodAffixToPhysics (Defined by Entity2DPhysicsExtensions.)
Public Extension MethodStartBouncingOffScreenEdges (Defined by Entity2DExtensions.)
Public Extension MethodStartFalling (Defined by Entity2DExtensions.)
Public Extension MethodStartMoving (Defined by Entity2DExtensions.)
Public Extension MethodStartMovingUV (Defined by Entity2DExtensions.)
Public Extension MethodStartRotating (Defined by Entity2DExtensions.)
Top
Fields

  NameDescription
Public fieldClicked (Inherited from Control.)
Protected fieldcomponents (Inherited from Entity.)
Protected fieldlastTickLerpComponents
Each element can either be a Lerp, a Lerp List or an array of Lerp objects. View code on GitHub
(Inherited from DrawableEntity.)
Public fieldLineClicked
Top
Properties

  NameDescription
Public propertyAlpha (Inherited from Entity2D.)
Public propertyBlendMode (Inherited from Sprite.)
Public propertyBottomMargin (Inherited from Control.)
Public propertyCenter (Inherited from Entity2D.)
Public propertyChildren (Inherited from HierarchyEntity2D.)
Public propertyColor (Inherited from Entity2D.)
Public propertyCurrentFrame (Inherited from Sprite.)
Public propertyDidFootprintChange (Inherited from Entity2D.)
Public propertyDisplayCount
Public propertyDrawArea (Inherited from Entity2D.)
Public propertyElapsed (Inherited from Sprite.)
Public propertyFlipMode (Inherited from Sprite.)
Public propertyIsActive (Inherited from Control.)
Public propertyIsEnabled (Inherited from Control.)
Public propertyIsPauseable (Inherited from Control.)
Public propertyIsPlaying (Inherited from Sprite.)
Public propertyIsVisible (Inherited from DrawableEntity.)
Public propertyLastColor (Inherited from Entity2D.)
Public propertyLastDrawArea (Inherited from Entity2D.)
Public propertyLastUV (Inherited from Sprite.)
Public propertyLeftMargin (Inherited from Control.)
Public propertyMaterial (Inherited from Sprite.)
Public propertyMaxDisplayCount
Public propertyName (Inherited from Control.)
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyParent (Inherited from HierarchyEntity2D.)
Public propertyRelativePosition (Inherited from HierarchyEntity2D.)
Public propertyRelativeRotation (Inherited from HierarchyEntity2D.)
Public propertyRenderLayer (Inherited from DrawableEntity.)
Public propertyRightMargin (Inherited from Control.)
Public propertyRotation (Inherited from Entity2D.)
Public propertyRotationCenter (Inherited from Entity2D.)
Protected propertyScrollbar
Public propertySize (Inherited from Entity2D.)
Public propertyState (Inherited from Control.)
Public propertyTheme (Inherited from Picture.)
Public propertyTopLeft (Inherited from Entity2D.)
Public propertyTopMargin (Inherited from Control.)
Public propertyUpdatePriority (Inherited from Entity.)
Public propertyUV (Inherited from Sprite.)
Public propertyValues
Top
Events

  NameDescription
Public eventAnimationEnded (Inherited from Sprite.)
Top
Remarks

Tests: DeltaEngine.Scenes.Tests.Controls.SelectBoxTests
Examples

7 unit tests call DeltaEngine.Scenes.Controls.SelectBox
[Test]
public void RenderSelectBoxWithThreeValuesAndThreeLines()
{
    var text = new FontText(Font.Default, "", new Rectangle(0.4f, 0.7f, 0.2f, 0.1f));
    selectBox.LineClicked += lineNo => text.Text = selectBox.Values[lineNo] + " clicked";
}
[Test]
public void RenderSelectBoxWithTenValuesAndThreeLines()
{
    SetToTenValues();
    var text = new FontText(Font.Default, "", new Rectangle(0.4f, 0.7f, 0.2f, 0.1f));
    selectBox.LineClicked += lineNo => text.Text = selectBox.Values[lineNo] + " clicked";
}
[Test]
public void RenderSelectBoxAttachedToMouse()
{
    selectBox.Values = new List<object> { "value 1", "value 2", "value 3", "value 4" };
    new Command(
        point => selectBox.DrawArea = Rectangle.FromCenter(point, selectBox.DrawArea.Size)).Add(
            new MouseMovementTrigger());
}
See Also