The delay parameter holds the interval time for the dialogue to remain on screen, specified in 50th of a second. If this value is greater than zero, the box will automatically exit after the chosen period has elapsed, with no n ed for any user input. On the other hand, a value of zero will wait patiently for a user response, or until the conditions specified in the flag values have been met.
The flag parameter is a simple bitmap, with a value of 1 in the relevant position activating the feature, and a zero disabling it. Here are the settings:
Bit 0 clears the keyboard buffer before running. This is similar to a CLEAR KEY command. Bit 1 ignores any accidental mouse key presses before the dialogue box is drawn. Bit 2 exits whenever a key is pressed from the keyboard. Bit 3 quits when the user clicks on one of the mouse keys.
Here are some example settings:
X> RUn 500,%1111; display box for five seconds or until mouse click or key press RUn 0,0; wait for quit button explained later
You can now display a crude requester on the screen, by changing the last working example as follows:
E> A$=A$+"BA 50,50; set the coordinate base" A$=A$+"SI 160,60; SA 1; save area under dialogue box" A$=A$+"IN 0,0,0; GB 5,5,155,56; IN 5,0,0; GB 0,0,150,50; draw a fancy box" A$=A$+"PO 5,10,'AMOS Professional',2,4; PR 45,20,'Basic',4; print messages" A$=A$+"RU 0,%0110; wait for either a mouse click or a key press" A$=A$+"EXit;" D=Dialog Box(A$)
Requesters serve a useful purpose, but real control panels need to employ buttons, icons and slider bars. The AMOS Professional Interface makes this very easy, and offers a large selection of options.
The last part of this Chapter deals with simple button commands Advanced control panels will be explained in Chapter 9.3. All these commands are used to display an object on the screen which is automatically assigned its own zone, and can then be manipulated in a variety of ways.
Interface buttons
BUtton
Interface instruction: define an Interface button
BU number,x,y,width,height,setting,minimum,maximum;[][]
The BUtton command defines a simple Interface button, which can then be selected directly using the mouse. This button system is very flexible, and can be used to generate dozens of different button types in a few simple lines of code.