Function Repository Resource:

CheckboxBarSelectAll

Source Notebook

A version of CheckboxBar which includes a “Select all” checkbox

Contributed by: Jon McLoone

ResourceFunction["CheckboxBarSelectAll"][Dynamic[x],{val1,val2,,}]

takes the setting to be the dynamically-updated current value of x, with possible values {val1,val2,,} and the value x being reset every time a checkbox is clicked.

ResourceFunction["CheckboxBarSelectAll"][x,{val1lbl1,val2lbl2,}]

represents a checkbox bar in which the checkbox associated with value vali has label lbli.

Details and Options

The following options are accepted:
ControlPlacementTopwhere to place the "Select all" checkbox
"Label""Select all"the text to label the "Select all" checkbox with
ControlPlacement must be one of Left, Right, Top or Bottom.

Examples

Basic Examples (2) 

A selector for three possible values:

In[1]:=
ResourceFunction["CheckboxBarSelectAll"][Dynamic[x], {1, 2, 3}]
Out[1]=

A selector for three possible labeled values:

In[2]:=
ResourceFunction["CheckboxBarSelectAll"][
 Dynamic[x], {1 -> "one", 2 -> "two", 3 -> "three"}]
Out[2]=

Options (3) 

Using ControlPlacement with values Left, Right, Top or Bottom places the "Select all" checkbox:

In[3]:=
ResourceFunction["CheckboxBarSelectAll"][Dynamic[x], {1, 2, 3}, ControlPlacement -> Left]
Out[3]=

The "Select all" checkbox label can be changed with "Label":

In[4]:=
ResourceFunction["CheckboxBarSelectAll"][Dynamic[x], {1, 2, 3}, "Label" -> "All"]
Out[4]=

All options of CheckboxBar are supported:

In[5]:=
ResourceFunction["CheckboxBarSelectAll"][Dynamic[x], {1, 2, 3}, Appearance -> "Vertical"]
Out[5]=

Publisher

Jon McLoone

Version History

  • 1.0.0 – 10 July 2019

License Information