Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Monomer.Dragboard
Contents
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
- module Monomer.Dragboard.DragboardCfg
- dragboard :: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) => Int -> Int -> ALens' s [[a]] -> (a -> Either Text Color) -> WidgetNode s e
- dragboard_ :: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) => Int -> Int -> ALens' s [[a]] -> (a -> Either Text Color) -> [DragboardCfg s e a] -> WidgetNode s e
- dragboardV :: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) => Int -> Int -> [[a]] -> (([[a]], Int, Int) -> e) -> (a -> Either Text Color) -> WidgetNode s e
- dragboardV_ :: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) => Int -> Int -> [[a]] -> (([[a]], Int, Int) -> e) -> (a -> Either Text Color) -> [DragboardCfg s e a] -> WidgetNode s e
- dragboardD_ :: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) => Int -> Int -> WidgetData s [[a]] -> (a -> Either Text Color) -> [DragboardCfg s e a] -> [CompositeCfg (DragboardModel a) (DragboardEvent a) s e] -> WidgetNode s e
Re-exported modules
Constructors
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.
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.
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.
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.
Arguments
:: (WidgetModel s, WidgetEvent e, Eq a, Typeable a) | |
=> Int | Number of columns. |
-> Int | Number of rows. |
-> WidgetData s [[a]] | The |
-> (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.