Reason Action
1 Describe Slider
2 Create Slider
3 Destroy Slider
4 Start drag
5 Destroy Sliders
6 Status
7 Set slider
8 Set flags
Provided by Slider
Describe Slider
Entry
R0 = 1
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.
Create Slider
Entry
R0 = 2
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 R0 with valid window and icon handled in R2 and R3; R4 is 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).
Destroy Slider
Entry
R0 = 3
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.
Start drag
Entry
R0 = 4
R2 = window handle
R3 = icon handle or 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
Destroy Sliders
Entry
R0 = 5
Removes all Sliders associated with your task. Done automatically for you when you deregister the library.
Status
Entry
R0 = 6
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.
Set slider
Entry
R0 = 7
R2 = window handle
R3 = icon handle / unique id
R4 = new offset
Sets the slider position of the specified slider.
Set flags
Entry
R0 = 8
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.
|
|
|