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 |
Labeled checkbox, used for interacting with boolean values. In contrast to
checkbox
, it includes a clickable label.
labeledCheckbox "Bool value" booleanLens
With text in a different location:
labeledCheckbox_ "Checkbox with text below" booleanLens [textBottom]
Synopsis
- data LabeledCheckboxCfg s e
- labeledCheckbox :: WidgetEvent e => Text -> ALens' s Bool -> WidgetNode s e
- labeledCheckbox_ :: WidgetEvent e => Text -> ALens' s Bool -> [LabeledCheckboxCfg s e] -> WidgetNode s e
- labeledCheckboxV :: WidgetEvent e => Text -> Bool -> (Bool -> e) -> WidgetNode s e
- labeledCheckboxV_ :: WidgetEvent e => Text -> Bool -> (Bool -> e) -> [LabeledCheckboxCfg s e] -> WidgetNode s e
- labeledCheckboxD_ :: WidgetEvent e => Text -> WidgetData s Bool -> [LabeledCheckboxCfg s e] -> WidgetNode s e
Configuration
data LabeledCheckboxCfg s e Source #
Configuration options for labeledCheckbox:
General
childSpacing
: the spacing between the checkbox and the text.
Text related
textLeft
: places the label to the left of the checkbox.textRight
: places the label to the right of the checkbox.textTop
: places the label to the top of the checkbox.textBottom
: places the label to the bottom of the checkbox.trimSpaces
: whether to remove leading/trailing spaces in the caption.ellipsis
: if ellipsis should be used for overflown text.multiline
: if text may be split in multiple lines.maxLines
: maximum number of text lines to show.resizeFactor
: flexibility to have more or less space assigned.resizeFactorW
: flexibility for more or less horizontal space assigned.resizeFactorH
: flexibility for more or less vertical space assigned.
Checkbox related
checkboxMark
: the type of 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
Constructors
:: WidgetEvent e | |
=> Text | The caption. |
-> ALens' s Bool | The lens into the model. |
-> WidgetNode s e | The created labeled checkbox. |
Creates a labeled checkbox using the given lens.
:: WidgetEvent e | |
=> Text | The caption. |
-> ALens' s Bool | The lens into the model. |
-> [LabeledCheckboxCfg s e] | The config options. |
-> WidgetNode s e | The created labeled checkbox. |
Creates a labeled checkbox using the given lens. Accepts config.
:: WidgetEvent e | |
=> Text | The caption. |
-> Bool | The current value. |
-> (Bool -> e) | The event to raise on change. |
-> WidgetNode s e | The created labeled checkbox. |
Creates a labeled checkbox using the given value and onChange
event
handler.
:: WidgetEvent e | |
=> Text | The caption. |
-> Bool | The current value. |
-> (Bool -> e) | The event to raise on change. |
-> [LabeledCheckboxCfg s e] | The config options. |
-> WidgetNode s e | The created labeled checkbox. |
Creates a labeled checkbox using the given value and onChange
event handler.
Accepts config.
:: WidgetEvent e | |
=> Text | The caption. |
-> WidgetData s Bool | The |
-> [LabeledCheckboxCfg s e] | The config options. |
-> WidgetNode s e | The created labeled checkbox. |
Creates a labeled checkbox providing a WidgetData
instance and config.