Amos Professional Manual  Contents  Index

AMOS Interface


Please note that if the Interface program is to wait for user input, a RunUntil command must be included before the final EXit, otherwise the dialogue box will jump directly to the main AMOS Professional program after the last Interface program instruction. RunUntil is explained in detail below.

The DIALOG BOX facility is only intended for simple requesters. To control the dialogue directly from an AMOS Professional program, the DIALOG OPEN and DIALOG RUN commands must be used instead. These are fully explained at the beginning of Chapter 9.3, which is devoted to advanced control panels.

Creating a simple requester
If a large requester with a lot of graphics is to be generated, it can be very difficult to keep track of all of the coordinates. You can simplify things enormously by entering all of the coordinates relative to the top left-hand corner of the requester box.

BAse
Interface instruction: set coordinate base for dialogue box
BA x,y;

The BAse command sets the reference point for all future coordinate calculations, and is used by simply setting the screen coordinates of the new origin. The default coordinate values are 0,0.

If this command is called more than once, the new BAse setting will replace the previous one. This coordinate reference point can also be set using the x,y parameters with the DIALOG BOX command, as explained earlier. Here is a working example:

E> A$=A$+"BAse 50,50; set the coordinate base"
   A$=A$+"INk 5,0,0; Graphic Box 0,0,150,50; draw a filled bar in ink five"
   A$=A$+"PrintOutline 5,10,'AMOS Professional',2,4; print message in outline text"
   A$=A$+"PRint 45,20,'Basic',4; display message in normal text"
   A$=A$+"EXit; leave the interface program"
   D=Dialog Box(A$) : Wait Key

Saving the background graphics
The simple drawing operations used in these examples would destroy any existing graphics on the screen. But AMOS Professional dialogue boxes should wink into place over an existing display, and then return the screen to its original state after use. The Interface includes commands that do exactly that!

SIze
Interface instruction: define the size of graphics to be saved
SI width,height;

The SIze command sets the size of the dialogue box on the screen, and prepares the Interface system to save the background graphics. The location of this screen area is set by giving the number of pixels for the width of the zone, followed by the number of pixels for its height, measured relative to the reference point already set by the BAse command.

Back    Next
09.01.07