| 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.LabeledCheckbox
Contents
Description
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 spaced assigned.resizeFactorW: flexibility for more or less horizontal spaced assigned.resizeFactorH: flexibility for more or less vertical spaced 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: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
Constructors
Arguments
| :: 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.
Arguments
| :: 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.
Arguments
| :: 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.
Arguments
| :: 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.
Arguments
| :: 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.