aboutsummaryrefslogtreecommitdiff
path: root/support_edit.icl
diff options
context:
space:
mode:
Diffstat (limited to 'support_edit.icl')
-rw-r--r--support_edit.icl37
1 files changed, 37 insertions, 0 deletions
diff --git a/support_edit.icl b/support_edit.icl
new file mode 100644
index 0000000..a7f23ce
--- /dev/null
+++ b/support_edit.icl
@@ -0,0 +1,37 @@
+module support_edit
+
+import StdEnv, StdIO
+
+Start :: *World -> *World
+Start world
+# (id, world) = openId world
+# edits = let w = PixelWidth 200 in [
+ EditControl "Activate" w 3 [ControlActivate (count 1 id)],
+ EditControl "Deactivate" w 3 [ControlDeactivate (count -1 id)],
+ EditControl "Hide" w 3 [ControlHide],
+ EditControl "Id" (PixelWidth 500) 3 [ControlId id],
+ EditControl "Keyboard" w 3 [ControlKeyboard (\ks . getKeyboardStateKeyState ks <> KeyUp) Able (kbfunc id)],
+ EditControl "Pos" w 3 [ControlPos (Left, zero)],
+ EditControl "Resize" w 3 [], //todo
+ EditControl "SelectState" w 3 [ControlSelectState Able],
+ EditControl "SelectState" w 3 [ControlSelectState Unable],
+ EditControl "Tip" w 3 [ControlTip "Some tip"]
+ ]
+# controls = ListLS edits
+# hello = Dialog "Support - EditControl" controls [WindowClose (noLS closeProcess)]
+= 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)
+
+ modf :: Id Modifiers -> (Int, PSt .l) -> (Int, PSt .l)
+ modf id mods = \(count,pst=:{io}) . (count, appPIO (setControlText id (toString mods)) pst)
+
+ kbfunc :: Id KeyboardState -> (Int, PSt .l) -> (Int, PSt .l)
+ kbfunc id st = \(c,pst) . (c, appPIO (setControlText id (toString st)) pst)
+