home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
p
/
pinit
/
!PinIt
/
WimpLib
/
Poll
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1995-05-17
|
3KB
|
104 lines
>SystemLib:WimpLib.Poll (v0.02)
(c) Andrew Hunter
Public Domain
1,"This is a library!"
startup(taskname$,version%)
Initialise wimp
"Wimp_Initialise",version%*100,&4B534154,taskname$
ver%,task_handle%
Define useful memory blocks
panes%=
block% 4096,iblock% 4096
respond%(19)
decode_poll(poll_no%)
poll_no%
1:whandle%=!block%
2:whandle%=!block%
3:whandle%=!block%
4:whandle%=!block%
5:whandle%=!block%
6:x%=!block%:y%=block%!4:button%=block%!8:whandle%=block%!12:ihandle%=block%!16
!iblock%=whandle%
"Wimp_GetWindowInfo",,iblock%
$windx%=x%-(iblock%!4-iblock%!20)
%windy%=y%-(iblock%!16-iblock%!24)
7:whandle%=!block%:x%=block%!4:y%=block%!8
8:whandle%=!block%:ihandle%=block%!4:x%=block%!8:y%=block%!12:index%=block%!20:key%=block%!24
9:main%=!block%:sub1%=block%!4:sub2%=block%!8:sub3%=block%!12
11:whandle%=!block%
12:whandle%=!block%
17,18,19:size%=!block%:sender_handle%=block%!4:my_ref%=block%!8:your_ref%=block%!12:action_code%=block%!16
poll(mask%)
reason%
"Wimp_Poll",mask%,block%
reason%
=reason%
pollidle(mask%,time%)
reason%,this_time%
"OS_ReadMonotonicTime"
this_time%
time%+=this_time%
"Wimp_PollIdle",mask%,block%,time%
reason%
=reason%
poll(mask%)
reason%
quit%=
reason%=
poll(mask%)
decode_poll(reason%)
respond%(reason%)
respond
standard
quit%
closedown
pollidle(mask%,time%)
reason%
quit%=
@"reason%=
pollidle(mask%,time%)
decode_poll(reason%)
respond%(reason%)
respond
standard
quit%
closedown
closedown
"Wimp_CloseDown"
respond
reason%
respond_null
respond_redraw
respond_open
respond_close
respond_leave
respond_enter
respond_click
respond_drag
respond_key
respond_menu
respond_scroll
respond_LoseCaret
respond_GainCaret
respond_PollWordNonZero
14,15,16:
respond_unknown
17,18,19:
respond_message
action_code%=0
quit%=
standard
reason%
redraw
panes%
"Wimp_OpenWindow",,block%
windows_openwindow(block%)
panes%
"Wimp_CloseWindow",,block%
windows_closewindow(block%)
messages_enddrag
"Wimp_ProcessKey",key%
17,18:
action_code%=0
quit%=