Amos Professional Manual  Contents  Index

Windows


The AMOS Professional programmer expects to be able to produce file selectors, warning boxes and on-screen control panels with a few simple lines of code. The range of windowing command featured in this Chapter allow you to create interactive dialogue boxes by restricting text and graphics operations to selected areas of the current screen.

A "window" is simply a rectangular display area, which must first be opened before electronic life can course through it. Your current screen is treated as a window, and opened automatically by the AMOS Professional system as window number zero. All other windows have to be opened by you, and you are advised not to re-open window zero or change its size or position.

Creating windows

WIND OPEN
instruction: create a window
Wind Open number,x,y,width,height
Wind Open number,x,y,width,height,border

The window opened by this instruction will be displayed on screen and used for all subsequent text operation until you command otherwise. WIND OPEN must be qualified by a window number (don't forget that zero has already been allocated to the current screen), followed by the x,y graphic coordinates setting the top left-hand corner of the new window, followed by the width and height of the new window in the number of characters needed. You may also specify an optional border style, with values ranging from 1 to 16.

Because the Amiga employs its blitter to draw windows, they must always lie on a 16-pixel boundary. AMOS Professional automatically rounds your x-coordinates to the nearest multiple of 16. Additionally, if you have specified a border for your window, the x and y-coordinates will be incremented by an additional 8 pixels. In this way, you can be sure that your windows always start at the correct screen boundary. There are no boundary restrictions on the y- coordinates. Titles can also be included in window borders, which will be dealt with a little later. Try this example:

E> For W=1 To 3
    Wind Open W,(W-1)*96,50,10,15,W
    Paper W+3 : Pen W+6 : Clw
    Print "Window";W
   Next W

WINDOW
instruction: change the current window
Window number

This command sets the window number specified as the active window, to be used for all future text operations. There is an automatic saving system for re-drawing the contents of windows, which is explained below.

Back    Next
05.07.01