home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / pinit / !PinIt / WimpLib / Poll (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1995-05-17  |  3KB  |  104 lines

  1.  >SystemLib:WimpLib.Poll (v0.02)
  2.  (c) Andrew Hunter
  3.  Public Domain
  4.  1,"This is a library!"
  5. startup(taskname$,version%)
  6.  Initialise wimp
  7.  "Wimp_Initialise",version%*100,&4B534154,taskname$ 
  8.  ver%,task_handle%
  9.  Define useful memory blocks
  10. panes%=
  11.  block% 4096,iblock% 4096
  12.  respond%(19)
  13. decode_poll(poll_no%)
  14.  poll_no% 
  15.  1:whandle%=!block%
  16.  2:whandle%=!block%
  17.  3:whandle%=!block%
  18.  4:whandle%=!block%
  19.  5:whandle%=!block%
  20.  6:x%=!block%:y%=block%!4:button%=block%!8:whandle%=block%!12:ihandle%=block%!16
  21. !iblock%=whandle%
  22.  "Wimp_GetWindowInfo",,iblock%
  23. $windx%=x%-(iblock%!4-iblock%!20)
  24. %windy%=y%-(iblock%!16-iblock%!24)
  25.  7:whandle%=!block%:x%=block%!4:y%=block%!8
  26.  8:whandle%=!block%:ihandle%=block%!4:x%=block%!8:y%=block%!12:index%=block%!20:key%=block%!24
  27.  9:main%=!block%:sub1%=block%!4:sub2%=block%!8:sub3%=block%!12
  28.  11:whandle%=!block%
  29.  12:whandle%=!block%
  30.  17,18,19:size%=!block%:sender_handle%=block%!4:my_ref%=block%!8:your_ref%=block%!12:action_code%=block%!16
  31. poll(mask%)
  32.  reason%
  33.  "Wimp_Poll",mask%,block% 
  34.  reason%
  35. =reason%
  36. pollidle(mask%,time%)
  37.  reason%,this_time%
  38.  "OS_ReadMonotonicTime" 
  39.  this_time%
  40. time%+=this_time%
  41.  "Wimp_PollIdle",mask%,block%,time% 
  42.  reason%
  43. =reason%
  44. poll(mask%)
  45.  reason%
  46. quit%=
  47. reason%=
  48. poll(mask%)
  49. decode_poll(reason%)
  50.  respond%(reason%) 
  51. respond 
  52. standard
  53.  quit%
  54. closedown
  55. pollidle(mask%,time%)
  56.  reason%
  57. quit%=
  58. @"reason%=
  59. pollidle(mask%,time%)
  60. decode_poll(reason%)
  61.  respond%(reason%) 
  62. respond 
  63. standard
  64.  quit%
  65. closedown
  66. closedown
  67.  "Wimp_CloseDown"
  68. respond
  69.  reason% 
  70. respond_null
  71. respond_redraw
  72. respond_open
  73. respond_close
  74. respond_leave
  75. respond_enter
  76. respond_click
  77. respond_drag
  78. respond_key
  79. respond_menu
  80. respond_scroll
  81. respond_LoseCaret
  82. respond_GainCaret
  83. respond_PollWordNonZero
  84.  14,15,16:
  85. respond_unknown
  86.  17,18,19:
  87. respond_message
  88.  action_code%=0 
  89.  quit%=
  90. standard
  91.  reason% 
  92. redraw
  93.  panes% 
  94.  "Wimp_OpenWindow",,block% 
  95. windows_openwindow(block%)
  96.  panes% 
  97.  "Wimp_CloseWindow",,block% 
  98. windows_closewindow(block%)
  99. messages_enddrag
  100.  "Wimp_ProcessKey",key%
  101.  17,18:
  102.  action_code%=0 
  103.  quit%=
  104.