Copyright | (c) 2018 Francisco Vallarino |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | fjvallarino@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
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](Monomer.Widgets.Containers.Stack)). 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
:WidgetRequest
to generate when focus is received.onBlur
: event to raise when focus is lost.onBlurReq
:WidgetRequest
to generate when focus is lost.onChange
: event to raise when the value changes/is clicked.onChangeReq
:WidgetRequest
to generate when the value changes/is clicked.
Instances
class CmbCheckboxMark t where Source #
Sets the type of checkbox mark.
Instances
CmbCheckboxMark (CheckboxCfg s e) Source # | |
Defined in Monomer.Widgets.Singles.Checkbox 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 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.
Instances
Eq CheckboxMark Source # | |
Defined in Monomer.Widgets.Singles.Checkbox (==) :: CheckboxMark -> CheckboxMark -> Bool # (/=) :: CheckboxMark -> CheckboxMark -> Bool # | |
Show CheckboxMark Source # | |
Defined in Monomer.Widgets.Singles.Checkbox showsPrec :: Int -> CheckboxMark -> ShowS # show :: CheckboxMark -> String # showList :: [CheckboxMark] -> ShowS # |
Constructors
checkbox :: WidgetEvent e => ALens' s Bool -> WidgetNode s e Source #
Creates a checkbox using the given lens.
checkbox_ :: WidgetEvent e => ALens' s Bool -> [CheckboxCfg s e] -> WidgetNode s e Source #
Creates a checkbox using the given lens. Accepts config.
checkboxV :: WidgetEvent e => Bool -> (Bool -> e) -> WidgetNode s e Source #
Creates a checkbox using the given value and onChange
event handler.
checkboxV_ :: WidgetEvent e => Bool -> (Bool -> e) -> [CheckboxCfg s e] -> WidgetNode s e Source #
Creates a checkbox using the given value and onChange
event handler. Accepts
config.
checkboxD_ :: WidgetEvent e => WidgetData s Bool -> [CheckboxCfg s e] -> WidgetNode s e Source #
Creates a checkbox providing a WidgetData
instance and config.