Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Monomer.Dragboard.DragboardCfg
Contents
Synopsis
- module Monomer.Checkerboard.CheckerboardCfg
- data DragboardCfg s e a = DragboardCfg {
- _dcValidator :: Maybe (Info a -> Bool)
- _dcOffset :: Maybe Int
- _dcSelectColor :: Maybe Color
- _dcNoClick :: Maybe Bool
- _dcRenderS :: Maybe Bool
- _dcDuration :: Maybe Millisecond
- _dcCheckerCfg :: [CheckerboardCfg]
- _dcOnFocusReq :: [Path -> WidgetRequest s e]
- _dcOnBlurReq :: [Path -> WidgetRequest s e]
- _dcOnChangeReq :: [Info a -> WidgetRequest s e]
- moveValidator :: (Info a -> Bool) -> DragboardCfg s e a
- dragIdOffset :: Int -> DragboardCfg s e a
- selectColor :: Color -> DragboardCfg s e a
- disableClick :: DragboardCfg s e a
- disableClick_ :: Bool -> DragboardCfg s e a
- renderSource :: DragboardCfg s e a
- renderSource_ :: Bool -> DragboardCfg s e a
- checkerConfig :: [CheckerboardCfg] -> DragboardCfg s e a
Re-exported modules
Configuration
data DragboardCfg s e a Source #
Configuration options for dragboard:
moveValidator
: function to check validity of a move.dragIdOffset
: offset for drag and drop event messages.selectColor
: color of selected square.disableClick
: whether items can be moved only by dragging.renderSource
: whether to render the source widget when dragging.duration
: how long the animation lasts in ms.checkerConfig
: config options for checkerboard container.onFocus
: event to raise when focus is received.onFocusReq
:WidgetRequest
to generate when focus is received.onBlur
: event to raise when focus is lost.onBlurReq
:WidgetRequest
to generate when focus is lost.onChange
: event to raise when the board changes.onChangeReq
:WidgetRequest
to generate when the board changes.
Constructors
DragboardCfg | |
Fields
|
Instances
moveValidator :: (Info a -> Bool) -> DragboardCfg s e a Source #
Receives previous board, index of a square where item has been dragged to and index of a square where item has been dragged from and returns whether this move is valid or not. If move is not valid then the board state will not change.
dragIdOffset :: Int -> DragboardCfg s e a Source #
When there are multiple dragboards, it is possible to drag an item from one dragboard to another. In order to ignore drop events caused by foreign items or to process them properly, the dragboards should use different offsets (for example, if each dragboard has less than 1000 squares, then multiples of 1000 can be used as offsets):
vgrid [ dragboard 3 3 boardState f , dragboard_ 3 3 anotherBoardState f [dragIdOffset 1000] , dragboard_ 3 3 yetAnotherBoardState f [dragIdOffset 2000] ]
selectColor :: Color -> DragboardCfg s e a Source #
Color of selected square which is yellow by default.
disableClick :: DragboardCfg s e a Source #
Allows items to be moved only by dragging.
disableClick_ :: Bool -> DragboardCfg s e a Source #
Whether items can be moved only by dragging.
renderSource :: DragboardCfg s e a Source #
Renders the source widget when dragging.
renderSource_ :: Bool -> DragboardCfg s e a Source #
Whether to render the source widget when dragging.
checkerConfig :: [CheckerboardCfg] -> DragboardCfg s e a Source #
Config options for checkerboard container which is used by dragboard.