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 radio widget, used for interacting with a fixed set of values. Each
instance of labeled radio is associated with a single value. In contrast to
radio
, it includes a clickable label.
labeledRadio "First option" Option1 optionLens
With text in a different location:
labeledRadio_ "Radio with text below" Option1 optionLens [textBottom]
Synopsis
- data LabeledRadioCfg s e a
- labeledRadio :: (RadioValue a, WidgetEvent e) => Text -> a -> ALens' s a -> WidgetNode s e
- labeledRadio_ :: (RadioValue a, WidgetEvent e) => Text -> a -> ALens' s a -> [LabeledRadioCfg s e a] -> WidgetNode s e
- labeledRadioV :: (RadioValue a, WidgetEvent e) => Text -> a -> a -> (a -> e) -> WidgetNode s e
- labeledRadioV_ :: (RadioValue a, WidgetEvent e) => Text -> a -> a -> (a -> e) -> [LabeledRadioCfg s e a] -> WidgetNode s e
- labeledRadioD_ :: (RadioValue a, WidgetEvent e) => Text -> a -> WidgetData s a -> [LabeledRadioCfg s e a] -> WidgetNode s e
Configuration
data LabeledRadioCfg s e a Source #
Configuration options for labeledRadio:
General
childSpacing
: the spacing between the radio and the text.
Text related
textLeft
: places the label to the left of the radio.textRight
: places the label to the right of the radio.textTop
: places the label to the top of the radio.textBottom
: places the label to the bottom of the radio.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.
Radio related
width
: sets the max width/height of the radio.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
:: (RadioValue a, WidgetEvent e) | |
=> Text | The caption. |
-> a | The option value. |
-> ALens' s a | The lens into the model. |
-> WidgetNode s e | The created labeled radio. |
Creates a labeled radio using the given lens.
:: (RadioValue a, WidgetEvent e) | |
=> Text | The caption. |
-> a | The option value. |
-> ALens' s a | The lens into the model. |
-> [LabeledRadioCfg s e a] | The config options. |
-> WidgetNode s e | The created labeled radio. |
Creates a labeled radio using the given lens. Accepts config.
:: (RadioValue a, WidgetEvent e) | |
=> Text | The caption. |
-> a | The option value. |
-> a | The current value. |
-> (a -> e) | The event to raise on change. |
-> WidgetNode s e | The created labeled radio. |
Creates a labeled radio using the given value and onChange
event handler.
:: (RadioValue a, WidgetEvent e) | |
=> Text | The caption. |
-> a | The option value. |
-> a | The current value. |
-> (a -> e) | The event to raise on change. |
-> [LabeledRadioCfg s e a] | The config options. |
-> WidgetNode s e | The created labeled radio. |
Creates a labeled radio using the given value and onChange
event handler.
Accepts config.
:: (RadioValue a, WidgetEvent e) | |
=> Text | The caption. |
-> a | The option value. |
-> WidgetData s a | The |
-> [LabeledRadioCfg s e a] | The config options. |
-> WidgetNode s e | The created labeled radio. |
Creates a labeled radio providing a WidgetData
instance and config.