monomer-1.6.0.1: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Monomer.Widgets.Singles.Base.InputField

Description

Base single line text editing field. Extensible for handling specific textual representations of other types, such as numbers and dates. It is not meant for direct use, but to create custom widgets using it.

See Monomer.Widgets.Singles.NumericField, Monomer.Widgets.Singles.DateField, Monomer.Widgets.Singles.TimeField and Monomer.Widgets.Singles.TextField.

Synopsis

Configuration

type InputFieldValue a = (Eq a, Show a, Typeable a) Source #

Constraints for a value handled by input field.

type InputWheelHandler a Source #

Arguments

 = InputFieldState a

The state of the input field

-> Point

The mouse position.

-> Point

The wheel movement along x/y.

-> WheelDirection

Whether movement is normal or inverted.

-> (Text, Int, Maybe Int)

New text, cursor position and selection start.

Handler for wheel events. Useful for values on which increase/decrease makes sense.

type InputDragHandler a Source #

Arguments

 = InputFieldState a

The state of the input field

-> Point

The mouse position.

-> Point

The wheel movement along x/y.

-> (Text, Int, Maybe Int)

New text, cursor position and selection start.

Handler for drag events. Useful for values on which increase/decrease makes sense.

data InputFieldCfg s e a Source #

Configuration options for an input field. These options are not directly exposed to users; each derived widget should expose its own options.

Constructors

InputFieldCfg 

Fields

data InputFieldState a Source #

Current state of the input field. Provided to some event handlers.

Constructors

InputFieldState 

Fields

Instances

Instances details
Generic (InputFieldState a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.Base.InputField

Associated Types

type Rep (InputFieldState a) :: Type -> Type #

Show a => Show (InputFieldState a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.Base.InputField

Eq a => Eq (InputFieldState a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.Base.InputField

type Rep (InputFieldState a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.Base.InputField

type Rep (InputFieldState a) = D1 ('MetaData "InputFieldState" "Monomer.Widgets.Singles.Base.InputField" "monomer-1.6.0.1-inplace" 'False) (C1 ('MetaCons "InputFieldState" 'PrefixI 'True) (((S1 ('MetaSel ('Just "_ifsPlaceholder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Seq TextLine)) :*: (S1 ('MetaSel ('Just "_ifsCurrValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "_ifsCurrText") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "_ifsCursorPos") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "_ifsSelStart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "_ifsDragSelValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a)))) :*: ((S1 ('MetaSel ('Just "_ifsGlyphs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Seq GlyphPos)) :*: (S1 ('MetaSel ('Just "_ifsOffset") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "_ifsTextRect") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Rect))) :*: ((S1 ('MetaSel ('Just "_ifsTextMetrics") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TextMetrics) :*: S1 ('MetaSel ('Just "_ifsHistory") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Seq (HistoryStep a)))) :*: (S1 ('MetaSel ('Just "_ifsHistIdx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "_ifsFocusStart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Millisecond))))))

data HistoryStep a Source #

Snapshot of a point in history of the input.

Instances

Instances details
Generic (HistoryStep a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.Base.InputField

Associated Types

type Rep (HistoryStep a) :: Type -> Type #

Methods

from :: HistoryStep a -> Rep (HistoryStep a) x #

to :: Rep (HistoryStep a) x -> HistoryStep a #

Show a => Show (HistoryStep a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.Base.InputField

Eq a => Eq (HistoryStep a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.Base.InputField

type Rep (HistoryStep a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.Base.InputField

type Rep (HistoryStep a) = D1 ('MetaData "HistoryStep" "Monomer.Widgets.Singles.Base.InputField" "monomer-1.6.0.1-inplace" 'False) (C1 ('MetaCons "HistoryStep" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_ihsValue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 a) :*: S1 ('MetaSel ('Just "_ihsText") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "_ihsCursorPos") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "_ihsSelStart") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "_ihsOffset") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)))))

Constructors

inputField_ Source #

Arguments

:: (InputFieldValue a, WidgetEvent e) 
=> WidgetType

The WidgetType of an input field.

-> InputFieldCfg s e a

The config options.

-> WidgetNode s e

The created instance of an input field.

Creates an instance of an input field, with customizations in config.