Positioning a Menu on the Screen


By default, menus and dialog boxes are centered on the screen. However, the exact location of a menu can be specified with the @x and @y options. The upper left-hand corner of the screen is the origin, with the coordinates (x=0, y=0). The screen has dimensions of 80 columns (x) by 24 rows (y). The bottom right-hand corner of the screen is x=80, y=24. To place the menu simple.men two characters from the left side of the screen and four characters from the top, add the @x and @y statements to the menu:


// Menu 3:
@x 2
@y 4
Menu with Specified Location
A Simple Menu

Maximum ~MAX
Minimum ~MIN
Range  ~MAX-MIN
More Info ~menufile("moreinfo.men")



An example of "cascading"


If there are no other menus present and the x and y coordinates for a menu are set to @x 0, @y 0, DADiSP places the menu in the upper left-hand corner of the screen. If there are other menus present, DADiSP places a menu with the coordinates of @x 0, @y 0 down and to the right of the upper-left corner of the previous menu. In this way, the menu appears stacked or "cascaded." You can create cascading nested menus simply by specifying @x 0 and @y 0 as the location for each menu.


The @xd and @yd options specify the menu location in pixels, also referred to as device coordinates.