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
parentHudParentBase
Properties
AutoResize
If true, the element will automatically resize to fit the text.
public bool AutoResize { get; set; }
Property Value
BuilderMode
Line formatting mode used by the label.
public TextBuilderModes BuilderMode { get; set; }
Property Value
FocusHandler
Interface for managing gaining/losing input focus
public IFocusHandler FocusHandler { get; }
Property Value
Format
Default formatting used by the label.
public GlyphFormat Format { get; set; }
Property Value
MouseInput
Checkbox mouse input
public IMouseInput MouseInput { get; }
Property Value
Name
Text rendered by the label.
public RichText Name { get; set; }
Property Value
NameBuilder
TextBoard backing the label element.
public ITextBuilder NameBuilder { get; }
Property Value
TextPadding
Padding applied to the text element.
public Vector2 TextPadding { get; set; }
Property Value
TextSize
Size of the text element sans padding.
public Vector2 TextSize { get; set; }
Property Value
UpdateValueCallback
Registers a value (Value) update callback. Useful in initializers.
public EventHandler UpdateValueCallback { set; }
Property Value
Value
Indicates whether or not the box is checked.
public bool Value { get; set; }
Property Value
VertCenterText
If true, the text will be vertically centered.
public bool VertCenterText { get; set; }
Property Value
Events
ValueChanged
Invoked when the current value (Value) changes
public event EventHandler ValueChanged