Skip to content

Controls Static API

ArcaneWizardLibrary.Controls creates consistently styled selection controls with Library-owned artwork. The controls therefore look identical across supported Retail and Classic clients.

Checkbox

CreateCheckbox(parent, width, label, checked, onValueChanged)

Creates a checkbox based on ArcaneWizardLibrary_CheckboxTemplate.

ParameterTypeDescription
parentFrameParent frame for the checkbox.
widthnumberCheckbox width. Must be at least 44 pixels.
labelstringNon-empty displayed label.
checkedbooleanInitial checked state.
onValueChangedfunction | nilReceives checked and checkbox after a user changes the value.
lua
local checkbox = ArcaneWizardLibrary.Controls:CreateCheckbox(
  window.content,
  180,
  "Enable feature",
  true,
  function(checked)
    settings.featureEnabled = checked
  end
)
checkbox:SetPoint("TOPLEFT", 24, -24)

The returned checkbox supports the standard SetChecked, GetChecked, Enable, and Disable methods.

Option Group

CreateOptionGroup(parent, width, options, selectedValue, onValueChanged)

Creates a vertical group of mutually exclusive options based on ArcaneWizardLibrary_OptionButtonTemplate. Clicking the selected option does not clear it, so exactly one option remains selected.

ParameterTypeDescription
parentFrameParent frame for the option group.
widthnumberWidth of every option. Must be at least 44 pixels.
optionstable[]Ordered options containing unique label and value fields.
selectedValuestring | number | booleanInitial value matching one option.
onValueChangedfunction | nilReceives value, option, and group after a user changes the selection.
lua
local group = ArcaneWizardLibrary.Controls:CreateOptionGroup(
  window.content,
  180,
  {
    { label = "Account", value = "account" },
    { label = "Character", value = "character" }
  },
  "account",
  function(value)
    settings.scope = value
  end
)
group:SetPoint("TOPLEFT", 24, -64)

The returned group provides:

MethodDescription
GetValue()Returns the selected option value.
SetValue(value)Selects the matching option without calling onValueChanged.
SetEnabled(enabled)Enables or disables every option in the group.

Both controls provide normal, highlighted, pushed, selected, and disabled visuals without using client-specific Blizzard artwork.

Built with VitePress (MIT License).