Mercurial > urweb
changeset 894:a3f58978ff32
Testing new events
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 18 Jul 2009 12:37:19 -0400 |
parents | 062d97847473 |
children | ae9e22822ec5 |
files | lib/ur/basis.urs tests/event.ur tests/event.urp tests/event.urs |
diffstat | 4 files changed, 21 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/ur/basis.urs Sat Jul 18 12:28:25 2009 -0400 +++ b/lib/ur/basis.urs Sat Jul 18 12:37:19 2009 -0400 @@ -554,7 +554,7 @@ con mouseEvents = [Onclick = transaction unit, Ondblclick = transaction unit, Onmousedown = transaction unit, Onmousemove = transaction unit, Onmouseout = transaction unit, Onmouseover = transaction unit, - Onmouseup = transaction unit, ] + Onmouseup = transaction unit] con keyEvents = [Onkeydown = transaction unit, Onkeypress = transaction unit, Onkeyup = transaction unit] con resizeEvents = [Onresize = transaction unit]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/event.ur Sat Jul 18 12:37:19 2009 -0400 @@ -0,0 +1,16 @@ +fun main () = + s <- source ""; + return <xml><body onresize={set s "Resize"}> + <button onblur={set s "Blur 1"} onfocus={set s "Focus 1"} onclick={set s "Click 1"}/> + <button onblur={set s "Blur 2"} onfocus={set s "Focus 2"} onclick={set s "Click 2"}/> + <span onclick={set s "Click"} ondblclick={set s "Double-click"}>SPAN</span> + <span onmousedown={set s "Mouse down"} onmouseup={set s "Mouse up"}>SPAN</span> + <span onmouseout={set s "Mouse out"} onmouseover={set s "Mouse over"}>SPAN</span> + <span onmousemove={set s "Mouse move"}>SPAN</span> + <button onkeydown={set s "Key down"} onkeyup={set s "Key up"}/> + <button onkeypress={set s "Key press"}/> + <br/> + <br/> + + <dyn signal={s <- signal s; return <xml>{[s]}</xml>}/> + </body></xml>