home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / basic / drwimp / Utils / !Fnc'n'Prc / Info < prev    next >
Encoding:
Text File  |  1995-05-28  |  13.8 KB  |  478 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. misc
  14. PROCwimp_poll
  15. This function is the main loop of your application. When
  16. it has finished, your application has quitted.
  17. If 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. misc
  22. PROCwimp_singlepoll
  23. The same as PROCwimp_poll, execpt that it is called once
  24. and not in a loop. If something happens then the
  25. relevent action will still be taken before returning.
  26. Useful for making loops multitask, eg: raytracing,
  27. printing, calculating, loading in data, etc.
  28.  
  29. user
  30. PROCuser_redraw(window%,minx%,miny%,maxx%,maxy%)
  31. When this function is called, the Wimp wants you to
  32. update the specified box on the screen. The box is in
  33. the work area of the window whose handle is window%.
  34. minx%,miny% = bottom left co-ordinates of box.
  35. maxx%,maxy% = top right co-ordinates of box.
  36.  
  37. user
  38. PROCuser_mouseclick(window%,icon%,button%)
  39. IF an icon has been clicked on in one of your windows
  40. then this function is called.
  41. window% = handle of window containing icon.
  42. icon% = number of the icon clicked on.
  43. button% = which mouse button was pressed. Eg. 4 for
  44. Select, 1 for Adjust.
  45.  
  46. user
  47. FNuser_menu(window%,icon%)
  48. IF the specified window (and icon) has a menu which you
  49. want to appear when Menu is pressed over it, then this
  50. function should return the handle of the menu.
  51. window% = handle of window.
  52. icon% = number of icon.
  53.  
  54. user
  55. PROCuser_openwindow(window%,x%,y%,stack%)
  56. IF this function is called, then the window whose handle
  57. is window% has been opened with the top left of the
  58. window at x%,y% on the screen.
  59. stack% = window handle to open behind, or -1 for top of
  60. window stack, or -2 for bottom.
  61.  
  62. user
  63. PROCuser_closewindow(window%)
  64. IF this function is called, then the window whose handle
  65. is window% has just been closed.
  66.  
  67. windows
  68. PROCwimp_openwindow(window%,centre%,stack%)
  69. Opens a window on the screen.
  70. window% = handle of window to open.
  71. If centre% = 0 opens window where it was last left on
  72. the screen, or if it hasn't been opened before, then
  73. where it is positioned in the template file.
  74. If centre% = 1 opens the window centred on the screen
  75. (mode independant).
  76. stack% = window handle to open behind, or -1 for top of
  77. window stack, or -2 for bottom.
  78.  
  79. windows
  80. PROCwimp_openwindowat(window%,x%,y%,stack%)
  81. Opens a window on the screen so the top left of the
  82. window is at co-ordinates x%,y%.
  83. window% = handle of window to open.
  84. stack% = window handle to open behind, or -1 for top of
  85. window stack, or -2 for bottom.
  86.  
  87. windows
  88. PROCwimp_closewindow(window%)
  89. Closes a window (removes it from the screen).
  90. window% = handle of window to close.
  91.  
  92. messages
  93. PROCwimp_initmessages(pathname$)
  94. Reserves blocks of memory and sets up Messages file for
  95. use.
  96. pathname$ = full pathname of messages file to use.
  97.  
  98. messages
  99. FNwimp_messlook0(token$)
  100. Returns the string in the messages file for the token
  101. token$.
  102.  
  103. messages
  104. FNwimp_messlook1(token$,a$)
  105. Returns the string in the messages file for the token
  106. token$. Any '%0's in the string are replaced with a$
  107. before returning.
  108.  
  109. messages
  110. FNwimp_messlook2(token$,a$,b$)
  111. Returns the string in the messages file for the token
  112. token$. Any '%0's and '%1's are replaced with a$ and b$
  113. respectively before returning.
  114.  
  115. icons
  116. FNwimp_iconbar(sprite$,text$,pos%)
  117. Places an icon on the iconbar.
  118. sprite$ = name of sprite to put on iconbar.
  119. text$ = text to put underneath the icon eg. like the
  120. floppy drive icon. If text$ = "" then no text will be
  121. used, and the icon will be positioned correctly.
  122. pos% = controls the position of the icon. If pos% = 1
  123. then the icon will appear on the right. If pos% = 0 then
  124. it will appear on the left.
  125. Returns window handle.
  126.  
  127. menus
  128. PROCwimp_menupopup(menu%,bar%,x%,y%)
  129. Brings up the menu whose handle is menu% at the
  130. co-ordinates x%,y%. If bar%=1 then the menu will be
  131. positioned as for an iconbar menu, otherwise use 0.
  132.  
  133. icons
  134. FNwimp_geticontext(window%,icon%)
  135. Returns a string containing the text from the icon.
  136. window% = handle of window containing icon.
  137. icon% = icon number.
  138.  
  139. icons
  140. PROCwimp_puticontext(window%,icon%,text$)
  141. If the icon is indirected then the text in the icon is
  142. replaced with text$. If the icon is indirected then an
  143. error is caused.
  144. window% = handle of window containing icon.
  145. icon% = number of icon.
  146.  
  147. user
  148. FNuser_keypress(window%,icon%,code%)
  149. IF a key is pressed while one of your windows has the
  150. input focus, or a hotkey is pressed, then this function
  151. is called. If you don't use the key then return a 0. If
  152. you do then return a 1.
  153. window% = handle of window with input focus.
  154. icon% = number of icon with caret.
  155. code% = key code. For most keys it is an ASCII number.
  156. For special keys see the PRM.
  157.  
  158. user
  159. PROCuser_menuselection(menu%,item%)
  160. This function is called when the user has chosen a menu
  161. item from one of your menus.
  162. menu% = handle of menu.
  163. item% = item number (top item is 1).
  164.  
  165. menus
  166. FNwimp_createmenu(menu$,size%)
  167. Creates a menu structure from the string menu$. The menu
  168. handle is returned.
  169. For more information on menu$ see the manual.
  170. IF size%>number of items then the menu is dynamic, ie.
  171. the items can be increased up to size%.
  172.  
  173. misc
  174. PROCwimp_error(title$,error$,button%,prefix%)
  175. Reports an error using a standard error box.
  176. title$ = title of error window.
  177. error$ = error message.
  178. IF button%=1 then will have an 'OK' button.
  179. IF button%=2 then will have a 'CANCEL' button.
  180. prefix% = prefix flag. If = 0 then the title is title$.
  181. If = 1 then the title is prefixed by 'Error from '. If =
  182. 2 then the title is prefixed by 'Message from '.
  183.  
  184. misc
  185. FNwimp_errorchoice(title$,error$,prefix%)
  186. Reports an error using a standard error box.
  187. It has both 'OK' and 'CANCEL' buttons.
  188. title$ = title of error window.
  189. error$ = error message.
  190. IF prefix% = 0 then the title is title$. If prefix% = 1
  191. then the title is prefixed by 'Error from '. If prefix%
  192. = 2 then the title is prefixed by 'Message from '.
  193. Returns TRUE if 'OK' pressed. FALSE if 'CANCEL' pressed.
  194.  
  195. menus
  196. FNwimp_menusize(menu%)
  197. Returns the number of entries in the menu.
  198. menu% = handle of menu.
  199.  
  200. menus
  201. PROCwimp_menutick(menu%,item%)
  202. If the item doesn't have a tick next to it then this
  203. function places one. If the item does have a tick then
  204. it is removed.
  205. menu% = handle of menu.
  206. item% = item number (top item is 1).
  207.  
  208. menus
  209. PROCwimp_menudisable(menu%,item%)
  210. Greys out the menu item so it is un-selectable.
  211. menu% = handle of menu.
  212. item% = item number (top item is 1).
  213.  
  214. menus
  215. PROCwimp_menuenable(menu%,item%)
  216. Un-greys out the menu item so it is selectable.
  217. menu% = handle of menu.
  218. item% = item number (top item is 1).
  219.  
  220. icons
  221. PROCwimp_puticonbartext(text$)
  222. If the iconbar icon has text underneath it then it is
  223. replaced by text$.
  224.  
  225. icons
  226. PROCwimp_iconbarsprite(sprite$)
  227. Changes the sprite used for the iconbar icon to sprite$.
  228.  
  229. menus
  230. PROCwimp_menudottedline(menu%,item%)
  231. Adds a dotted line to the menu below the item.
  232. menu% = handle of menu.
  233. item% = number of item (top item is 1).
  234.  
  235. menus
  236. PROCwimp_menuclose
  237. Closes the currently active menu.
  238.  
  239. misc
  240. PROCwimp_loadsprites(pathname$)
  241. Creates a user sprite area and loads the sprites into it
  242. so they can be used in windows, etc.
  243. pathname$ = full pathname to sprite file.
  244.  
  245. windows
  246. FNwimp_loadwindow(pathname$,window$,sprite%)
  247. Loads in a window from a templates file and returns a
  248. handle for the window.
  249. pathname$ = full pathname to templates file.
  250. window$ = name of window in templates file.
  251. sprite% = sprite flag. If = 0 then use sprites from user
  252. sprite area for window. If = 1 then use sprites from the
  253. wimp sprite pool (RMA).
  254.  
  255. icons
  256. PROCwimp_putcaret(window%,icon%)
  257. Puts the caret in the icon.
  258. window% = handle of window containing icon.
  259. icon% = number of icon.
  260.  
  261. icons
  262. PROCwimp_losecaret
  263. Removes the caret from the icon it is in.
  264.  
  265. windows
  266. PROCwimp_putwindowtitle(window%,title$)
  267. Changes the window title to title$
  268. window% = handle of window.
  269.  
  270. windows
  271. FNwimp_getwindowtitle(window%)
  272. Returns a string containing the window title.
  273. window% = handle of window.
  274.  
  275. misc
  276. FNwimp_getleafname(pathname$)
  277. Returns a string containing the leafname from the
  278. pathname.
  279. pathname$ = pathname.
  280.  
  281. user
  282. PROCuser_savedata(pathname$,window%)
  283. When the user is required to save data, this function is
  284. called.
  285. pathname$ = full pathname of file to save data to.
  286. window% = handle of save window icon was dragged from.
  287.  
  288. user
  289. FNuser_loaddata(pathname$,window%,icon%,filetype$)
  290. You load data here.
  291. pathname$ = full pathname of source file.
  292. window% = handle of window file was dragged on to.
  293. icon% = number of icon file was dragged on to.
  294. filetype$ = filetype of file to be loaded. Eg. "FFF".
  295.  
  296. user
  297. FNuser_savefiletype(window%)
  298. You return the filetype for the save windows. eg.
  299. ='FFF'. For windows that aren't save windows, return an
  300. empty string eg. =''.
  301. window% = handle of window%
  302.  
  303. user
  304. FNuser_help(window%,icon%)
  305. Return a string to be used for interactive help for the
  306. window (and icon).
  307. window% = handle of window (containing icon).
  308. icon% = number of icon.                     
  309.  
  310. icons
  311. PROCwimp_iconenable(window%,icon%)
  312. Un-greys out icon so it can be selected.
  313. window% = handle of window containing icon.
  314. icon% = number of icon.
  315.  
  316. icons
  317. PROCwimp_icondisable(window%,icon%)
  318. Greys out icon so it cannot be selected.
  319. window% = handle of window containing icon.
  320. icon% = number of icon.
  321.  
  322. icons
  323. PROCwimp_iconselect(window%,icon%,state%)
  324. Selects (inverts) and un-selects icon.
  325. window% = handle of window containing icon.
  326. icon% = number of icon.
  327. If state% = 0 icon is un-selected. If state% = 1 icon
  328. is selected.
  329.  
  330. windows
  331. PROCwimp_banner(window%,delay%)
  332. Opens window in the centre of the screen for specified
  333. delay before closing it.
  334. window% = handle of window to open.
  335. delay% = number of seconds to keep window on screen.
  336.  
  337. misc
  338. PROCwimp_pointer(pointer%,area%,pointer$)
  339. Changes mouse pointer between the deafult (number 1) and
  340. the user defined pointer (number 2).
  341. If pointer% = 0 default pointer is used. If pointer% = 1
  342. user defined pointer is used.
  343. If area% = 0 wimp sprite pool is used. If area% = 1 user
  344. sprite area is used.
  345. pointer$ = sprite name of pointer.
  346.  
  347. user
  348. PROCuser_enteringwindow(window%)
  349. This function is called when the pointer enters a
  350. window.
  351. window% = handle of window.
  352.  
  353. user
  354. PROCuser_leavingwindow(window%)
  355. This function is called when the pointer leaves a
  356. window.
  357. window% = handle of window.
  358.  
  359. menus
  360. FNwimp_getmenutitle(menu%)
  361. Returns a string containing the title of the menu.
  362. menu% = handle of menu.
  363.  
  364. menus
  365. PROCwimp_putmenutitle(menu%,title$)
  366. Changes the title of the menu.
  367. If the title>11 characters then it is truncated.
  368. menu% = handle of menu.
  369. title$ = new title.
  370.  
  371. misc
  372. PROCwimp_starttask(command$)
  373. Sends command$ to the CLI. Omit '*'.
  374.  
  375. menus
  376. PROCwimp_putmenutext(menu%,item%,text$)
  377. Replaces menu items text with text$.
  378. menu% = handle of menu.
  379. item% = number of item (Top item is 1).
  380.  
  381. menus
  382. PROCwimp_menuwrite(menu%,item%,length%)
  383. Makes the menu item writeable.
  384. menu% = handle of menu.
  385. item% = number of item (top item is 1).
  386. length% = maximum length of text allowed to be entered.
  387.  
  388. menus
  389. FNwimp_getmenutext(menu%,item%)
  390. Returns a string containing the text of the menu item.
  391. menu% = handle of menu.
  392. item% = number of item (top item is 1).
  393.  
  394. windows
  395. FNwimp_getwindowsize(window%,side%)
  396. Returns the dimension required.
  397. If side% = 0 returns width. If side% = 1 returns height.
  398.  
  399. user
  400. FNuser_pane(window%)
  401. IF the window has a pane attached to it, then this
  402. function should return the window handle of the pane. If
  403. the window doesn't have a pane attached, then it should
  404. return a -1.
  405. window% = handle of window.
  406.  
  407. misc
  408. FNwimp_libversion
  409. Returns the version number of the library x 100. Eg. if
  410. the version of the library is 1.03 then 103 will be
  411. returned.
  412.  
  413. misc
  414. FNwimp_sysvariable(sysvar$)
  415. Returns a string for the system variable sysvar$.
  416. Note '<' and '>' are not required in sysvar$.
  417.  
  418. user
  419. PROCuser_null
  420. This is called continuously. So if you are writing
  421. something like a clock, you would monitor the time here
  422. and change any windows as required.
  423. IF you want to use this function then set NULL=TRUE.
  424.  
  425. menus
  426. PROCwimp_putmenuitem(menu%,item%,item$)
  427. If the menu is dynamic then item$ will be put into menu
  428. item item%. Any items below will be shuffled down. If
  429. item% is bigger than the current number of items+1, then
  430. it will be added to the bottom.
  431. menu% = handle of menu.
  432.  
  433. menus
  434. PROCwimp_removemenuitem(menu%,item%)
  435. Removes the item from the menu. Any items below are
  436. shuffled up. If there is only one item on the menu, then
  437. it cannot be removed.
  438. menu% = handle of menu. item% = number of item to
  439. remove.
  440.  
  441. menus
  442. PROCwimp_recreatemenu(menu%,menu$)
  443. Rebuilds the menu using the string menu$. More items can
  444. be included than the first time as long as you don't go
  445. over the pre-defined limit.
  446. menu% = handle of menu to rebuild.
  447.  
  448. menus
  449. FNwimp_createmenuarray(array$(),size%)
  450. Creates a menu from the array supplied. Each item of the
  451. menu is in a seperate element of the array. eg:
  452. array$(3)='Info>info%'. Note submenus are included in
  453. the usual way. the first element is the menu title, and
  454. the last must be 'END'.
  455. array$() = array to get items from.
  456. size% = maximum number of elements to allocate room for
  457. (doesn't have to be the current number).
  458. Returns a handle to the menu.
  459.  
  460. menus
  461. PROCwimp_recreatemenuarray(menu%,array$())
  462. Rebuilds the menu using the items in the array. The
  463. first array item (array$(0)) is the menu title, and the
  464. last has to be 'END'.
  465. Things like ticks and dotted lines are reset.
  466. Submenus are included with each item in the usual way,
  467. ie. array$(4)='Info>info%'.
  468. menu% = handle of menu to rebuild
  469. array$() = array to get items from.
  470.  
  471. misc
  472. PROCwimp_bar(window%,icon%,length%)
  473. Adjusts the length of a bar.
  474. window% = handle of window containing the bar.
  475. icon% = icon number of the bar.
  476. length% = length of the bar.
  477.  
  478.