Amos Professional Manual  Contents  Index

AMOS Interface


The value of BPosition can be use4 to choose between two pictures representing ON and OFF in the following way:

X> BUtton 3,180,38,50,10,0,0,1
   [UNpack BPosition 13+;] toggle images 13 and 14 depending on bposition value
   [] no change routine required in this case

The same technique can be used to generate buttons with a number of different positions. All that is required is to specify the appropriate values of the setting, minimum and maximum parameters in your button definitions, then test BPosition as part of the main drawing routine. Here is a ready-made example using this system:

LD> Load "AMOSPro_Tutorials:Tutorial/Interface/Button_Types.AMOS"

BReturn
Interface instruction: change the setting of a button
BR new setting;

This instruction can only be used inside a dialogue change routine, which is held in the second pair of square brackets, as explained earlier. BReturn moves the button to the specified new setting, and changes the value of BPosition. It then calls up the original drawing routine to update the display. If this includes the BPosition function, the effect can be seen immediately.

This feature can be used to return the button to its original state, after the mouse key is released. If it is omitted, the button will stay in its current setting until it is chosen once more. Here is a schematic example:

X> BUtton 1,160,100,64,16,0,0,1;[drawing routine...][BReturn 0;]

BChange
Interface instruction: change the setting of any active button
BC number,new setting

An alternative way to change the setting of a button is to make it behave like a radio button. Here, only one of a group of buttons may be switched on at any time, and as soon as it is "on" the other related buttons automatically appear to be switched "off".

The BChange command is used to alter the setting of any active button on the screen, simply by specifying the number of the button or buttons that are to be changed, followed by the new setting required.

If many buttons are to be affected by this technique, the process can be simplified by assigning them all to the same identification number. Note that BChange has no effect on the current button, even if it is specifically given in the instruction. To change the setting of the current button, the BReturn command should be used instead.

Here is an instant working example of every button type:

LD> Load "AMOSPro_Tutorials:Tutorial/Interface/Working Buttons.AMOS"
Back    Next
09.01.13