Table of Contents

Class NamedCheckBox

Namespace
RichHudFramework.UI
Assembly
RichHudClient.dll

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

Adds a label to BorderedCheckBox.

Formatting temporarily changes when it gains input focus.

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

Examples

new NamedCheckBox(parent)
{
    Name = "This checkbox has a label",
    // Write value to chat when it changes
    UpdateValueCallback = (obj, args) =>
        MyAPIGateway.Utilities.ShowMessage(
        $"[{obj.GetType().Name}]", // Print checkbox type
        $"Checkbox Value: {((NamedCheckBox)obj).Value}"),
    // Add a custom tooltip
    MouseInput =
    {
        ToolTip = "Click on this to change the value of the checkbox."
    }
};

Constructors

NamedCheckBox()

public NamedCheckBox()

NamedCheckBox(HudParentBase)

public NamedCheckBox(HudParentBase parent)

Parameters

parent HudParentBase

Properties

AutoResize

If true, the element will automatically resize to fit the text.

public bool AutoResize { get; set; }

Property Value

bool

BuilderMode

Line formatting mode used by the label.

public TextBuilderModes BuilderMode { get; set; }

Property Value

TextBuilderModes

FocusHandler

Interface for managing gaining/losing input focus

public IFocusHandler FocusHandler { get; }

Property Value

IFocusHandler

Format

Default formatting used by the label.

public GlyphFormat Format { get; set; }

Property Value

GlyphFormat

MouseInput

Checkbox mouse input

public IMouseInput MouseInput { get; }

Property Value

IMouseInput

Name

Text rendered by the label.

public RichText Name { get; set; }

Property Value

RichText

NameBuilder

TextBoard backing the label element.

public ITextBuilder NameBuilder { get; }

Property Value

ITextBuilder

TextPadding

Padding applied to the text element.

public Vector2 TextPadding { get; set; }

Property Value

Vector2

TextSize

Size of the text element sans padding.

public Vector2 TextSize { get; set; }

Property Value

Vector2

UpdateValueCallback

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

public EventHandler UpdateValueCallback { set; }

Property Value

EventHandler

Value

Indicates whether or not the box is checked.

public bool Value { get; set; }

Property Value

bool

VertCenterText

If true, the text will be vertically centered.

public bool VertCenterText { get; set; }

Property Value

bool

Events

ValueChanged

Invoked when the current value (Value) changes

public event EventHandler ValueChanged

Event Type

EventHandler