WimpExtension document: Slider                                        Doc 05
============================================================================

WimpExt_Slider           &46393
-------------------------------
R0 = reason code
other registers as appropriate for reason code

R0 = 1 - Describe Slider:
-------------------------
R2 = window handle
R3 = icon handle / unique id
Exit:
R0 = current offset
R4 = maximum offset

Allows you to read the current position of one of your drag bars.

R0 = 2 - Create Slider:
-----------------------
R2 = window handle
R3 = icon handle or -1
R4 = flags:
      0-1 Position:
            00 = horizontal (*)
            01 = undefined
            10 = undefined
            11 = undefined
      2-3 Bounding box:
            00 = constrain to icon number in R3 (*)
            01 = constrain to box pointed to by R6
            10 = undefined
            11 = undefined
      4-5 Colour bar box:
            00 = colour to icon number in R3
            01 = colour to box pointed to by R5
            10 = colour to 8 OS pixels within icon number in R3 (*)
            11 = undefined
       6  if set automatically start drag when click in bounding box (*)
       7  if set there will be one line of colour when slider is empty (*)
     8-23 reserved; MUST BE 0
    24-27 back colour (usually 0)
    28-31 filled colour (usually 7)
R5-> bounding box (if necassary - see flags)
R6-> colour bar box (if necassary - see flags)
Exit:
R3 = icon handle / unique id

Call this in your initialise code to setup your drag bars. Usually you would
want to use the (*)ed flags in R4 with valid window and icon handled in R2
and R3; R5, R6 are not needed in this case.

A unique id is returned if R3 was -1 on entry. R5 and R6 are relative to the
work area origin (the first four words of an icon block).

R0 = 3 - Destroy Slider:
------------------------
R2 = window handle
R3 = icon handle / unique id

Most applications do not need to remember R3 on exit from 'Create Slider'
but if you want to destroy the Slider you can call this. If you are
destroying a bar within an icon then the icon is automatically redrawn, if
the bar was not created within an icon then you must redraw the appropriate
area yourself.

R0 = 4 - Start drag:
--------------------
R2 = window handle
R3 = icon handle / unique id

Only needed if you did not set bit 6 in the flags when creating the drag
bar. An example would be if you at some times need to freeze the bar and
to do that you would not tell WimpExtension to automatically start the
drag but to wait until this reason code is called - of course if the drag
bar is not in an icon then you must call this to start the drag.

WimpExtension will send the following message when the drag ends:
    R1+16 = &45795 (WimpExtension_Slider)
    R1+20 = window handle
    R1+24 = icon handle / unique id
    R1+28 = final offset
    R1+32 = maximum offset

R0 = 5 - Destroy Sliders:
-------------------------

Removes all Sliders associated with your task. Done automatically for you
when you deregister the library.

R0 = 6 - Status:
----------------
Exit:
R2 = window handle or -1
R3 = icon handle / unique id

Allows you to read the current window and icon handle (or unique id) of the
currently being dragged slider or -1 if there are none. R2 will also be -1
if the current slider being dragged does not belong to your task.

R0 = 7 - Set slider:
--------------------
R2 = window handle
R3 = icon handle / unique id
R4 = new offset

Sets the slider position of the specified slider.

R0 = 8 - Set flags:
-------------------
R2 = window handle
R3 = icon handle / unique id
R4 = eor word
R5 = clear word

The new word will be (flags AND NOT clear word) EOR eor word. Only bits 6
to 7 and 24 to 31 can be altered at present - ie. whether the slider can be
dragged and what colour it is. The icon will be redrawn whatever R4 and R5
are on entry.
