93 lines
3.2 KiB
Brainfuck
Executable File
93 lines
3.2 KiB
Brainfuck
Executable File
Subroutine MTF.REDRAW.B
|
|
******************************************************************************
|
|
*
|
|
* Repaint MOTIF menu screen
|
|
*
|
|
* 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/15/96 18330 LDG Changed LEN() function to LENDP() for NLS DBCS.
|
|
* 05/13/91 8345 DTM Changed print to tprint
|
|
* 06/28/90 7236 JWT New MOTIF like new capability
|
|
*
|
|
*******************************************************************************
|
|
|
|
* This subroutine repaints all the stacked MOTIF menu objects on the
|
|
* terminal screen upon return from an executed subprogram. The stacked
|
|
* menu objects are retrieved from the common data stucture area. The
|
|
* element stk.top is the number of stacked elements. The other common
|
|
* data element used are:
|
|
*
|
|
* stk.title - menu stack, menu title
|
|
*
|
|
* stk.items - menu stack, menu item captions
|
|
*
|
|
* stk.x.orig - menu stack, menu x (horizontal) anchor point
|
|
*
|
|
* stk.y.orig - menu stack, menu y (vertical) anchor point
|
|
*
|
|
* stk.width - menu stack, menu width if vertical; dynamic array of
|
|
* x start and end points for each caption if horizontal
|
|
*
|
|
* stk.cursor - menu stack, menu cursor location
|
|
*
|
|
* stk.choices - menu stack, menu number of captions on menu
|
|
*
|
|
* By the convention of usage, the bottom stack element (element 1) is
|
|
* the menubar, and all the rest are menu boxes.
|
|
|
|
id = "%W%"
|
|
|
|
$include UNIVERSE.INCLUDE MTF.INCL.H
|
|
|
|
* Calculate the x position of the menu title, we center the title on the screen
|
|
* and then adjust the position by one space if the terminal has visable
|
|
* attributes.
|
|
|
|
title.pos = (COLUMNS - lendp(stk.title(1))) / 2
|
|
if VIDEO.SPACES then title.pos -= 1
|
|
|
|
* Clear screen to remove stuff left by previous program, then display menu
|
|
* and call MTF.PAINT.B to paint the main menubar
|
|
|
|
tprint @(-1)
|
|
tprint @(title.pos+lendp(stk.title(1))+1,0):@(-16):@(title.pos,0):@(-15):stk.title(1):@(-16)
|
|
call *MTF.PAINT.B(1, stk.x.orig(1), stk.y.orig(1),
|
|
stk.width(1), stk.choices(1), stk.items(1))
|
|
|
|
* If the cursor position for the menubar is set, display the selection
|
|
* indicator characters '<' '>'
|
|
|
|
if stk.cursor(1)
|
|
then
|
|
tprint @(stk.width(1)<stk.cursor(1),1>,stk.y.orig(1)):'<':
|
|
tprint @(stk.width(1)<stk.cursor(1),2>,stk.y.orig(1)):'>':
|
|
end
|
|
|
|
* Now redisplay each of the open menu boxes in the order they were entered.
|
|
* This is necessary since we do no real window management.
|
|
|
|
for i = 2 to stk.top
|
|
call *MTF.PAINT.B(VERTICAL, stk.x.orig(i), stk.y.orig(i),
|
|
stk.width(i), stk.choices(i), stk.items(i))
|
|
if stk.cursor(i)
|
|
then
|
|
tprint @(stk.x.orig(i) + 1, stk.y.orig(i) + stk.cursor(i)):'<':
|
|
tprint @(stk.x.orig(i) + stk.width(i) - 2, stk.y.orig(i) + stk.cursor(i)):'>':
|
|
end
|
|
next i
|
|
|
|
return
|
|
|
|
end
|