| Copyright | (c) 2018 Francisco Vallarino |
|---|---|
| License | BSD-3-Clause (see the LICENSE file) |
| Maintainer | fjvallarino@gmail.com |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Monomer.Widgets.Singles.Checkbox
Contents
Description
Checkbox widget, used for interacting with boolean values. It does not include text, which can be added with a label in the desired position (usually with hstack/vstack). Alternatively, Monomer.Widgets.Singles.LabeledCheckbox provides this functionality out of the box.
checkbox booleanLens
Monomer.Widgets.Singles.ToggleButton provides similar functionality but with the look of a regular button.
Synopsis
- data CheckboxCfg s e
- class CmbCheckboxMark t where
- checkboxMark :: CheckboxMark -> t
- checkboxSquare :: t
- checkboxTimes :: t
- data CheckboxMark
- checkbox :: WidgetEvent e => ALens' s Bool -> WidgetNode s e
- checkbox_ :: WidgetEvent e => ALens' s Bool -> [CheckboxCfg s e] -> WidgetNode s e
- checkboxV :: WidgetEvent e => Bool -> (Bool -> e) -> WidgetNode s e
- checkboxV_ :: WidgetEvent e => Bool -> (Bool -> e) -> [CheckboxCfg s e] -> WidgetNode s e
- checkboxD_ :: WidgetEvent e => WidgetData s Bool -> [CheckboxCfg s e] -> WidgetNode s e
Configuration
data CheckboxCfg s e Source #
Configuration options for checkbox:
checkboxMark: the type of checkbox mark.checkboxSquare: square checkbox mark.checkboxTimes: times/x checkbox mark.width: sets the max width/height of the checkbox.onFocus: event to raise when focus is received.onFocusReq:WidgetRequestto generate when focus is received.onBlur: event to raise when focus is lost.onBlurReq:WidgetRequestto generate when focus is lost.onChange: event to raise when the value changes/is clicked.onChangeReq:WidgetRequestto generate when the value changes/is clicked.
Instances
class CmbCheckboxMark t where Source #
Sets the type of checkbox mark.
Methods
checkboxMark :: CheckboxMark -> t Source #
checkboxSquare :: t Source #
checkboxTimes :: t Source #
Instances
| CmbCheckboxMark (CheckboxCfg s e) Source # | |
Defined in Monomer.Widgets.Singles.Checkbox Methods checkboxMark :: CheckboxMark -> CheckboxCfg s e Source # checkboxSquare :: CheckboxCfg s e Source # checkboxTimes :: CheckboxCfg s e Source # | |
| CmbCheckboxMark (LabeledCheckboxCfg s e) Source # | |
Defined in Monomer.Widgets.Singles.LabeledCheckbox Methods checkboxMark :: CheckboxMark -> LabeledCheckboxCfg s e Source # checkboxSquare :: LabeledCheckboxCfg s e Source # checkboxTimes :: LabeledCheckboxCfg s e Source # | |
data CheckboxMark Source #
Type of drawing for the checkbox mark.
Constructors
| CheckboxSquare | |
| CheckboxTimes |
Instances
| Show CheckboxMark Source # | |
Defined in Monomer.Widgets.Singles.Checkbox Methods showsPrec :: Int -> CheckboxMark -> ShowS # show :: CheckboxMark -> String # showList :: [CheckboxMark] -> ShowS # | |
| Eq CheckboxMark Source # | |
Defined in Monomer.Widgets.Singles.Checkbox | |
Constructors
Arguments
| :: WidgetEvent e | |
| => ALens' s Bool | The lens into the model. |
| -> WidgetNode s e | The created checkbox. |
Creates a checkbox using the given lens.
Arguments
| :: WidgetEvent e | |
| => ALens' s Bool | The lens into the model. |
| -> [CheckboxCfg s e] | The config options. |
| -> WidgetNode s e | The created checkbox. |
Creates a checkbox using the given lens. Accepts config.
Arguments
| :: WidgetEvent e | |
| => Bool | The current value. |
| -> (Bool -> e) | The event to raise on change. |
| -> WidgetNode s e | The created checkbox. |
Creates a checkbox using the given value and onChange event handler.
Arguments
| :: WidgetEvent e | |
| => Bool | The current value. |
| -> (Bool -> e) | The event to raise on change. |
| -> [CheckboxCfg s e] | The config options. |
| -> WidgetNode s e | The created checkbox. |
Creates a checkbox using the given value and onChange event handler. Accepts
config.
Arguments
| :: WidgetEvent e | |
| => WidgetData s Bool | The |
| -> [CheckboxCfg s e] | The config options. |
| -> WidgetNode s e | The created checkbox. |
Creates a checkbox providing a WidgetData instance and config.