September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,18 +0,0 @@
|
|||
CHARACTER string="Hello World! "
|
||||
|
||||
WINDOW(WINdowhandle=wh, Height=1, X=1, TItle="left/right click to rotate left/right, Y-click-position sets milliseconds period")
|
||||
AXIS(WINdowhandle=wh, PoinT=20, X=2048, Y, Title='ms', MiN=0, MaX=400, MouSeY=msec, MouSeCall=Mouse_callback, MouSeButton=button_type)
|
||||
direction = 4
|
||||
msec = 100 ! initial milliseconds
|
||||
DO tic = 1, 1E20
|
||||
WRITE(WIN=wh, Align='Center Vertical') string
|
||||
IF(direction == 4) string = string(LEN(string)) // string ! rotate left
|
||||
IF(direction == 8) string = string(2:) // string(1) ! rotate right
|
||||
WRITE(StatusBar, Name) tic, direction, msec
|
||||
SYSTEM(WAIT=msec)
|
||||
ENDDO
|
||||
END
|
||||
|
||||
SUBROUTINE Mouse_callback()
|
||||
direction = button_type ! 4 == left button up, 8 == right button up
|
||||
END
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue