Search Results for

    Show / Hide Table of Contents

    Class CheckBox

    Check box control.

    Inheritance
    System.Object
    Control
    CheckBox
    Implements
    System.IComparable
    IDrawable
    Inherited Members
    Control.Resize(Float2)
    Control.UpdateBounds()
    Control.UpdateTransform()
    Control.SetAnchorPreset(AnchorPresets, Boolean, Boolean)
    Control.Dispose()
    Control.Update(Single)
    Control.PerformLayout(Boolean)
    Control.ClearState()
    Control.Focus()
    Control.Defocus()
    Control.OnGotFocus()
    Control.OnStartContainsFocus()
    Control.OnEndContainsFocus()
    Control.Focus(Control)
    Control.StartMouseCapture(Boolean)
    Control.EndMouseCapture()
    Control.OnEndMouseCapture()
    Control.GetNavTarget(NavDirection)
    Control.GetNavOrigin(NavDirection)
    Control.OnNavigate(NavDirection, Float2, Control, List<Control>)
    Control.NavigationFocus()
    Control.OnMouseEnter(Float2)
    Control.OnMouseWheel(Float2, Single)
    Control.OnCharInput(Char)
    Control.OnKeyDown(KeyboardKeys)
    Control.OnKeyUp(KeyboardKeys)
    Control.IsTouchPointerOver(Int32)
    Control.OnTouchEnter(Float2, Int32)
    Control.OnTouchMove(Float2, Int32)
    Control.OnTouchLeave(Int32)
    Control.OnDragEnter(Float2, DragData)
    Control.OnDragMove(Float2, DragData)
    Control.OnDragDrop(Float2, DragData)
    Control.OnDragLeave()
    Control.DoDragDrop(DragData)
    Control.LinkTooltip(String, Tooltip)
    Control.UnlinkTooltip()
    Control.OnShowTooltip(String, Float2, Rectangle)
    Control.OnTooltipShown(Tooltip)
    Control.OnTestTooltipOverControl(Float2)
    Control.RayCast(Float2, Control)
    Control.IntersectsContent(Float2, Float2)
    Control.PointToParent(ContainerControl, Float2)
    Control.PointToParent(Float2)
    Control.PointToParent(Float2)
    Control.PointFromParent(Float2)
    Control.PointFromParent(Float2)
    Control.PointFromParent(ContainerControl, Float2)
    Control.PointToWindow(Float2)
    Control.PointFromWindow(Float2)
    Control.PointToScreen(Float2)
    Control.PointFromScreen(Float2)
    Control.OnLocationChanged()
    Control.SetScaleInternal(Float2)
    Control.SetPivotInternal(Float2)
    Control.SetShearInternal(Float2)
    Control.SetRotationInternal(Single)
    Control.OnVisibleChanged()
    Control.OnParentChangedInternal()
    Control.AddUpdateCallbacks(RootControl)
    Control.RemoveUpdateCallbacks(RootControl)
    Control.SetUpdate(Control.UpdateDelegate, Control.UpdateDelegate)
    Control.OnParentResized()
    Control.OnDestroy()
    Control.CompareTo(Object)
    Control.Compare(Control)
    Control.Top
    Control.Bottom
    Control.Left
    Control.Right
    Control.UpperLeft
    Control.UpperRight
    Control.BottomRight
    Control.BottomLeft
    Control.Scale
    Control.Pivot
    Control.Shear
    Control.Rotation
    Control.HasParent
    Control.BackgroundColor
    Control.BackgroundBrush
    Control.Enabled
    Control.EnabledInHierarchy
    Control.Visible
    Control.VisibleInHierarchy
    Control.IsDisposing
    Control.Root
    Control.RootWindow
    Control.DpiScale
    Control.ScreenPos
    Control.AutoFocus
    Control.ContainsFocus
    Control.IsFocused
    Control.IsNavFocused
    Control.IsMouseOver
    Control.IsTouchOver
    Control.IsDragOver
    Control.Tooltip
    Control.ShowTooltip
    Control.EditorBounds
    Control.LocationChanged
    Control.SizeChanged
    Control.ParentChanged
    Control.VisibleChanged
    Namespace: FlaxEngine.GUI
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [ActorToolbox("GUI")]
    public class CheckBox : Control, IComparable, IDrawable

    Constructors

    CheckBox()

    Initializes a new instance of the CheckBox class.

    Declaration
    public CheckBox()

    CheckBox(Single, Single, Boolean, Single)

    Initializes a new instance of the CheckBox class.

    Declaration
    public CheckBox(float x, float y, bool isChecked = false, float size = 18F)
    Parameters
    System.Single x

    The x.

    System.Single y

    The y.

    System.Boolean isChecked

    if set to true set checked on start.

    System.Single size

    The checkbox size.

    Fields

    _box

    The box rectangle.

    Declaration
    protected Rectangle _box
    Field Value
    Rectangle

    _boxSize

    The box size.

    Declaration
    protected float _boxSize
    Field Value
    System.Single

    _isPressed

    True if checked is being pressed (by mouse or touch).

    Declaration
    protected bool _isPressed
    Field Value
    System.Boolean

    _mouseOverBox

    The mouse over box state.

    Declaration
    protected bool _mouseOverBox
    Field Value
    System.Boolean

    _state

    The current state.

    Declaration
    protected CheckBoxState _state
    Field Value
    CheckBoxState

    Properties

    BorderColor

    Gets or sets the color of the border.

    Declaration
    [EditorDisplay("Border Style", null)]
    [EditorOrder(2012)]
    public Color BorderColor { get; set; }
    Property Value
    Color

    BorderColorHighlighted

    Gets or sets the border color when checkbox is hovered.

    Declaration
    [EditorDisplay("Border Style", null)]
    [EditorOrder(2013)]
    public Color BorderColorHighlighted { get; set; }
    Property Value
    Color

    BorderThickness

    Gets or sets the border thickness.

    Declaration
    [EditorDisplay("Border Style", null)]
    [EditorOrder(2011)]
    [Tooltip("The thickness of the border.")]
    [Limit(0F, 3.40282347E+38F, 1F)]
    public float BorderThickness { get; set; }
    Property Value
    System.Single

    BoxSize

    Gets or sets the size of the box.

    Declaration
    [EditorOrder(20)]
    public float BoxSize { get; set; }
    Property Value
    System.Single

    CheckedImage

    Gets or sets the image used to render checkbox checked state.

    Declaration
    [EditorDisplay("Image Style", null)]
    [EditorOrder(2021)]
    [Tooltip("The image used to render checkbox checked state.")]
    public IBrush CheckedImage { get; set; }
    Property Value
    IBrush

    HasBorder

    Gets or sets whether to have a border.

    Declaration
    [EditorDisplay("Border Style", null)]
    [EditorOrder(2010)]
    [Tooltip("Whether to have a border.")]
    [ExpandGroups]
    public bool HasBorder { get; set; }
    Property Value
    System.Boolean

    ImageColor

    Gets or sets the color of the checkbox icon.

    Declaration
    [EditorDisplay("Image Style", null)]
    [EditorOrder(2020)]
    [ExpandGroups]
    public Color ImageColor { get; set; }
    Property Value
    Color

    IntermediateImage

    Gets or sets the image used to render checkbox intermediate state.

    Declaration
    [EditorDisplay("Image Style", null)]
    [EditorOrder(2022)]
    [Tooltip("The image used to render checkbox intermediate state.")]
    public IBrush IntermediateImage { get; set; }
    Property Value
    IBrush

    State

    Gets or sets the state of the checkbox.

    Declaration
    [EditorOrder(10)]
    public CheckBoxState State { get; set; }
    Property Value
    CheckBoxState

    Methods

    ContainsPoint(ref Float2, Boolean)

    Checks if this control contains given point in local Control Space.

    Declaration
    public override bool ContainsPoint(ref Float2 location, bool precise = false)
    Parameters
    Float2 location

    Point location in Control Space to check

    System.Boolean precise

    True if perform precise intersection test against the control content (eg. with hit mask or transparency threshold). Otherwise, only simple bounds-check will be performed.

    Returns
    System.Boolean

    True if point is inside control's area, otherwise false.

    Overrides
    Control.ContainsPoint(ref Float2, Boolean)

    Draw()

    Draw control

    Declaration
    public override void Draw()
    Overrides
    Control.Draw()

    OnClick()

    Called when mouse or touch clicks the checkbox.

    Declaration
    protected virtual void OnClick()

    OnLostFocus()

    When control losts input focus

    Declaration
    public override void OnLostFocus()
    Overrides
    Control.OnLostFocus()

    OnMouseDoubleClick(Float2, MouseButton)

    When mouse double clicks over control's area

    Declaration
    public override bool OnMouseDoubleClick(Float2 location, MouseButton button)
    Parameters
    Float2 location

    Mouse location in Control Space

    MouseButton button

    Mouse buttons state (flags)

    Returns
    System.Boolean

    True if event has been handled, otherwise false

    Overrides
    Control.OnMouseDoubleClick(Float2, MouseButton)

    OnMouseDown(Float2, MouseButton)

    When mouse goes down over control's area

    Declaration
    public override bool OnMouseDown(Float2 location, MouseButton button)
    Parameters
    Float2 location

    Mouse location in Control Space

    MouseButton button

    Mouse buttons state (flags)

    Returns
    System.Boolean

    True if event has been handled, otherwise false

    Overrides
    Control.OnMouseDown(Float2, MouseButton)

    OnMouseLeave()

    When mouse leaves control's area

    Declaration
    public override void OnMouseLeave()
    Overrides
    Control.OnMouseLeave()

    OnMouseMove(Float2)

    When mouse moves over control's area

    Declaration
    public override void OnMouseMove(Float2 location)
    Parameters
    Float2 location

    Mouse location in Control Space

    Overrides
    Control.OnMouseMove(Float2)

    OnMouseUp(Float2, MouseButton)

    When mouse goes up over control's area

    Declaration
    public override bool OnMouseUp(Float2 location, MouseButton button)
    Parameters
    Float2 location

    Mouse location in Control Space

    MouseButton button

    Mouse buttons state (flags)

    Returns
    System.Boolean

    True if event has been handled, otherwise false

    Overrides
    Control.OnMouseUp(Float2, MouseButton)

    OnPressBegin()

    Called when checkbox starts to be pressed by the used (via mouse or touch).

    Declaration
    protected virtual void OnPressBegin()

    OnPressEnd()

    Called when checkbox ends to be pressed by the used (via mouse or touch).

    Declaration
    protected virtual void OnPressEnd()

    OnSizeChanged()

    Called when control size gets changed.

    Declaration
    protected override void OnSizeChanged()
    Overrides
    Control.OnSizeChanged()

    OnSubmit()

    Generic user interaction event for a control used by UI navigation (eg. user submits on the currently focused control).

    Declaration
    public override void OnSubmit()
    Overrides
    Control.OnSubmit()

    OnTouchDown(Float2, Int32)

    When touch enters control's area.

    Declaration
    public override bool OnTouchDown(Float2 location, int pointerId)
    Parameters
    Float2 location

    Touch location in Control Space.

    System.Int32 pointerId

    The touch pointer identifier. Stable for the whole touch gesture/interaction.

    Returns
    System.Boolean

    True if event has been handled, otherwise false.

    Overrides
    Control.OnTouchDown(Float2, Int32)

    OnTouchLeave()

    When all touch leaves control's area

    Declaration
    public override void OnTouchLeave()
    Overrides
    Control.OnTouchLeave()

    OnTouchUp(Float2, Int32)

    When touch goes up over control's area.

    Declaration
    public override bool OnTouchUp(Float2 location, int pointerId)
    Parameters
    Float2 location

    Touch location in Control Space

    System.Int32 pointerId

    The touch pointer identifier. Stable for the whole touch gesture/interaction.

    Returns
    System.Boolean

    True if event has been handled, otherwise false.

    Overrides
    Control.OnTouchUp(Float2, Int32)

    Toggle()

    Toggles the checked state.

    Declaration
    public void Toggle()

    Events

    StateChanged

    Event fired when 'checked' state gets changed.

    Declaration
    public event Action<CheckBox> StateChanged
    Event Type
    System.Action<CheckBox>

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)

    See Also

    Control
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat