wx-controls-extra-0.0: A set of custom widgets for wxHaskell.ContentsIndex
Graphics.UI.WX.Controls.TimelineWidget
Description
Timeline widget for wxHaskell. Useful for animation tools. TODO: some serious cleaning & refactoring. The code is ugly as hell. But it seems to work.
Synopsis
data TimelineWidget a
makeTimelineWidget :: forall x a. Window x -> Int -> (Time, Time) -> Int -> [Prop (TimelineWidget a)] -> IO (TimelineWidget a)
module Data.Timeline
type OnZoomScrollFunc t = Double -> (t, t) -> Size -> IO ()
type OnSelectFunc a t = (Int, Block a t) -> IO ()
type OnMoveFunc a t = (Int, Block a t) -> (Int, Iv t) -> IO ()
type OnResizeFunc a t = (Int, Block a t) -> Iv t -> IO ()
type OnInsertFunc a t = Int -> Iv t -> IO (Maybe (Block a t))
class TimelineDisplay widg a | widg -> a where
feedback :: Attr widg FeedbackFunc
onBlockSelect :: Attr widg (OnSelectFunc a Time)
onBlockMove :: Attr widg (OnMoveFunc a Time)
onBlockResize :: Attr widg (OnResizeFunc a Time)
onBlockInsert :: Attr widg (OnInsertFunc a Time)
onBlockInsertSuccess :: Attr widg (OnInsertSuccessFunc a Time)
onZoomScroll :: Attr widg (OnZoomScrollFunc Time)
nrows :: Attr widg Int
duration :: Attr widg Int
blocks :: Attr widg (Timeline a Time)
zoom :: Attr widg Double
Documentation
data TimelineWidget a
TimelineWidget of blocks of type a
show/hide Instances
makeTimelineWidget
:: forall x a .
=> Window xparent
-> Intnumber of rows
-> (Time, Time)start/end
-> Intheight of a row in pixels
-> [Prop (TimelineWidget a)]
-> IO (TimelineWidget a)
module Data.Timeline
type OnZoomScrollFunc t = Double -> (t, t) -> Size -> IO ()
type OnSelectFunc a t = (Int, Block a t) -> IO ()
type OnMoveFunc a t = (Int, Block a t) -> (Int, Iv t) -> IO ()
type OnResizeFunc a t = (Int, Block a t) -> Iv t -> IO ()
type OnInsertFunc a t = Int -> Iv t -> IO (Maybe (Block a t))
class TimelineDisplay widg a | widg -> a where
Methods
feedback :: Attr widg FeedbackFunc
The default feedback mechanism is logStatus.
onBlockSelect :: Attr widg (OnSelectFunc a Time)
Selection callback
onBlockMove :: Attr widg (OnMoveFunc a Time)
Move callback
onBlockResize :: Attr widg (OnResizeFunc a Time)
Resize callback
onBlockInsert :: Attr widg (OnInsertFunc a Time)
Insert callback (default is _ _ -> return Nothing, thus no insert)
onBlockInsertSuccess :: Attr widg (OnInsertSuccessFunc a Time)
Callback on successful insert
onZoomScroll :: Attr widg (OnZoomScrollFunc Time)
Zoom / scroll callback
nrows :: Attr widg Int
Number of rows (levels). Read-only. Note: the numbering starts from 1.
duration :: Attr widg Int
Size of the timeline. Read-only.
blocks :: Attr widg (Timeline a Time)
The blocks (events) themselves.
zoom :: Attr widg Double
Zoom level. 1.0 = 100%, 2.0 = 50%, etc.
show/hide Instances
Produced by Haddock version 2.4.1