Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
44
Task/Animation/Icon/animation-1.icon
Normal file
44
Task/Animation/Icon/animation-1.icon
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import gui
|
||||
$include "guih.icn"
|
||||
|
||||
class WindowApp : Dialog (label, direction)
|
||||
|
||||
method rotate_left (msg)
|
||||
return msg[2:0] || msg[1]
|
||||
end
|
||||
|
||||
method rotate_right (msg)
|
||||
return msg[-1:0] || msg[1:-1]
|
||||
end
|
||||
|
||||
method reverse_direction ()
|
||||
direction := 1-direction
|
||||
end
|
||||
|
||||
# this method gets called by the ticker, and updates the label
|
||||
method tick ()
|
||||
static msg := "Hello World! "
|
||||
if direction = 0
|
||||
then msg := rotate_left (msg)
|
||||
else msg := rotate_right (msg)
|
||||
label.set_label(msg)
|
||||
end
|
||||
|
||||
method component_setup ()
|
||||
direction := 1 # start off rotating to the right
|
||||
label := Label("label=Hello World! ", "pos=0,0")
|
||||
# respond to a mouse click on the label
|
||||
label.connect (self, "reverse_direction", MOUSE_RELEASE_EVENT)
|
||||
add (label)
|
||||
|
||||
connect (self, "dispose", CLOSE_BUTTON_EVENT)
|
||||
# tick every 100ms
|
||||
self.set_ticker (100)
|
||||
end
|
||||
end
|
||||
|
||||
# create and show the window
|
||||
procedure main ()
|
||||
w := WindowApp ()
|
||||
w.show_modal ()
|
||||
end
|
||||
21
Task/Animation/Icon/animation-2.icon
Normal file
21
Task/Animation/Icon/animation-2.icon
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
link graphics
|
||||
|
||||
procedure main()
|
||||
s := "Hello World! "
|
||||
WOpen("size=640,400", "label=Animation")
|
||||
Font("typewriter,60,bold")
|
||||
direction := 1
|
||||
w := TextWidth(s)
|
||||
h := WAttrib("fheight")
|
||||
x := (WAttrib("width") - w) / 2
|
||||
y := (WAttrib("height") - 20 + h) / 2
|
||||
|
||||
repeat
|
||||
{ if *Pending() > 0 then if (Event() = &lrelease) & (x < &x < x + w) & (y > &y > y-h) then direction := ixor(direction, 1)
|
||||
s := s[2 - 3 * direction:0] || s[1:2 - 3 * direction]
|
||||
EraseArea(x, y, w, -h)
|
||||
DrawString(x,y - WAttrib("descent")-1,s)
|
||||
WFlush()
|
||||
delay(250)
|
||||
}
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue