home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / d / drwimp / DrWimp / Utils / !Fnc'n'Prc / Info < prev    next >
Text File  |  1997-05-31  |  35KB  |  1,126 lines

  1. misc
  2. FNwimp_initialise(name$,wimpmem%,iconmem%,ver%)
  3. This function registers your application with the Task
  4. Manager and reserves some memory.
  5. name$ = the name of your application eg. 'Draw'.
  6. wimpmem% = number of bytes to reserve for icon data or
  7. menu entries.
  8. iconmem% = number of bytes to reserve for indirected
  9. text. eg. window titles or long menu entries.
  10. ver% = minimum version of RISC OS that the application
  11. is allowed to run on multiplied by 100.
  12.  
  13. polling
  14. PROCwimp_poll
  15. This function is the main loop of your application. When
  16. it has finished, your application has quitted. If
  17. something happens to your application eg. an icon has
  18. been clicked on, then the relevent function will be
  19. called from the loop.
  20.  
  21. polling
  22. PROCwimp_pollidle(seconds%)
  23. If NULL=TRUE then PROCuser_null will be called every
  24. seconds% seconds instead of every time control is passed
  25. to the application and no event has occured.
  26.  
  27. polling
  28. PROCwimp_singlepoll
  29. The same as PROCwimp_poll, execpt that it is called once
  30. and not in a loop. If something happens then the
  31. relevent action will still be taken before returning.
  32. Useful for making loops multitask, eg: raytracing,
  33. printing, calculating, loading in data, etc.
  34. Note: if calling in PROCuser_null, make sure NULL=FALSE
  35. before this call (can set to TRUE afterwards) otherwise
  36. recursion will occur.
  37.  
  38. polling
  39. PROCwimp_singlepollidle(seconds%)
  40. The same as PROCwimp_pollidle, except that it is called
  41. once and not in a loop. If something happens then the
  42. relevent action will be taken before returning. If
  43. NULL=TRUE then PROCuser_null will be called after
  44. seconds% seconds.
  45. Useful for incorporating delays into multitasking loops.
  46. Note: if calling in PROCuser_null, make sure NULL=FALSE
  47. before this call (can set to TRUE afterwards) otherwise
  48. recursion will occur.
  49.  
  50. user
  51. PROCuser_redraw(window%,minx%,miny%,maxx%,maxy%,printing%,page%)
  52. When this function is called, the Wimp wants you to
  53. update the specified box on the screen. The box is in
  54. the work area of the window whose handle is window% or
  55. if printing then its in paper coordinates where the
  56. origin is at the bottom left of the paper.
  57. printing% = TRUE if currently printing, FALSE otherwise.
  58. page% = number of page currently being printed if
  59. printing%=TRUE.
  60. minx%,miny% = bottom left co-ordinates of box in screen
  61. coordinates.
  62. maxx%,maxy% = top right co-ordinates of box in screen
  63. coordinates.
  64.  
  65. user
  66. PROCuser_mouseclick(window%,icon%,button%,workx%,worky%)
  67. IF an icon has been clicked on in one of your windows
  68. then this function is called.
  69. window% = handle of window containing icon.
  70. icon% = number of the icon clicked on.
  71. button% = which mouse button was pressed. Eg. 4 for
  72. Select, 1 for Adjust.
  73. workx%,worky% = work area coordinates of window window%
  74. that pointer was at when the mouse button was clicked.
  75.  
  76. user
  77. FNuser_menu(window%,icon%)
  78. IF the specified window (and icon) has a menu which you
  79. want to appear when Menu is pressed over it, then this
  80. function should return the handle of the menu.
  81. window% = handle of window.
  82. icon% = number of icon.
  83.  
  84. user
  85. PROCuser_openwindow(window%,x%,y%,stack%)
  86. IF this function is called, then the window whose handle
  87. is window% has been opened with the top left of the
  88. window at x%,y% on the screen.
  89. stack% = window handle to open behind, or -1 for top of
  90. window stack, or -2 for bottom.
  91.  
  92. user
  93. PROCuser_closewindow(window%)
  94. IF this function is called, then the window whose handle
  95. is window% has just been closed.
  96.  
  97. windows
  98. PROCwimp_openwindow(window%,centre%,stack%)
  99. Opens a window on the screen.
  100. window% = handle of window to open.
  101. If centre% = 0 opens window where it was last left on
  102. the screen, or if it hasn't been opened before, then
  103. where it is positioned in the template file.
  104. If centre% = 1 opens the window centred on the screen
  105. (mode independant).
  106. If centre% = 2 opens the window centred on the pointer.
  107. stack% = window handle to open behind, or -1 for top of
  108. window stack, -2 for bottom, or -3 for current stack
  109. position.
  110.  
  111. windows
  112. PROCwimp_openwindowat(window%,x%,y%,stack%)
  113. Opens a window on the screen so the top left of the
  114. window is at co-ordinates x%,y%.
  115. window% = handle of window to open.
  116. stack% = window handle to open behind, or -1 for top of
  117. window stack, -2 for bottom or -3 for current stack
  118. position.
  119.  
  120. windows
  121. PROCwimp_closewindow(window%)
  122. Closes a window (removes it from the screen).
  123. window% = handle of window to close.
  124.  
  125. messages
  126. PROCwimp_initmessages(path$)
  127. Reserves blocks of memory and sets up Messages file for
  128. use.
  129. path$ = full pathname of messages file to use.
  130.  
  131. messages
  132. FNwimp_messlook0(token$)
  133. Returns the string in the messages file for the token
  134. token$.
  135.  
  136. messages
  137. FNwimp_messlook1(token$,a$)
  138. Returns the string in the messages file for the token
  139. token$. Any '%0's in the string are replaced with a$
  140. before returning.
  141.  
  142. messages
  143. FNwimp_messlook2(token$,a$,b$)
  144. Returns the string in the messages file for the token
  145. token$. Any '%0's and '%1's are replaced with a$ and b$
  146. respectively before returning.
  147.  
  148. icons
  149. FNwimp_iconbar(sprite$,text$,pos%)
  150. Places an icon on the iconbar.
  151. sprite$ = name of sprite to put on iconbar.
  152. text$ = text to put underneath the icon eg. like the
  153. floppy drive icon. If text$ = "" then no text will be
  154. used, and the icon will be positioned correctly.
  155. pos% = controls the position of the icon. If pos% = 1
  156. then the icon will appear on the right. If pos% = 0 then
  157. it will appear on the left.
  158. Returns window handle.
  159.  
  160. menus
  161. PROCwimp_menupopup(menu%,bar%,x%,y%)
  162. Brings up the menu whose handle is menu% at the
  163. co-ordinates x%,y%. If bar%=1 then the menu will be
  164. positioned as for an iconbar menu, otherwise use 0.
  165.  
  166. icons
  167. FNwimp_geticontext(window%,icon%)
  168. Returns a string containing the text from the icon.
  169. window% = handle of window containing icon.
  170. icon% = icon number.
  171.  
  172. icons
  173. PROCwimp_puticontext(window%,icon%,text$)
  174. If the icon is indirected then the text in the icon is
  175. replaced with text$. If the icon is indirected then an
  176. error is caused.
  177. window% = handle of window containing icon.
  178. icon% = number of icon.
  179.  
  180. user
  181. FNuser_keypress(window%,icon%,key)
  182. IF a key is pressed while one of your windows has the
  183. input focus, or a hotkey is pressed, then this function
  184. is called. If you don't use the key then return a 0. If
  185. you do then return a 1.
  186. window% = handle of window with input focus.
  187. icon% = number of icon with caret.
  188. key = key code. For most keys it is an ASCII number.
  189. For special keys see the PRM.
  190.  
  191. user
  192. PROCuser_menuselection(menu%,item%)
  193. This function is called when the user has chosen a menu
  194. item from one of your menus.
  195. menu% = handle of menu.
  196. item% = item number (top item is 1).
  197.  
  198. menus
  199. FNwimp_createmenu(menu$,size%)
  200. Creates a menu structure from the string menu$. The menu
  201. handle is returned.
  202. For more information on menu$ see the manual.
  203. IF size%>number of items then the menu is dynamic, ie.
  204. the items can be increased up to size%.
  205.  
  206. misc
  207. PROCwimp_error(title$,error$,button%,prefix%)
  208. Reports an error using a standard error box.
  209. title$ = title of error window.
  210. error$ = error message.
  211. IF button%=1 then will have an 'OK' button.
  212. IF button%=2 then will have a 'CANCEL' button.
  213. prefix% = prefix flag. If = 0 then the title is title$.
  214. If = 1 then the title is prefixed by 'Error from '. If =
  215. 2 then the title is prefixed by 'Message from '.
  216.  
  217. misc
  218. FNwimp_errorchoice(title$,error$,prefix%)
  219. Reports an error using a standard error box.
  220. It has both 'OK' and 'CANCEL' buttons.
  221. title$ = title of error window.
  222. error$ = error message.
  223. IF prefix% = 0 then the title is title$. If prefix% = 1
  224. then the title is prefixed by 'Error from '. If prefix%
  225. = 2 then the title is prefixed by 'Message from '.
  226. Returns TRUE if 'OK' pressed. FALSE if 'CANCEL' pressed.
  227.  
  228. menus
  229. FNwimp_menusize(menu%)
  230. Returns the number of entries in the menu.
  231. menu% = handle of menu.
  232.  
  233. menus
  234. PROCwimp_menutick(menu%,item%)
  235. If the item doesn't have a tick next to it then this
  236. function places one. If the item does have a tick then
  237. it is removed.
  238. menu% = handle of menu.
  239. item% = item number (top item is 1).
  240.  
  241. menus
  242. PROCwimp_menudisable(menu%,item%)
  243. Greys out the menu item so it is un-selectable.
  244. menu% = handle of menu.
  245. item% = item number (top item is 1).
  246.  
  247. menus
  248. PROCwimp_menuenable(menu%,item%)
  249. Un-greys out the menu item so it is selecta