Vixen
02b45cc4
csharp
public sealed class CheckBox

A box that is ticked or not, with a label.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Three elements: the box, the tick inside it, and the label. The tick is an Icon rather than something drawn here, so that a theme can replace it with its own geometry, and it is present in the tree whether or not the box is ticked — the stylesheet hides it with display: none, which costs nothing and keeps "is it ticked" a single fact in a single place.

Indeterminate is a third appearance rather than a third value. IsChecked stays a bool, because a tri-state checkbox that a caller has to handle three cases for is a tri-state checkbox nobody handles all three cases for. What IsIndeterminate means is "the box does not currently reflect IsChecked, because the things it stands for disagree" — the parent of a half-ticked list — and clicking it resolves it, which is what it is for.

Fields and properties (4)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • public bool IsIndeterminate
  • public UiElement Box

    The box the tick is drawn in.

  • public static readonly UiPropertyKey IsIndeterminateProperty

    Identity for IsIndeterminate.

Methods (3)

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • protected override void Activate(ActivationDevice device, int count, ModifierKeys modifiers)

    What activation means for this control.

  • public void ClearIsIndeterminate()

    Unsets IsIndeterminate, so it takes its default or its ancestor's value again.

Used by (27)

  • ShellHelloUi
  • DocumentBenchmarksVixen.Benchmarks.Ui
  • ButtonTestsVixen.Ui.Controls.Tests
  • ControlVisualTestsVixen.Ui.Controls.Tests
  • DisabledStateTestsVixen.Ui.Controls.Tests
  • NodePortEditorVixen.Ui.Controls.Advanced
  • PropertyGridVixen.Ui.Controls.Advanced
  • PropertyGridTestsVixen.Ui.Controls.Advanced.Tests
  • ToggleInteractionTestsVixen.Ui.Controls.Tests
  • AnimationGraphViewVixen.Editor.AssetEditors
  • BooleanDrawerVixen.Editor.Inspector
  • ChromeFixtureVixen.Editor.Ui.Tests
  • CompiledSceneViewVixen.Editor.AssetEditors
  • CompositorViewVixen.Editor.AssetEditors
  • DrawerTestsVixen.Editor.Inspector.Tests
  • EditorApplicationVixen.Editor.App
  • FontViewVixen.Editor.AssetEditors
  • InputActionsViewVixen.Editor.AssetEditors
  • MarkupBindingVixen.Editor.Inspector
  • NodeInspectorVixen.Editor.NodeGraph
  • OptionalDrawerVixen.Editor.Inspector
  • OptionalEditorVixen.Editor.Inspector
  • OverrideCellVixen.Editor.AssetEditors
  • PortValueTestsVixen.Editor.NodeGraph.Tests
  • SequenceViewVixen.Editor.AssetEditors
  • TargetOverrideMatrixVixen.Editor.AssetEditors
  • TerrainModuleVixen.Editor.Terrain