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 |
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 NumericField
, DateField
and TimeField
.
Synopsis
- data InputFieldCfg s e a = InputFieldCfg {
- _ifcPlaceholder :: Maybe Text
- _ifcInitialValue :: a
- _ifcValue :: WidgetData s a
- _ifcValid :: Maybe (WidgetData s Bool)
- _ifcValidV :: [Bool -> e]
- _ifcDefCursorEnd :: Bool
- _ifcDefWidth :: Double
- _ifcCaretWidth :: Maybe Double
- _ifcCaretMs :: Maybe Int
- _ifcDisplayChar :: Maybe Char
- _ifcResizeOnChange :: Bool
- _ifcSelectOnFocus :: Bool
- _ifcFromText :: Text -> Maybe a
- _ifcToText :: a -> Text
- _ifcAcceptInput :: Text -> Bool
- _ifcIsValidInput :: Text -> Bool
- _ifcStyle :: Maybe (ALens' ThemeState StyleState)
- _ifcWheelHandler :: Maybe (InputWheelHandler a)
- _ifcDragHandler :: Maybe (InputDragHandler a)
- _ifcDragCursor :: Maybe CursorIcon
- _ifcOnFocusReq :: [Path -> WidgetRequest s e]
- _ifcOnBlurReq :: [Path -> WidgetRequest s e]
- _ifcOnChangeReq :: [a -> WidgetRequest s e]
- data InputFieldState a = InputFieldState {
- _ifsPlaceholder :: Seq TextLine
- _ifsCurrValue :: a
- _ifsCurrText :: !Text
- _ifsCursorPos :: !Int
- _ifsSelStart :: Maybe Int
- _ifsDragSelValue :: a
- _ifsGlyphs :: Seq GlyphPos
- _ifsOffset :: !Double
- _ifsTextRect :: Rect
- _ifsTextMetrics :: TextMetrics
- _ifsHistory :: Seq (HistoryStep a)
- _ifsHistIdx :: Int
- _ifsFocusStart :: Int
- inputField_ :: (InputFieldValue a, WidgetEvent e) => WidgetType -> InputFieldCfg s e a -> WidgetNode s e
Documentation
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.
InputFieldCfg | |
|
data InputFieldState a Source #
Current state of the input field. Provided to some event handlers.
InputFieldState | |
|
Instances
Eq a => Eq (InputFieldState a) Source # | |
Defined in Monomer.Widgets.Singles.Base.InputField (==) :: InputFieldState a -> InputFieldState a -> Bool # (/=) :: InputFieldState a -> InputFieldState a -> Bool # | |
Show a => Show (InputFieldState a) Source # | |
Defined in Monomer.Widgets.Singles.Base.InputField showsPrec :: Int -> InputFieldState a -> ShowS # show :: InputFieldState a -> String # showList :: [InputFieldState a] -> ShowS # | |
Generic (InputFieldState a) Source # | |
Defined in Monomer.Widgets.Singles.Base.InputField type Rep (InputFieldState a) :: Type -> Type # from :: InputFieldState a -> Rep (InputFieldState a) x # to :: Rep (InputFieldState a) x -> InputFieldState a # | |
type Rep (InputFieldState a) Source # | |
Defined in Monomer.Widgets.Singles.Base.InputField |
inputField_ :: (InputFieldValue a, WidgetEvent e) => WidgetType -> InputFieldCfg s e a -> WidgetNode s e Source #
Creates an instance of an input field, with customizations in config.