| Copyright | (c) 2018 Francisco Vallarino |
|---|---|
| License | BSD-3-Clause (see the LICENSE file) |
| Maintainer | [email protected] |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Monomer.Widgets.Singles.TextField
Contents
Description
Input field for single line Text.
Synopsis
- data TextFieldCfg s e
- textFieldDisplayChar :: Char -> TextFieldCfg s e
- textField :: WidgetEvent e => ALens' s Text -> WidgetNode s e
- textField_ :: WidgetEvent e => ALens' s Text -> [TextFieldCfg s e] -> WidgetNode s e
- textFieldV :: WidgetEvent e => Text -> (Text -> e) -> WidgetNode s e
- textFieldV_ :: WidgetEvent e => Text -> (Text -> e) -> [TextFieldCfg s e] -> WidgetNode s e
- textFieldD_ :: WidgetEvent e => WidgetData s Text -> [TextFieldCfg s e] -> WidgetNode s e
Configuration
data TextFieldCfg s e Source #
Configuration options for textField:
validInput: field indicating if the current input is valid. Useful to show warnings in the UI, or disable buttons if needed.resizeOnChange: Whether input causes ResizeWidgets requests.selectOnFocus: Whether all input should be selected when focus is received.maxLength: the maximum length of input text.textFieldDisplayChar: the character that will be displayed as replacement of the real text. Useful for password fields.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
textFieldDisplayChar :: Char -> TextFieldCfg s e Source #
Replacement character to show instead of real text. Useful for passwords.
Constructors
textField :: WidgetEvent e => ALens' s Text -> WidgetNode s e Source #
Creates a text field using the given lens.
textField_ :: WidgetEvent e => ALens' s Text -> [TextFieldCfg s e] -> WidgetNode s e Source #
Creates a text field using the given lens. Accepts config.
textFieldV :: WidgetEvent e => Text -> (Text -> e) -> WidgetNode s e Source #
Creates a text field using the given value and onChange event handler.
textFieldV_ :: WidgetEvent e => Text -> (Text -> e) -> [TextFieldCfg s e] -> WidgetNode s e Source #
Creates a text field using the given value and onChange event handler.
Accepts config.
textFieldD_ :: WidgetEvent e => WidgetData s Text -> [TextFieldCfg s e] -> WidgetNode s e Source #
Creates a text field providing a WidgetData instance and config.