home *** CD-ROM | disk | FTP | other *** search
- Routine : PROCclose_down
- Library : WimpLib
- Purpose : Shuts down the WIMP environment and
- generally restores things to normal
- Source : User
- Author : Paul Hobbs
- Parameters:
- None
- Dependant Routines:
- None
- Global Variables:
- None
- Notes:
- None
- Routine : FNcreatewindow(title$,flags%,fcol%,
- bcol%,maxx%,maxy%,l%,b%,r%,t%)
- Library : WimpLib
- Purpose : Creates a WIMP window
- Source : User
- Author : Paul Hobbs
- Parameters:
- title$ : text for window title bar
- flags% : various control flags, i.e. scroll
- bars or not etc
- fcol% : foreground colour of work area
- bcol% : background colour of work area
- maxx% : max work area extent x (+ve)
- maxy% : max work area extent y (+ve)
- l% : initial WAE x min
- b% : initial WAE y min
- r% : initial WAE x max
- t% : initial WAE y max
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- titlefgcol : title bar fground colour
- titlebgcol : title bar bground colour
- scrollbarfgcol : scroll bar fground colour
- scrollbarbgcol : scroll bar bground colour
- highlightbgcol : title bar highlight when
- window has input focus
- Notes:
- None
- Routine : PROCupdatewindow(handle%,l%,b%,r%,t%)
- Library : WimpLib
- Purpose : Updates the specified area of the
- given window.
- Source : User
- Author : Paul Hobbs
- Parameters:
- handle% : handle of the window to update
- l% : WAE x min to update
- b% : WAE y min to update
- r% : WAE x max to update
- t% : WAE y max to update
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- Notes:
- Ordinates are given in graphic units relative
- to the window origin (bottom left hand corner)
- Routine : PROCopenwindow(handle%,full%,front%)
- Library : WimpLib
- Purpose : Opens a previously created window
- Source : User
- Author : Paul Hobbs
- Parameters:
- handle% : handle of the window to update
- full% : ?
- front% : if TRUE window is on top of any
- others
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- Notes:
- None
- Routine : PROCclosewindow(handle%)
- Library : WimpLib
- Purpose : Temporarily closes the specified
- window which may be re-opened using
- PROCopenwindow().
- Source : User
- Author : Paul Hobbs
- Parameters:
- handle% : handle of the window to close
- Dependant Routines:
- FNoktoclosew(handle%)
- Global Variables:
- block : parameter block
- Notes:
- The function FNoktoclosew() appears in the main
- program and can be used to disallow window
- closing, multiple window closing etc. It must
- be TRUE for the window to actually be closed.
- Routine : PROCdeletewindow(handle%)
- Library : WimpLib
- Purpose : Permanently removes the window whose
- handle is specified
- Source : User
- Author : Paul Hobbs
- Parameters:
- handle% : handle of the window to delete
- Dependant Routines:
- FNoktoclosew(handle%)
- Global Variables:
- block : parameter block
- Notes:
- The function FNoktoclosew() appears in the main
- program and can be used to disallow window
- closing, multiple window closing etc. It must
- be TRUE for the window to actually be closed.
- Routine : PROCcliprect(b, RETURN x1%,RETURN
- y1%,RETURN x2%,RETURN y2%)
- Library : WimpLib
- Purpose : Sets up a graphics clip window?
- Source : User
- Author : Paul Hobbs
- Parameters:
- b : address of parameter block
- Dependant Routines:
- PROClwaorigin(b,x0%,y0%)
- Global Variables:
- None
- Notes:
- None
- Routine : FNpoll(mask%)
- Library : WimpLib
- Purpose : Central routine of any wimp program.
- Handles all user actions.
- Source : User
- Author : Paul Hobbs
- Parameters:
- mask% : allows certain wimp events to be
- masked out. 0 means everything is
- allowed.
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- Notes:
- None
- Routine : PROCaction(evnt%)
- Library : WimpLib
- Purpose : Handles events returned by FNpoll()
- Source : User
- Author : Paul Hobbs
- Parameters:
- evnt% : the event number
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- claimmenu$ : name of menu routine control
- passes to on event nr 9
- claimdrag$ : name of user drag routine
- control passes to on event
- nr 7
- Notes:
- None
- Routine : PROCicon_create(handle%,l%,b%,r%,
- t%,fgcol%,bgcol%,flags%,data$)
- Library : WimpLib
- Purpose : Creates an icon
- Source : Acorn User Sep 88
- Author : Chris Adie
- Parameters:
- handle% : handle of the window the icon is in
- l% : xmin ordinate of icon
- b% : ymin ordinate of icon
- r% : xmax ordinate of icon
- t% : ymax ordinate of icon
- fgcol% : foreground colour of icon
- bgcol% : background colour of icon
- flags% : icon control flags
- data$ : text or sprite name for icon
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- Notes:
- Ordinates are relative to window origin in
- graphic units. An 'indirected' icon may be
- created by specifying the data in the form
- 'address%,12'. This is evaluated as an address
- plus the number of characters in the icon.
- Offsets i.e. 'address%+10,12' may also be used.
- Routine : PROCicon_deselect(handle%,iconh%)
- Library : WimpLib
- Purpose : Deselects a given icon in the
- specified window
- Source : Acorn User Sep 88
- Author : Chris Adie
- Parameters:
- handle% : handle of the window the icon is in
- iconh% : handle of icon to deselect
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- Notes:
- If a non selected icon handle (i.e. -1) is
- passed to the routine it is ignored.
- Routine : PROCicon_select(handle%,iconh%)
- Library : WimpLib
- Purpose : Selects (highlights) a given icon in
- the specified window
- Source : Acorn User Sep 88
- Author : Chris Adie
- Parameters:
- handle% : handle of the window the icon is in
- iconh% : handle of icon to select
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- Notes:
- None
- Routine : PROCicon_putdata(block,whandle%,
- ihandle%,data$,redraw)
- Library : WimpLib
- Purpose : Places a string into an icon data area
- to change the icon text or the name of
- the displayed sprite
- Source : User
- Author : Paul Hobbs
- Parameters:
- block : address of the data block to use
- whandle% : handle of the window the icon is in
- ihandle% : handle of icon to modify
- data$ : the text to place in the icon or the
- new sprite name
- redraw : flag (TRUE=icon is redrawn
- immediately)
- Dependant Routines:
- None
- Global Variables:
- None
- Notes:
- The redraw flag is provided as a selection of
- icons may be updated together and displayed
- with one redraw window call, or the window may
- be closed in which case the redraw will take
- place when it is opened.
- Routine : FNicon_getdata(block,whandle%,
- ihandle%)
- Library : WimpLib
- Purpose : Returns a string from the requested
- icon which is either the text or the
- name of a sprite
- Source : User
- Author : Paul Hobbs
- Parameters:
- block : address of the data block to use
- whandle% : handle of the window the icon is in
- ihandle% : handle of icon to retrieve the data
- from
- Dependant Routines:
- None
- Global Variables:
- None
- Notes:
- None
- Routine : PROCcaret_setposition(whandle%,
- ihandle%,xoff%,yoff%,height%,index%)
- Library : WimpLib
- Purpose : Sets the caret position within a
- window or a writeable icon
- Source : User
- Author : Paul Hobbs
- Parameters:
- whandle% : window handle
- ihandle% : icon handle
- xoff% : x offset of caret (within window)
- yoff% : y offset of caret (within window)
- height% : height of caret (OS coordinates)
- index% : index of caret inside string
- Dependant Routines:
- None
- Global Variables:
- None
- Notes:
- If the window handle is -1 then the caret is
- turned off. By setting height% to -1 the AWM
- calculates the x,y coordinates and the height
- from the window handle, the icon handle and the
- index into the string (an icon handle must be
- given). By setting index% to -1 the AWM will
- calculate the index and the caret height from
- the other data. A typical call for a writeable
- icon would be PROCcaret_setpostion(whandle%,
- ihandle%,-1,-1,-1,-1).
- Routine : PROCicon_handleCR(block,lo%,hi%)
- Library : WimpLib
- Purpose : Moves the input caret between
- writeable icons within the window
- passed to the routine in block!0
- Source : User
- Author : Paul Hobbs
- Parameters:
- block : address of the parameter block
- whandle% : window handle
- lo% : lowest icon handle in the group
- hi% : highest icon handle in the group
- Dependant Routines:
- PROCcaret_setposition()
- Global Variables:
- None
- Notes:
- When defining the writeable icons within a
- window it is necessary to ensure that the icon
- handles are in sequence so that this routine
- can 'wrap round' the caret movement correctly.
- To move between writeable icons in ascending
- icon handle order the <RETURN> key is used. To
- move in descending order <SHIFT/RETURN> is
- used. block!0 should contain the window handle,
- and block!4 should contain the current icon
- handle.
- Routine : PROCdefine_menu_text(text$,n,w,t,d,
- s,flags,sm,l)
- Library : WimpLib
- Purpose : Creates a text entry on a menu
- Source : Archive Vol 1 Issue 11
- Author : Adrian Look
- Parameters:
- text$ : menu text entry
- n : index number of menu entry
- w : if TRUE it is a writeable entry
- t : if TRUE entry is 'ticked'
- d : if TRUE entry has a dotted line
- after it
- s : if TRUE entry is non selectable
- flags : entry flags
- sm : number of sub menu
- l : if TRUE entry is the last in this
- menu
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- text$() : menu text array
- flags() : flag array
- submenu() : submenu index array
- flags : constant
- writeable : constant
- tick : constant
- dotted : constant
- last : constant
- shaded : constant
- Notes:
- None
- Routine : PROCcreate_menu(title$,n,x,y)
- Library : WimpLib
- Purpose : Creates a text entry on a menu
- Source : Archive Vol 1 Issue 11
- Author : Adrian Look
- Parameters:
- title$ : title for menu (12 chars max)
- n : number of menu entries
- x : initial x ordinate of menu
- y : initial y ordinate of menu
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- menu% : menu parameter block
- text$() : menu text array
- flags() : flag array
- submenu() : submenu index array
- flags() : flag array
- menu_title_fg : title foreground
- menu_title_bg : title background
- menu_work_fg : work area foreground
- menu_work_bg : work area background
- last : constant -1
- Notes:
- None
- Routine : PROCnewvals
- Library : WimpLib
- Purpose : Gets various global vars concerning
- the window whose handle has been used
- in a SYS "Wimp_GetWindowInfo" call
- Source : Risc User Apr 88
- Author : Felix Andrew
- Parameters:
- None
- Dependant Routines:
- None
- Global Variables:
- gbx : graphics window minx
- gby : graphics window miny
- gtx : graphics window maxx
- gty : graphics window maxy
- wbx : work area minx
- wtx : work area maxx
- wby : work area miny
- wty : work area maxy
- ebx : ?
- etx : ?
- ety : ?
- eby : ?
- xsc : x scroll offset
- ysc : y scroll offset
- hp : ?
- vp : ?
- Notes:
- The origin of the window is set to the bottom
- left hand corner.
- Routine : FNcreatedialog
- Library : WimpLib
- Purpose : Creates a dialog window and constrains
- the pointer until an icon has been
- selected.
- Source : Acorn User Sep 88
- Author : Chris Adie
- Parameters:
- None
- Dependant Routines:
- PROCcreateicon(handle%,l%,b%,r%,t%,flags%,
- fgcol%,bgcol%,data$)
- PROCopenwindow(handle%,full%,front%)
- PROCmouserectangle(l%,b%,r%,t%)
- Global Variables:
- claimdialog$ : owner of the dialog window
- Notes:
- Before calling this routine is is necessary to
- RESTORE the data pointer to a block of lines
- containing DATA items to define the window and
- the icons i.e.
-
- 1000REM owner title nicons width height
- 1010DATA "test","title"," 3"," 200"," 300"
- 1020REM minx miny maxx maxxy bg fg flag data$
- 1030DATA "10","10","60","60","1","2","&F11D",
- "OK"
- 1040etc.......
-
- Flag data may be indirected, for example
- 'address%,12'. The routine creates the window
- and the required icons. The 'owner' string is
- used to call FNclickdialog_owner(icon%) to
- handle mouse clicks in the window (in fact this
- is claimdialog$)
- Routine : FNcreatealert(message$)
- Library : WimpLib
- Purpose : Creates an alert window using the
- supplied message
- Source : Acorn User Sep 88
- Author : Chris Adie
- Parameters:
- message : the alert message
- Dependant Routines:
- PROCcreateicon(handle%,l%,b%,r%,t%,flags%,
- fgcol%,bgcol%,data$)
- PROCopenwindow(handle%,full%,front%)
- PROCmouserectangle(l%,b%,r%,t%)
- FNmax(a%,b%)
- Global Variables:
- oldmouseminx% : previous min x of pointer
- oldmouseminy% : previous min y of pointer
- oldmousemaxx% : previous max x of pointer
- oldmousemaxy% : previous max y of pointer
- alertmessage% : address of buffer for text
- Notes:
- The text data is indirected and stored at
- alertmessage%. This should be dimensioned to 80
- bytes. The message is displayed in a window
- centred on the screen and a warning icon plus a
- 'Continue' icon are also shown. The pointer
- cannot be moved outside the window and only by
- clicking on 'Continue' can the user close the
- alert window.
- Routine : FNinit_helpwin(file$,bgcol%,fgcol%)
- Library : WimpLib
- Purpose : Takes an ASCII text file and converts
- the lines of text into icons, defining
- a window to hold them all.
- Source : User
- Author : Paul Hobbs
- Parameters:
- file$ : the text file holding the
- help text
- bgcol% : background colour of the
- window
- fgcol% : text colour
- Dependant Routines:
- FNmem_subs()
- PROCcreatewindow()
- PROCcreateicon()
- PROCopenwindow()
- Global Variables:
- help_buffer : storage area for help text
- help_textloaded% : flag (TRUE or FALSE)
- chX% : x width of characters in
- pixels
- Notes:
- The text data can be prepared using First Word
- Plus with the file saved as ASCII data. This
- makes the line end bytes &0A so the routine
- converts these (using FNmem_subs()) to &0Ds to
- aid using the data to create icons. The Risc
- User text editor could also be used if the line
- terminator is set to &0A. The routine can only
- be executed once, but help_textloaded% is used
- to ensure this is the case.
- Routine : PROCopentemplate(filename$)
- Library : WimpLib
- Purpose : Opens a template file ready to load
- window definitions
- Source : Archive November 1988 Page 37
- Author : Adrian Look
- Parameters:
- filename$ : the name of the template
- file
- Dependant Routines:
- None
- Global Variables:
- None
- Notes:
- No checks are made to ensure that the file
- exists or that it is a valid template file.
- Routine : FNloadtemplate(ident$)
- Library : WimpLib
- Purpose : Reads a window definition from a
- template file
- Source : Archive November 1988 Page 37
- Author : Adrian Look
- Parameters:
- ident$ : the identifier of the
- desired window definition
- Dependant Routines:
- None
- Global Variables:
- block : parameter block
- iptr% : pointer to indirected
- workspace
- iend% : pointer to end of indirected
- workspace
- Notes:
- After the routine has been called and providing
- the identifier was found the window workspace
- may be overwritten. Indirected workspace must
- be preserved until the window is disposed of,
- however. If the routine fails it will return a
- null result. Due to bugs (?) in the Archive
- template editor menu templates cannot be
- loaded.
- Routine : PROCclosetemplate
- Library : WimpLib
- Purpose : Closes the current template file
- Source : Archive November 1988 Page 37
- Author : Adrian Look
- Parameters:
- None
- Dependant Routines:
- None
- Global Variables:
- None
- Notes:
- Only one template file may be open at a time.
- Routine : FNicon_decode(flag)
- Library : WimpLib
- Purpose : Displays in textual form the meaning
- of the icon flag specified
- Source : The Micro User March 1989 Page 44
- Author : Ken Down
- Parameters:
- flag : the flag to decode
- Dependant Routines:
- PROCdata_label_restore()
- Global Variables:
- None
- Notes:
- Only of use when writing the program!
-
-