## Boolean Widgets

Boolean widgets are those widgets that are able to display or write boolean value to a PV or one of its bits. For example: LED, Boolean Button, Boolean Switch and Image Boolean Button. Boolean widgets only accept numeric or enum PV. It will convert double or float number to Long Integer before processing it.

### Operations Common to Boolean Control Widgets

For a toggled boolean control widget which has its `Toggle Button` property set as yes, pressing left mouse button to change its state. It will remain its state after left mouse button released. For a not toggled boolean control widget, pressing left mouse button to turn it on and releasing the left mouse button to turn it off. It remains ON while left mouse button is pressed.

### Properties Common to Boolean Widgets

- Data Type (data_type)
    The data type to be operated by this widget, which could be `Bit` or `Enum`. If it is `Bit`, the widget will write 0/1 to the corresponding bit (specified by `Bit` property) of the PV. If it is ENUM, it will read/write the `On State` or `Off State` property value to the PV.
- Bit (bit)
    Which bit of the PV value to read and write. If this is -1 or any negative number, it will read non-zero value as true and zero as false, and it will write value 0/1 to the whole PV value.
- On State (on_state)
    If data type is Enum, it will read PV value as true if PV's string value equals this property, otherwise, it reads PV value as false. And it will write this string to the PV when this widget is set to on.
- Off State (off_state)
    If data type is Enum, it will write this string to PV when this widget is set to off.
- On Label (on_label)
    The label text when the widget is on.
- Off Label (off_label)
    The label text when the widget is off.
- On Color (on_color)
    Color of the widget when it is on.
- Off Color (off_color)
    Color of the widget when it is off.
- Show Boolean Label (show_boolean_label)
    If the boolean label should be visible.
- Effect 3D (effect_3D)
    Draw widget with advanced graphics to make 3D effect. In some platforms, advance graphics may not be available, in which case the widget will not be drawn with advanced graphics even this is set to yes. The advance graphics function can also be disabled from Preference Settings.

### Properties Common to Boolean Control Widgets

Boolean Control Widgets are those boolean widgets that able to write value to a PV.

- Toggle Button (toggle_button)
    If yes, this widget will toggle to the state after pressing on it. If not, this widget will back to the origin state when mouse is released.
- Push Action Index / Click Action Index (push_action_index)
    Index of the action to be executed when widget is pushed. The actions are configured in `Actions` property.
- Release Action Index (release_action_index)
    Index of the action to be executed when mouse on the widget is released. The actions are configured in `Actions` property.
- Show Confirm Dialog (show_confirm_dialog)
    Show a confirm dialog when widget is operated. If `Password` property is not empty, it will show a password input dialog.
- Confirm Message (confirm_message)
    The message to be displayed in the confirm dialog.
- Password (password)
    The password needed to perform operations on the widget if `Show Confirm Dialog` is `Yes`.

### See Also

- Properties Common to PV Widgets
- Properties Common to All Widgets