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 |
Dial widget, used for interacting with numeric values. It allows changing the value by keyboard arrows, dragging the mouse or using the wheel.
Similar in objective to Monomer.Widgets.Singles.Slider, but uses less space.
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
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
: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.onChangeReq
:WidgetRequest
to generate when the value changes.
Instances
Semigroup (DialCfg s e a) Source # | |
Monoid (DialCfg s e a) Source # | |
Default (DialCfg s e a) Source # | |
Defined in Monomer.Widgets.Singles.Dial | |
CmbWidth (DialCfg s e a) Source # | |
CmbWheelRate (DialCfg s e a) Rational Source # | |
CmbDragRate (DialCfg s e a) Rational Source # | |
WidgetEvent e => CmbOnChange (DialCfg s e a) a e Source # | |
Defined in Monomer.Widgets.Singles.Dial | |
WidgetEvent e => CmbOnBlur (DialCfg s e a) e Path Source # | |
WidgetEvent e => CmbOnFocus (DialCfg s e a) e Path Source # | |
CmbOnChangeReq (DialCfg s e a) s e a Source # | |
Defined in Monomer.Widgets.Singles.Dial onChangeReq :: (a -> WidgetRequest s e) -> DialCfg s e a Source # | |
CmbOnBlurReq (DialCfg s e a) s e Path Source # | |
Defined in Monomer.Widgets.Singles.Dial | |
CmbOnFocusReq (DialCfg s e a) s e Path Source # | |
Defined in Monomer.Widgets.Singles.Dial onFocusReq :: (Path -> WidgetRequest s e) -> DialCfg s e a Source # |
Constructors
dial :: (DialValue a, WidgetEvent e) => ALens' s a -> a -> a -> WidgetNode s e Source #
Creates a dial using the given lens, providing minimum and maximum values.
dial_ :: (DialValue a, WidgetEvent e) => ALens' s a -> a -> a -> [DialCfg s e a] -> WidgetNode s e Source #
Creates a dial using the given lens, providing minimum and maximum values. Accepts config.
dialV :: (DialValue a, WidgetEvent e) => a -> (a -> e) -> a -> a -> WidgetNode s e Source #
Creates a dial using the given value and onChange
event handler, providing
minimum and maximum values.
dialV_ :: (DialValue a, WidgetEvent e) => a -> (a -> e) -> a -> a -> [DialCfg s e a] -> WidgetNode s e Source #
Creates a dial using the given value and onChange
event handler, providing
minimum and maximum values.
Accepts config.