| 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.Dial
Contents
Description
Dial widget, used for interacting with numeric values. It allows changing the value using the keyboard arrows, dragging the mouse or using the wheel.
dial numericLens 0 100
Similar in objective to Monomer.Widgets.Singles.Slider, but uses less visual space in its parent container.
Synopsis
- type DialValue a = (Eq a, Show a, Real a, FromFractional a, Typeable a)
- data DialCfg s e a
- dial :: (DialValue a, WidgetEvent e) => ALens' s a -> a -> a -> WidgetNode s e
- dial_ :: (DialValue a, WidgetEvent e) => ALens' s a -> a -> a -> [DialCfg s e a] -> WidgetNode s e
- dialV :: (DialValue a, WidgetEvent e) => a -> (a -> e) -> a -> a -> WidgetNode s e
- dialV_ :: (DialValue a, WidgetEvent e) => a -> (a -> e) -> a -> a -> [DialCfg s e a] -> WidgetNode s e
- dialD_ :: (DialValue a, WidgetEvent e) => WidgetData s a -> a -> a -> [DialCfg s e a] -> WidgetNode s e
Configuration
type DialValue a = (Eq a, Show a, Real a, FromFractional a, Typeable a) Source #
Constraints for numeric types accepted by dial.
Configuration options for dial:
width: sets the max width/height of the dial.wheelRate: The rate at which wheel movement affects the number.dragRate: The rate at which drag movement affects the number.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.onChangeReq:WidgetRequestto generate when the value changes.
Instances
| Monoid (DialCfg s e a) Source # | |
| Semigroup (DialCfg s e a) Source # | |
| Default (DialCfg s e a) Source # | |
Defined in Monomer.Widgets.Singles.Dial | |
| CmbWidth (DialCfg s e a) Source # | |
| CmbDragRate (DialCfg s e a) Rational Source # | |
| CmbWheelRate (DialCfg s e a) Rational Source # | |
| WidgetEvent e => CmbOnBlur (DialCfg s e a) e Path Source # | |
| WidgetEvent e => CmbOnChange (DialCfg s e a) a e Source # | |
Defined in Monomer.Widgets.Singles.Dial | |
| WidgetEvent e => CmbOnFocus (DialCfg s e a) e Path Source # | |
| CmbOnBlurReq (DialCfg s e a) s e Path Source # | |
Defined in Monomer.Widgets.Singles.Dial | |
| CmbOnChangeReq (DialCfg s e a) s e a Source # | |
Defined in Monomer.Widgets.Singles.Dial Methods onChangeReq :: (a -> WidgetRequest s e) -> DialCfg s e a Source # | |
| CmbOnFocusReq (DialCfg s e a) s e Path Source # | |
Defined in Monomer.Widgets.Singles.Dial Methods onFocusReq :: (Path -> WidgetRequest s e) -> DialCfg s e a Source # | |
Constructors
Arguments
| :: (DialValue a, WidgetEvent e) | |
| => ALens' s a | The lens into the model. |
| -> a | Minimum value. |
| -> a | Maximum value. |
| -> WidgetNode s e | The created dial. |
Creates a dial using the given lens, providing minimum and maximum values.
Arguments
| :: (DialValue a, WidgetEvent e) | |
| => ALens' s a | The lens into the model. |
| -> a | Minimum value. |
| -> a | Maximum value. |
| -> [DialCfg s e a] | The config options. |
| -> WidgetNode s e | The created dial. |
Creates a dial using the given lens, providing minimum and maximum values. Accepts config.
Arguments
| :: (DialValue a, WidgetEvent e) | |
| => a | The current value. |
| -> (a -> e) | The event to raise on change. |
| -> a | Minimum value. |
| -> a | Maximum value. |
| -> WidgetNode s e | The created dial. |
Creates a dial using the given value and onChange event handler, providing
minimum and maximum values.
Arguments
| :: (DialValue a, WidgetEvent e) | |
| => a | The current value. |
| -> (a -> e) | The event to raise on change. |
| -> a | Minimum value. |
| -> a | Maximum value. |
| -> [DialCfg s e a] | The config options. |
| -> WidgetNode s e | The created dial. |
Creates a dial using the given value and onChange event handler, providing
minimum and maximum values.
Accepts config.
Arguments
| :: (DialValue a, WidgetEvent e) | |
| => WidgetData s a | The |
| -> a | Minimum value. |
| -> a | Maximum value. |
| -> [DialCfg s e a] | The config options. |
| -> WidgetNode s e | The created dial. |
Creates a dial providing a WidgetData instance, minimum and maximum values and
config.