YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -1,33 +1,33 @@
|
|||
include arwen.ew
|
||||
--
|
||||
-- demo\rosetta\Animation.exw
|
||||
--
|
||||
include pGUI.e
|
||||
|
||||
string hw = "Hello World! "
|
||||
integer direction = 1
|
||||
bool direction = true
|
||||
Ihandle label
|
||||
|
||||
constant main = create(Window, "Animation", 0, 0, 20, 20, 300, 150, 0),
|
||||
label = create(Label,hw,0,main,65,40,200,40,0),
|
||||
MainTimer = createTimer()
|
||||
setFont(label, "Verdana", 18, Normal)
|
||||
removeStyle(main,WS_THICKFRAME+WS_MINIMIZEBOX+WS_MAXIMIZEBOX)
|
||||
|
||||
function mainHandler(integer id, integer msg, atom wParam, object lParam)
|
||||
if msg=WM_SHOWWINDOW then
|
||||
startTimer(MainTimer,main,160)
|
||||
elsif msg=WM_TIMER then
|
||||
if direction then
|
||||
hw = hw[$]&hw[1..-2]
|
||||
else
|
||||
hw = hw[2..$]&hw[1]
|
||||
end if
|
||||
setText(label,hw)
|
||||
elsif msg=WM_LBUTTONUP then
|
||||
direction = 1-direction
|
||||
elsif msg=WM_CHAR
|
||||
and wParam=VK_ESCAPE then
|
||||
closeWindow(main)
|
||||
if id or object(lParam) then end if -- suppress warnings
|
||||
end if
|
||||
return 0
|
||||
function timer_cb(Ihandle /*ih*/)
|
||||
hw = iff(direction?hw[$]&hw[1..-2]:hw[2..$]&hw[1])
|
||||
IupSetAttribute(label,"TITLE",hw)
|
||||
return IUP_IGNORE
|
||||
end function
|
||||
setHandler({main},routine_id("mainHandler"))
|
||||
|
||||
WinMain(main, SW_NORMAL)
|
||||
function key_cb(Ihandle /*ih*/, atom c)
|
||||
if c=K_ESC then return IUP_CLOSE end if
|
||||
if c=K_UP then direction = not direction end if
|
||||
return IUP_CONTINUE
|
||||
end function
|
||||
|
||||
procedure main()
|
||||
IupOpen()
|
||||
label = IupLabel(hw,"FONT=\"Verdana, 18\"")
|
||||
Ihandle dlg = IupDialog(label,"TITLE=Animation, DIALOGFRAME=YES, CHILDOFFSET=70x40, SIZE=200x80")
|
||||
IupSetCallback(dlg, "K_ANY", Icallback("key_cb"))
|
||||
IupShow(dlg)
|
||||
Ihandle hTimer = IupTimer(Icallback("timer_cb"), 160)
|
||||
IupMainLoop()
|
||||
IupClose()
|
||||
end procedure
|
||||
|
||||
main()
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
REBOL [
|
||||
Title: "Basic Animation"
|
||||
Author: oofoe
|
||||
Date: 2009-12-06
|
||||
URL: http://rosettacode.org/wiki/Basic_Animation
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
# Project : Animation
|
||||
# Date : 2018/01/18
|
||||
# Author : Gal Zsolt [~ CalmoSoft ~]
|
||||
# Email : <calmosoft@gmail.com>
|
||||
|
||||
Load "guilib.ring"
|
||||
load "stdlib.ring"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue