home *** CD-ROM | disk | FTP | other *** search
- ShadowLib Version 1.01
-
- This document is a manual file to accompany the BASIC V procedure
- library Shadows. It attempts to provide instructions for utili-
- sing the library.
-
- Introduction
- ------------
- ShadowLib is a BASIC V procedure library containing a set of
- procedures to display a "shadow" behind a window during a drag
- when "instant effect" drags are configured.
- ShadowLib has been tested successfully with RISC OS versions
- 2, 3.00 and 3.1.
-
- Licence
- -------
- ShadowLib is FREEWARE ie it may be freely distributed as long
- as no charge is made for it and it remains unchanged. I do not
- require that the documentation and demonstration application be
- distributed with the library BUT I do require that I am fully
- credited in your documentation and !Help file.
- Note - at all times I, Simon J. Osborne, retain copyright on
- the library and its accompanying demonstration and documentation.
-
- This software is supplied as is and with no guarantee what so
- ever. At no time shall the author be liable for any loss or damage
- caused by the use, misuse or abuse of this application
-
- Important
- ---------
- Before detailing the use of the library please take note of
- the following important points :-
-
- All procedure names within the library begin Shadow_
- All function names within the library begin Shadow_
- All variable names within the library begin shadow_
-
- Thus any PROC/FN names beginning Shadow_ and any variable
- names beginning shadow_ should be treated as reserved and NOT
- used by your program.
- Additionally when using the library DO NOT mask out NULL
- events in your calls to Wimp_Poll or Wimp_PollIdle.
-
- Limitations
- -----------
- Currently ShadowLib will only function for windows that have
- a title bar, and it only supports a single nested window.
-
- Use
- ---
- First load the library into your application by adding a
- line similar to the following near the beginning of your program :
-
- LIBRARY '<Application$Dir>.ShadowLib'
-
- To utilise the library your program should be something like this
- (this is a very rough approximation to show where the library
- should be called, for full details of the procedures see below) :
-
-
- REM initialisation
- LIBRARY '<Application$Dir>.ShadowLib'
- PROCShadow_Init
- .
- .
- REM poll loop
- REPEAT
- SYS "Wimp_Poll",0,poll_block% TO reason%
- CASE reason% OF
- .
- .
- WHEN 2 : PROCShadow_PreOpen
- SYS "Wimp_OpenWindow",,poll_block%
- PROCShadow_PostOpen(poll_block%,-1)
- WHEN 3 : SYS "Wimp_CloseWindow",,poll_block%
- PROCShadow_Close(poll_block%)
- .
- .
- .
- ENDCASE
- PROCShadow_Poll(reason%)
- UNTIL finished
- END
-
- Procedures 1 (Essential)
- ------------------------
- The following are descriptions of the above essential
- procedures and their parameters
-
- PROCShadow_Init
-
- Call: This should be called once, and once only, after
- the library has been loaded, and after a call to
- SYS "Wimp_Initialise" but before the Wimp_Poll
- loop is entered.
-
- Purpose: Initialisation of the library and its variables
- etc.
-
- Parameters: None.
-
- PROCShadow_PreOpen
-
- Call: After open window request but before calling
- Wimp_OpenWindow.
-
- Purpose: Check to determine if a drag is in progress.
-
- Parameters: None.
-
- PROCShadow_PostOpen(poll_block%,handle%)
-
- Call: After open window request and after call to
- Wimp_OpenWindow.
-
- Purpose: Update the windows shadow.
-
- Parameters: Block returned by wimp_poll for open window
- request, handle of nested sub-window in front of
- this window or -1 for no sub-window.
-
- PROCShadow_Close(poll_block%)
-
- Call: After close window request and call to
- Wimp_CloseWindow.
-
- Purpose: Remove shadow if required.
-
- Parameters: Block returned by wimp_poll for close window
- request.
-
- PROCShadow_Poll(reason%)
-
- Call: At the end of the wimp poll loop, just before
- looping back.
-
- Purpose: House keeping.
-
- Parameters: Reason code returned by Wimp_Poll.
-
- Procedures 2 (Optional)
- -----------------------
- The following are descriptions of procedures which are not
- essential to the operation of the library but are used to tune
- its operation.
-
- PROCShadow_On
-
- Call: As required.
-
- Purpose: Switch on shadowing of a dragged window. Note this
- procedure is called automatically by
- PROCShadow_Init.
-
- Parameters: None
-
- PROCShadow_Off
-
- Call: As required.
-
- Purpose: Switch off shadowing of a dragged window.
-
- Parameters: None.
-
- PROCShadow_SetEndDelay(delay%)
-
- Call: After PROCShadow_Init, as required.
-
- Purpose: Set delay at end of drag before shadow is removed.
-
- Parameters: An integer delay, this is roughly the number of
- passes through the wimp poll loop before the
- shadow is removed. The default (set in
- PROCShadow_Init) is 2.
-
- Notes, Further Limitations and Suggestions
- ------------------------------------------
- If your application contains any windows which are not
- redrawn solely by the wimp manager you should call
- PROCShadow_SetEndDelay and increase the delay otherwise the
- shadowing effect may be lost. This is particularly important if
- your application contains several windows which will generate
- redraw events and which can be moved over each other.
-
- The library does not shadow any menus opened by your
- application but, it will shadow any windows opened as sub-menus
- eg Info boxes.
-
- As shadowing a window will slow down a drag, you should
- should include an option to allow the user to switch the shadows
- off, this is particularly important on ARM2 machines where the
- slowing effect is more noticeable.
-
- Tool boxes attached to the bottom of a window will obscure
- the shadow, as will tool boxes attached to the right.
-
- On RISC OS 3/3.1 the use of larger than normal sprites for
- the window tools will also obscure the shadow.
-
- Sub-windows/tool boxes should be handled as followed, if
- you are using the Wimp Extension modules just called
- "WimpExt_OpenLinked" instead of "Wimp_OpenWindow" (assuming that
- you have previously linked the windows). If you are manually
- linking windows then either call PROCShadow_PostOpen immediately
- after opening the main window or open the sub-window/tool box and
- call "Wimp_GetWindowState" for the main window before calling
- PROCShadow_PostOpen.
-
- It may be possible to have both a sub-window and a tool box
- if the tool box is "behind" the window it is attached to in the
- stack of windows. NB this has NOT been tested.
-
- Your program will almost certainly receive redraw events for
- the shadow window, these can be ignored.
-
- The Future
- ----------
- This is a short list of things which I intend to include in
- a future version of ShadowLib (If and when I get around to
- writing it):
-
- User selectable shadow colour.
-
- User selectable shadow offset.
- (For two reasons: to allow the shadow to be other
- than bottom-right and to allow for tool boxes on
- the bottom or right of a window)
-
- Semi-transparent shadows.
- This would probably slow the drag too much to be
- workable but could be useful to 'pick out' message
- boxes or other non-movable windows.
-
- Support for more than a single sub-window or tool box.
-
- Optimise and speed up the code.
-
- If you would like anything else added, or modified, please
- tell me, address below.
-
- Credit Where Credit Is Due
- --------------------------
- This library, its documentation and the accompanying
- demonstration were produced by me, Simon J. Osborne.
-
- Please send any comments, bug reports, etc to me at this address
-
- Simon J. Osborne
- 59 St Johns Road
- FROME
- Somerset
- BA11 2BB
-
- If you're feeling generous, please send me a copy of any
- applications you produce using the library.
-
- Live Long And Prosper
-
-
-