Changes to BORDER.UP for Advanced Revelation Version 2.0

Published ByDateVersionKnowledge LevelKeywords
Revelation Technologies01 FEB 19902.XINTERMEDIATEBORDER.UP, DISPLAY, SHADOWS, VIDEO.RW, VIDEO, ATTRIBUTES

Advanced Revelation Version 2.0 provides the option of displaying shadows below and to the right of windows, popups, and messages. BORDER.UP, the system subroutine that draws borders onto the screen, has been modified to automatically handle display of shadows. A flag has been added to the parameters passed to BORDER.UP to turn this feature on and off.

To display shadows using an R/BASIC program, there are two conditions. First, the environment flag for displaying border shadows must be set to true (field 76 in the current environment record). This flag can be set from the Video Environment window or by changing the 76th field of @ENVIRON.SET.

Second, the call to BORDER.UP must have the sixth field of the border type (fifth) argument set to logical true. Even if the call to BORDER.UP requests shadows they will not display if the environment flag is turned off. For an example of a BORDER.UP call that displays a shadow, see Figure 1.

Shadows will not display if the environment flag for border shadows is turned off, regardless of the border type flag setting.

When implementing shadows, you must be sure to accommodate shadows in calls to VIDEO.RW that save and restore the screen. To do so, add 2 to the top right X coordinate, and 1 to the bottom left Y coordinate so that the space occupied by shadows is included. A sample call to VIDEO.RW is illustrated in Figure 2.

Figure 1

* setting shadow flag

$INSERT INCLUDE, WINDOW.POINTERS

DECLARE SUBROUTINE BORDER.UP

EQU TRUE$     TO 1
EQU SHADOWON$ TO 6 ; * 6th attribute of border type

ULX   = 10     ; * upper left col
ULY   = 5      ; * upper left row
BRX   = 40     ; * bottom right col
BRY   = 15     ; * bottom right row
BTYPE = @AW<CBORDER.TYPE>         ;* border type
BTYPE<SHADOWON$> = TRUE$          ;* shadows on
ATTR             = @AW<CBORDER>   ;* border attribute

BORDER.UP(ULX,ULY,BRX,BRY,BTYPE,ATTR)

Figure 2

* including shadow offsets to VIDEO.RW call

$INSERT INCLUDE, WINDOW.POINTERS
DECLARE SUBROUTINE BORDER.UP, VIDEO.RW

EQU X_OFFSET$ TO 2 ; * offset for columns (add 2 columns)
EQU Y_OFFSET$ TO 1 ; * offset for rows (add 1 row)
EQU TRUE$     TO 1
EQU SHADOWON$ TO 6

IMAGE = ''
ULX   = 10     ; * upper left col
ULY   = 5      ; * upper left row
BRX   = 40     ; * bottom right col
BRY   = 15     ; * bottom right row

BTYPE = @AW<CBORDER.TYPE>       ;* border type
BTYPE<SHADOWON$> = TRUE$        ;* shadows on
ATTR             = @AW<CBORDER> ;* border attribute


/* these lines read the current video image and post a border
(spacing in the lines is used for clarity) */

VIDEO.RW( ULX, ULY, BRX X_OFFSET$, BRY Y_OFFSET$, 'R', IMAGE )
BORDER.UP( ULX, ULY, BRX, BRY, BTYPE, ATTR )
*
* your code here
*
* restore video image when done
VIDEO.RW(ULX,ULY,BRX X_OFFSET$,BRY Y_OFFSET$,'W',IMAGE)
  • tips/revmedia/r45.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1