Amos Professional Manual  Contents  Index

Advanced Control Panels


It is similar to the AMOS Professional HSLIDER command, with the additional facility of allowing the slider's position to be determined directly using the mouse. All of the animation is handled by the Interface automatically.

Here is an explanation of the HS parameters, in the order that they are set.

The zone number is simply the number of the new zone that is to be defined. Next the width and the height of the slider is set, and since this is a horizontal bar being created, it is sensible for the width to be greater than the height!

The position parameter is a simple number, ranging from zero to "total", and it determines the default position of the slider's trigger, which is the active part of the horizontal bar, somewhere in the middle, that is dragged to the left or right by the mouse.

Total is the parameter which defines the maximum value that will be returned by the slider. Allowable positions range from 1 to "total", with each step representing a movement of the trigger, in pixels.

The step parameter controls the distance that is to be moved whenever the user clicks on the background area of the slider. The bar will scroll slowly towards the current mouse position in units specified by the number of pixels given in the "total" parameter above. Once the actual pointer has been reached, it will cycle back and forth by a single step.

Finally, a list of Interface commands is given within a set of square of brackets. This [changes] parameter will be called up whenever the slider is moved on the screen.

After a selector has been activated, its position can be read from the main AMOS Professional program using the RDIALOG function, as explained earlier in this Chapter. The new position will only be reported to the main program after the user releases the left mouse button.

The colours used by the slider bar are zero for the background area, 4 for the unselected bar and 3 for the selected bar, which is normally flashing. Here is a working example of a horizontal slider in action:

E> B$=B$+"BA 112,50; set base coordinates to the screen centre"
   B$=B$+"HSlide 1,0,0,100,16,0,1,100,1;[] define a one hundred position slider"
   B$=B$+"EXit;"
   Dialog Open 1,B$ : Rem Open a dialogue channel to the slider
   D=Dialog Run(1) : Rem Run the program held in B$
   Curs Off : Centre ""
   Rem Read the slider
   Repeat
    D=Dialog(1) : Rem See if slider has been selected
    If D<>0 Then Locate 14,20 : Print "Position ";Rdialog(1,1);" ";
   Until Inkey$<>""
   Dialog Close
Back    Next
09.03.08