home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 24
/
CD_ASCQ_24_0995.iso
/
vrac
/
homonlib.zip
/
BOXCALC.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-04-13
|
1KB
|
41 lines
DEFINT A-Z
DECLARE SUB BoxCalc (t, l, b, r, wide, tall)
SUB BoxCalc (t, l, b, r, tall, wide)
'****************************************************************************
'This function is used by other functions that draw pop-up boxes to calculate
' the box coordinates.
'
'The box coordinates passed as t, l, b and r will be directly modified by the
' sub to contain the desired values.
'
'See EditBox(), PickBox(), ListBox() and Progress() for examples of use.
'
'****************************************************************************
IF t = 0 THEN 'If the top & left coordinates are passed
t = 13 - ((tall + 2) \ 2) 'as zero, assume they want the box
END IF 'centered on the screen.
b = t + tall + 1
IF l = 0 THEN
l = 41 - ((wide + 2) \ 2)
END IF
r = l + wide + 1
IF b > 23 THEN 'Try to avoid an error if possible,
x = b - 23 'remembering to leave room for the shadow.
b = b - x
t = t - x
END IF
IF r > 79 THEN
x = r - 79
r = r - x
l = l - x
END IF
END SUB