Table of Contents

Class BorderedCheckBox

Namespace
RichHudFramework.UI
Assembly
RichHudClient.dll

Bordered checkbox designed to mimic the appearance of the checkbox used in the SE terminal.

Does not have a label. Use NamedCheckBox for a version with a label.

Formatting temporarily changes when it gains input focus.

public class BorderedCheckBox : Button, IReadOnlyHudElement, IReadOnlyHudNode, IReadOnlyHudParent, IClickableElement, IFocusableElement, IValueControl<bool>, IValueControl
Inheritance
BorderedCheckBox
Implements
Inherited Members

Examples

This creates a checkbox with a Label as a separate element, organized into a horizontal row with a HudChain. The visibility of the label is set equal to the value of the checkbox when it changes.

new HudChain(parent)
{
    // We want the container to grow to fit, but we don't want it
    // shrinking if we hide the label.
    SizingMode = HudChainSizingModes.ClampChainBoth,
    Spacing = 10f,
    CollectionContainer = 
    {
        // Checkbox without a label
        new BorderedCheckBox
        {
            // Show/hide label when ticked/unticked
            UpdateValueCallback = (obj, args) =>
            {
                var checkBox = (BorderedCheckBox)obj;
                var chain = (HudChain)checkBox.Parent;
                // Get the label after this checkbox in the chain
                chain[1].Element.Visible = checkBox.Value;
            },
            // Add a custom tooltip
            MouseInput =
            {
                ToolTip = "This shows/hides the label."
            }
        },
        // Add a label to the right of the checkbox
        new Label()
    }
};

Constructors

BorderedCheckBox()

public BorderedCheckBox()

BorderedCheckBox(HudParentBase)

public BorderedCheckBox(HudParentBase parent)

Parameters

parent HudParentBase

Properties

BorderColor

Color of the border surrounding the button

public Color BorderColor { get; set; }

Property Value

Color

BorderThickness

Thickness of the border surrounding the button

public float BorderThickness { get; set; }

Property Value

float

FocusColor

Background color used when the control gains focus.

public Color FocusColor { get; set; }

Property Value

Color

TickBoxColor

Tickbox default color

public Color TickBoxColor { get; set; }

Property Value

Color

TickBoxFocusColor

Tickbox focus color

public Color TickBoxFocusColor { get; set; }

Property Value

Color

TickBoxHighlightColor

Tickbox highlight color

public Color TickBoxHighlightColor { get; set; }

Property Value

Color

UpdateValueCallback

Registers a value (Value) update callback. Useful in initializers.

public EventHandler UpdateValueCallback { set; }

Property Value

EventHandler

UseFocusFormatting

If true, then the button will change formatting when it takes focus.

public bool UseFocusFormatting { get; set; }

Property Value

bool

Value

Indicates whether or not the box is checked.

public bool Value { get; set; }

Property Value

bool

Events

ValueChanged

Invoked when the current value (Value) changes

public event EventHandler ValueChanged

Event Type

EventHandler