test
[clean-tests.git] / test.icl
1 module test
2 //
3 //import Data.Func, StdFunctions, iTasks
4 //
5 //derive gDefault ChoiceNode
6 //
7 //Start w = flip doTasks w $
8 // withShared 5 \sharedInt->
9 // withShared [] \sharedSel->
10 // (editSharedSelectionWithShared
11 // [SelectInTree
12 // (\l->[{defaultValue & id=i,label=toString i}\\i<-[0..l]])
13 // (\_ s->s)
14 // ] sharedInt sharedSel <<@ Title "Selection" <<@ multipleAttr False)
15 // -|| (updateSharedInformation [] sharedInt <<@ Title "Number of items")
16 // -|| (updateSharedInformation [] sharedSel <<@ Title "Current selection")
17 // >&> \sh->(viewSharedInformation [] (mapRead toSingleLineText sh) <<@ Title "Current task value" )
18 //
19 //from Data.Map import singleton
20 //import Data.Map.GenJSON
21 //import iTasks
22 //
23 //Start w = doTasks t w
24 //
25 //t :: Task [(Int, TaskValue Int)]
26 //t = parallel
27 // [(Embedded, \stl->
28 // appendTask Embedded (\_->viewInformation [] 42) stl
29 // >>! \i->set (singleton "focus" (JSONBool True)) (sdsFocus i (taskListEntryMeta stl))
30 // >>~ \_->viewSharedInformation []
31 // (sdsFocus {onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False,includeValue=True,includeProgress=True,includeAttributes=True} stl)
32 // @! 42
33 // )] []
34
35 //import iTasks
36 //Start w = doTasks t w
37 //where
38 // t = viewInformation [ViewUsing id progressBar] (Just 80, Just long) <<@ Title "bork"
39 // long = "borkueaohutenhuaostuehasunethuaosnuhtesuhaotsuehtausneohtusoauhtesauhtesnuhtasuhetauhosunehtoauesnhtaueshautesnhutaonsuhetaonsuhetansuhetansuhetaosnuehtaosnuhetaosunhaoetsunehatounsoehtasunhteunaoshuteoasnuhteaosuhnaoetsnuheotasunehotasunhetusnahotueaou"
40
41
42 import iTasks
43
44 :: R = { x :: !String, y :: !String }
45 derive class iTask R
46
47 Start w = doTasks (t -&&- u) w
48
49 t = updateSharedInformation
50 [ UpdateSharedAs
51 (\r -> r.x)
52 (\r x -> {r & x=x})
53 const
54 ] s
55 u = updateSharedInformation [] s
56
57 s = sharedStore "x" {x="",y=""}