monomer-1.4.1.0: 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 HaskellNone
LanguageHaskell2010

Monomer.Widgets.Containers.SelectList

Description

Select list widget, allowing selection of a single item. List content (rows) is customizable, and so is its styling. This widget is used by Monomer.Widgets.Containers.Dropdown when in its open state.

makeRow username = hstack [
    label "User: ",
    label username
  ]

customSelect = selectList userLens usernames makeRow
Synopsis

Configuration

data SelectListCfg s e a Source #

Configuration options for selectList:

Instances

Instances details
Semigroup (SelectListCfg s e a) Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

(<>) :: SelectListCfg s e a -> SelectListCfg s e a -> SelectListCfg s e a #

sconcat :: NonEmpty (SelectListCfg s e a) -> SelectListCfg s e a #

stimes :: Integral b => b -> SelectListCfg s e a -> SelectListCfg s e a #

Monoid (SelectListCfg s e a) Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

mempty :: SelectListCfg s e a #

mappend :: SelectListCfg s e a -> SelectListCfg s e a -> SelectListCfg s e a #

mconcat :: [SelectListCfg s e a] -> SelectListCfg s e a #

Default (SelectListCfg s e a) Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

def :: SelectListCfg s e a #

CmbSelectOnBlur (SelectListCfg s e a) Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

CmbItemSelectedStyle (SelectListCfg s e a) Style Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

CmbItemBasicStyle (SelectListCfg s e a) Style Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

WidgetEvent e => CmbOnChangeIdx (SelectListCfg s e a) e a Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

onChangeIdx :: (Int -> a -> e) -> SelectListCfg s e a Source #

WidgetEvent e => CmbOnChange (SelectListCfg s e a) a e Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

onChange :: (a -> e) -> SelectListCfg s e a Source #

WidgetEvent e => CmbOnBlur (SelectListCfg s e a) e Path Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

onBlur :: (Path -> e) -> SelectListCfg s e a Source #

WidgetEvent e => CmbOnFocus (SelectListCfg s e a) e Path Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

onFocus :: (Path -> e) -> SelectListCfg s e a Source #

CmbOnChangeIdxReq (SelectListCfg s e a) s e a Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

onChangeIdxReq :: (Int -> a -> WidgetRequest s e) -> SelectListCfg s e a Source #

CmbOnChangeReq (SelectListCfg s e a) s e a Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

onChangeReq :: (a -> WidgetRequest s e) -> SelectListCfg s e a Source #

CmbOnBlurReq (SelectListCfg s e a) s e Path Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

onBlurReq :: (Path -> WidgetRequest s e) -> SelectListCfg s e a Source #

CmbOnFocusReq (SelectListCfg s e a) s e Path Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

onFocusReq :: (Path -> WidgetRequest s e) -> SelectListCfg s e a Source #

CmbMergeRequired (SelectListCfg s e a) (WidgetEnv s e) (Seq a) Source # 
Instance details

Defined in Monomer.Widgets.Containers.SelectList

Methods

mergeRequired :: (WidgetEnv s e -> Seq a -> Seq a -> Bool) -> SelectListCfg s e a Source #

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

Constraints for an item handled by selectList.

data SelectListMessage Source #

Messages received by selectList. In general used internally.

type SelectListMakeRow s e a = a -> WidgetNode s e Source #

Creates a row from an item.

Constructors

selectList Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, SelectListItem a) 
=> ALens' s a

The lens into the model.

-> t a

The list of selectable items.

-> SelectListMakeRow s e a

Function to create the list items.

-> WidgetNode s e

The created dropdown.

Creates a select list using the given lens.

selectList_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, SelectListItem a) 
=> ALens' s a

The lens into the model.

-> t a

The list of selectable items.

-> SelectListMakeRow s e a

Function to create the list items.

-> [SelectListCfg s e a]

The config options.

-> WidgetNode s e

The created dropdown.

Creates a select list using the given lens. Accepts config.

selectListV Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, SelectListItem a) 
=> a

The event to raise on change.

-> (Int -> a -> e)

The list of selectable items.

-> t a

The list of selectable items.

-> SelectListMakeRow s e a

Function to create the list items.

-> WidgetNode s e

The created dropdown.

Creates a select list using the given value and onChange event handler.

selectListV_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Traversable t, SelectListItem a) 
=> a

The event to raise on change.

-> (Int -> a -> e)

The list of selectable items.

-> t a

The list of selectable items.

-> SelectListMakeRow s e a

Function to create the list items.

-> [SelectListCfg s e a]

The config options.

-> WidgetNode s e

The created dropdown.

Creates a select list using the given value and onChange event handler. Accepts config.

selectListD_ Source #

Arguments

:: forall s e t a. (WidgetModel s, WidgetEvent e, Traversable t, SelectListItem a) 
=> WidgetData s a

The WidgetData to retrieve the value from.

-> t a

The list of selectable items.

-> SelectListMakeRow s e a

Function to create the list items.

-> [SelectListCfg s e a]

The config options.

-> WidgetNode s e

The created dropdown.

Creates a dropdown providing a WidgetData instance and config.