monomer-widgets-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Monomer.Dragboard

Description

This is a dragboard which uses checkerboard with draggable images or colored fillers. It needs to be provided with number of rows and columns, lens to the board state of type '[[a]]' (each square of the board would thus contain a list of items '[a]' and show only the first item) and the function which converts item a to either color of a filler or path to the image.

dragboard 3 3 boardState getPath
Synopsis

Re-exported modules

Constructors

dragboard Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) 
=> Int

Number of columns.

-> Int

Number of rows.

-> ALens' s [[a]]

The lens into the model.

-> (a -> Either Text Color)

The path or color function.

-> WidgetNode s e

The created dragboard.

Creates a dragboard using the given lens, providing number of columns and rows and the function to get image path or color from the value.

dragboard_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) 
=> Int

Number of columns.

-> Int

Number of rows.

-> ALens' s [[a]]

The lens into the model.

-> (a -> Either Text Color)

The path or color function.

-> [DragboardCfg s e a]

The config options.

-> WidgetNode s e

The created dragboard.

Creates a dragboard using the given lens, providing number of columns and rows and the function to get image path or color from the value. Accepts config.

dragboardV Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) 
=> Int

Number of columns.

-> Int

Number of rows.

-> [[a]]

The current board state.

-> (([[a]], Int, Int) -> e)

The event to raise on change.

-> (a -> Either Text Color)

The path or color function.

-> WidgetNode s e

The created dragboard.

Creates a dragboard using the given board state and onChange event handler, providing number of columns and rows and the function to get image path or color from the value.

dragboardV_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) 
=> Int

Number of columns.

-> Int

Number of rows.

-> [[a]]

The current board state.

-> (([[a]], Int, Int) -> e)

The event to raise on change.

-> (a -> Either Text Color)

The path or color function.

-> [DragboardCfg s e a]

The config options.

-> WidgetNode s e

The created dragboard.

Creates a dragboard using the given board state and onChange event handler, providing number of columns and rows and the function to get image path or color from the value. Accepts config.

dragboardD_ Source #

Arguments

:: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) 
=> Int

Number of columns.

-> Int

Number of rows.

-> WidgetData s [[a]]

The WidgetData to retrieve the board state from.

-> (a -> Either Text Color)

The path or color function.

-> [DragboardCfg s e a]

The config options.

-> [CompositeCfg (DragboardModel a) (DragboardEvent a) s e]

The composite config options.

-> WidgetNode s e

The created dragboard.

Creates a dragboard providing a WidgetData instance, number of columns and rows, the function to get image path or color from the value and config.