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 >
Wrap
Text File
|
1997-05-31
|
35KB
|
1,126 lines
misc
FNwimp_initialise(name$,wimpmem%,iconmem%,ver%)
This function registers your application with the Task
Manager and reserves some memory.
name$ = the name of your application eg. 'Draw'.
wimpmem% = number of bytes to reserve for icon data or
menu entries.
iconmem% = number of bytes to reserve for indirected
text. eg. window titles or long menu entries.
ver% = minimum version of RISC OS that the application
is allowed to run on multiplied by 100.
polling
PROCwimp_poll
This function is the main loop of your application. When
it has finished, your application has quitted. If
something happens to your application eg. an icon has
been clicked on, then the relevent function will be
called from the loop.
polling
PROCwimp_pollidle(seconds%)
If NULL=TRUE then PROCuser_null will be called every
seconds% seconds instead of every time control is passed
to the application and no event has occured.
polling
PROCwimp_singlepoll
The same as PROCwimp_poll, execpt that it is called once
and not in a loop. If something happens then the
relevent action will still be taken before returning.
Useful for making loops multitask, eg: raytracing,
printing, calculating, loading in data, etc.
Note: if calling in PROCuser_null, make sure NULL=FALSE
before this call (can set to TRUE afterwards) otherwise
recursion will occur.
polling
PROCwimp_singlepollidle(seconds%)
The same as PROCwimp_pollidle, except that it is called
once and not in a loop. If something happens then the
relevent action will be taken before returning. If
NULL=TRUE then PROCuser_null will be called after
seconds% seconds.
Useful for incorporating delays into multitasking loops.
Note: if calling in PROCuser_null, make sure NULL=FALSE
before this call (can set to TRUE afterwards) otherwise
recursion will occur.
user
PROCuser_redraw(window%,minx%,miny%,maxx%,maxy%,printing%,page%)
When this function is called, the Wimp wants you to
update the specified box on the screen. The box is in
the work area of the window whose handle is window% or
if printing then its in paper coordinates where the
origin is at the bottom left of the paper.
printing% = TRUE if currently printing, FALSE otherwise.
page% = number of page currently being printed if
printing%=TRUE.
minx%,miny% = bottom left co-ordinates of box in screen
coordinates.
maxx%,maxy% = top right co-ordinates of box in screen
coordinates.
user
PROCuser_mouseclick(window%,icon%,button%,workx%,worky%)
IF an icon has been clicked on in one of your windows
then this function is called.
window% = handle of window containing icon.
icon% = number of the icon clicked on.
button% = which mouse button was pressed. Eg. 4 for
Select, 1 for Adjust.
workx%,worky% = work area coordinates of window window%
that pointer was at when the mouse button was clicked.
user
FNuser_menu(window%,icon%)
IF the specified window (and icon) has a menu which you
want to appear when Menu is pressed over it, then this
function should return the handle of the menu.
window% = handle of window.
icon% = number of icon.
user
PROCuser_openwindow(window%,x%,y%,stack%)
IF this function is called, then the window whose handle
is window% has been opened with the top left of the
window at x%,y% on the screen.
stack% = window handle to open behind, or -1 for top of
window stack, or -2 for bottom.
user
PROCuser_closewindow(window%)
IF this function is called, then the window whose handle
is window% has just been closed.
windows
PROCwimp_openwindow(window%,centre%,stack%)
Opens a window on the screen.
window% = handle of window to open.
If centre% = 0 opens window where it was last left on
the screen, or if it hasn't been opened before, then
where it is positioned in the template file.
If centre% = 1 opens the window centred on the screen
(mode independant).
If centre% = 2 opens the window centred on the pointer.
stack% = window handle to open behind, or -1 for top of
window stack, -2 for bottom, or -3 for current stack
position.
windows
PROCwimp_openwindowat(window%,x%,y%,stack%)
Opens a window on the screen so the top left of the
window is at co-ordinates x%,y%.
window% = handle of window to open.
stack% = window handle to open behind, or -1 for top of
window stack, -2 for bottom or -3 for current stack
position.
windows
PROCwimp_closewindow(window%)
Closes a window (removes it from the screen).
window% = handle of window to close.
messages
PROCwimp_initmessages(path$)
Reserves blocks of memory and sets up Messages file for
use.
path$ = full pathname of messages file to use.
messages
FNwimp_messlook0(token$)
Returns the string in the messages file for the token
token$.
messages
FNwimp_messlook1(token$,a$)
Returns the string in the messages file for the token
token$. Any '%0's in the string are replaced with a$
before returning.
messages
FNwimp_messlook2(token$,a$,b$)
Returns the string in the messages file for the token
token$. Any '%0's and '%1's are replaced with a$ and b$
respectively before returning.
icons
FNwimp_iconbar(sprite$,text$,pos%)
Places an icon on the iconbar.
sprite$ = name of sprite to put on iconbar.
text$ = text to put underneath the icon eg. like the
floppy drive icon. If text$ = "" then no text will be
used, and the icon will be positioned correctly.
pos% = controls the position of the icon. If pos% = 1
then the icon will appear on the right. If pos% = 0 then
it will appear on the left.
Returns window handle.
menus
PROCwimp_menupopup(menu%,bar%,x%,y%)
Brings up the menu whose handle is menu% at the
co-ordinates x%,y%. If bar%=1 then the menu will be
positioned as for an iconbar menu, otherwise use 0.
icons
FNwimp_geticontext(window%,icon%)
Returns a string containing the text from the icon.
window% = handle of window containing icon.
icon% = icon number.
icons
PROCwimp_puticontext(window%,icon%,text$)
If the icon is indirected then the text in the icon is
replaced with text$. If the icon is indirected then an
error is caused.
window% = handle of window containing icon.
icon% = number of icon.
user
FNuser_keypress(window%,icon%,key)
IF a key is pressed while one of your windows has the
input focus, or a hotkey is pressed, then this function
is called. If you don't use the key then return a 0. If
you do then return a 1.
window% = handle of window with input focus.
icon% = number of icon with caret.
key = key code. For most keys it is an ASCII number.
For special keys see the PRM.
user
PROCuser_menuselection(menu%,item%)
This function is called when the user has chosen a menu
item from one of your menus.
menu% = handle of menu.
item% = item number (top item is 1).
menus
FNwimp_createmenu(menu$,size%)
Creates a menu structure from the string menu$. The menu
handle is returned.
For more information on menu$ see the manual.
IF size%>number of items then the menu is dynamic, ie.
the items can be increased up to size%.
misc
PROCwimp_error(title$,error$,button%,prefix%)
Reports an error using a standard error box.
title$ = title of error window.
error$ = error message.
IF button%=1 then will have an 'OK' button.
IF button%=2 then will have a 'CANCEL' button.
prefix% = prefix flag. If = 0 then the title is title$.
If = 1 then the title is prefixed by 'Error from '. If =
2 then the title is prefixed by 'Message from '.
misc
FNwimp_errorchoice(title$,error$,prefix%)
Reports an error using a standard error box.
It has both 'OK' and 'CANCEL' buttons.
title$ = title of error window.
error$ = error message.
IF prefix% = 0 then the title is title$. If prefix% = 1
then the title is prefixed by 'Error from '. If prefix%
= 2 then the title is prefixed by 'Message from '.
Returns TRUE if 'OK' pressed. FALSE if 'CANCEL' pressed.
menus
FNwimp_menusize(menu%)
Returns the number of entries in the menu.
menu% = handle of menu.
menus
PROCwimp_menutick(menu%,item%)
If the item doesn't have a tick next to it then this
function places one. If the item does have a tick then
it is removed.
menu% = handle of menu.
item% = item number (top item is 1).
menus
PROCwimp_menudisable(menu%,item%)
Greys out the menu item so it is un-selectable.
menu% = handle of menu.
item% = item number (top item is 1).
menus
PROCwimp_menuenable(menu%,item%)
Un-greys out the menu item so it is selecta