tldm-universe/Ardent/UV/BP/MTF.PAINT.B

82 lines
2.3 KiB
Plaintext
Raw Normal View History

2024-09-09 21:51:08 +00:00
Subroutine MTF.PAINT.B(orientation, menu.x.orig, menu.y.orig, menu.width,
menu.choices, menu.items)
******************************************************************************
*
* Paint MOTIF like menu
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 10/14/98 23801 SAP Change copyrights.
* 05/13/91 8345 DTM Changed print to tprint
* 2/07/91 7673 DTM Changed drawing methods
* 06/28/90 7236 JWT New MOTIF like new capability
*
*******************************************************************************
* This subroutine paints a MOTIF menu object on the terminal screen.
* Arguments to the function are:
* orientation - is the menu horizontal (menubar) or vertical
*
* menu.x.orig - the x (horizontal) anchor point for the menu
*
* menu.y.orig - the y (vertical) anchor point for the menu
*
* menu.width - for vertical menus, the width of the menu;
* for horizontal menus, a dynamic array of horizontal
* start and end points.
*
* menu.choices - number of menu elements
*
* menu.items - dynamic array containing the preformated text
* of each menu line
id = "%W%"
$include UNIVERSE.INCLUDE MTF.INCL.H
if orientation = HORIZONTAL
then
* For a menubar we just print all the menu items across the
* line designated by menu.y.orig
for i = 1 to menu.choices
tprint @(menu.width<i,1>, menu.y.orig):menu.items<i>:
next i
end
else
* For a menu box, we first generate a border string for printing the
* top and bottom border.
border = str(h.line,menu.width-2)
* Then we print the upper border
tprint @(menu.x.orig,menu.y.orig):lu.corner:border:ru.corner
* And finally, we print the lower border
tprint @(menu.x.orig,menu.y.orig+menu.choices+1):ll.corner:border:rl.corner
* Now print each menu line
for i = 1 to menu.choices
tprint @(menu.x.orig,menu.y.orig+i):menu.items<i>:
next i
end
return
end