nano-ui
Safe HaskellNone
LanguageGHC2024

NanoUI.Widgets.TextField

Description

Commands run on a text field from outside its frame: an app's Edit menu, a toolbar button, the field's own context menu.

Synopsis

Documentation

runTextCommand :: forall (es :: [Effect]). Ui :> es => WidgetId -> TextCommand -> Eff es () Source #

Run a command on the text field (text input, search field, text area) with this id, as if its keys were pressed: runTextCommand (respId resp) Undo. The field takes keyboard focus, and its next frame returns the changed text and a respChanged pulse. An id that is not a text field is ignored.

textCanUndo :: forall (es :: [Effect]). Ui :> es => WidgetId -> Eff es Bool Source #

Whether Undo would change the field, for enabling a menu item.

textCanRedo :: forall (es :: [Effect]). Ui :> es => WidgetId -> Eff es Bool Source #

Whether Redo would change the field, for enabling a menu item.

applyTextFieldCommand :: Context -> WidgetId -> TextCommand -> IO () Source #

Run a command on the field with this id and focus it: the command comes from a menu or button that may not be over the field, and the caret, selection highlight and next keystroke belong to the field it edited.

textFieldMode :: Context -> WidgetId -> IO (Maybe EditorMode) Source #

How the field with this id edits: from its node when it has one this frame, or from what it recorded the last time it was declared.

textFieldHistory :: Context -> WidgetId -> IO EditHistory Source #

The undo history of the field with this id, empty when it has none.