aboutsummaryrefslogtreecommitdiff
path: root/support_popup.icl
diff options
context:
space:
mode:
authorCamil Staps2015-08-08 19:58:36 +0200
committerCamil Staps2015-08-08 19:58:36 +0200
commitd075b4831a10db83840c5e2fd11fb2b59722adfc (patch)
tree20f7d14c8318b7e09e982e8f2ca8b8722afb8348 /support_popup.icl
ObjectIO tests
Diffstat (limited to 'support_popup.icl')
-rw-r--r--support_popup.icl30
1 files changed, 30 insertions, 0 deletions
diff --git a/support_popup.icl b/support_popup.icl
new file mode 100644
index 0000000..50485b7
--- /dev/null
+++ b/support_popup.icl
@@ -0,0 +1,30 @@
+module support_popup
+
+import StdEnv, StdIO
+
+Start :: *World -> *World
+Start world
+# (textid, world) = openId world
+# popups = let w = PixelWidth 200 in [
+ PopUpControl [("Activate " +++ toString i, id) \\ i <- [1..5]] 1 [ControlActivate (count 1 textid)], // doesn't work yet
+ PopUpControl [("Deactivate " +++ toString i, id) \\ i <- [1..5]] 2 [ControlDeactivate (count -1 textid)], // doesn't work yet
+ PopUpControl [("Hide " +++ toString i, id) \\ i <- [1..5]] 1 [ControlHide],
+ PopUpControl [("Id " +++ toString i, id) \\ i <- [1..5]] 3 [], // todo
+ PopUpControl [("Pos " +++ toString i, id) \\ i <- [1..5]] 4 [ControlPos (Left, zero)],
+ PopUpControl [("SelectState " +++ toString i, id) \\ i <- [1..5]] 5 [ControlSelectState Able],
+ PopUpControl [("SelectState " +++ toString i, id) \\ i <- [1..5]] 1 [ControlSelectState Unable],
+ PopUpControl [("Tip " +++ toString i, id) \\ i <- [1..5]] 2 [ControlTip "Some tip"],
+ PopUpControl [("Width " +++ toString i, id) \\ i <- [1..5]] 3 [ControlWidth (PixelWidth 500)]
+ ]
+# controls = ButtonControl "For callbacks" [ControlId textid] :+: ListLS popups
+# hello = Dialog "Support - PopUpControl" controls [WindowClose (noLS closeProcess), WindowViewSize {w=1000,h=500}] // because vertical space isn't reserved properly
+= startIO NDI Void (initialise hello) [] world
+where
+ initialise hello pst
+ # (error,pst) = openDialog 0 hello pst
+ | error <> NoError = closeProcess pst
+ | otherwise = pst
+
+ count :: Int Id (Int, PSt .l) -> (Int, PSt .l)
+ count dx id (count,pst=:{io}) = (count + dx, appPIO (setControlText id (toString (count+dx))) pst)
+