"Blood flows down one leg and up the other."
YOUR SECOND GFA BASIC 3.XX MANUAL
- or -
HOW I LEARNED TO STOP WORRYING AND LOVE GFA-BASIC
PART 26
CHAPTER TWENTY-FOUR - AES LIBRARY
by Han Kempen
APPL_INIT
If you use APPL_INIT() in a GFA-Basic program the function
returns 0, although my Dutch GFA-manual states otherwise.
EVNT_MESAG
With EVNT_MESAG you can use '0' for the address of the message-
buffer so the default buffer at address MENU(-2) is automatically
used:
~EVNT_MESAG(0)
GRAF_GROWBOX and GRAF_SHRINKBOX
The box-parameters for calling GRAF_SHRINKBOX should be the same
as those for calling GRAF_GROWBOX:
~GRAF_GROWBOX((x2-x1)/2,(y2-y1)/2,0,0,x1,y1,x2-x1,y2-y1)
COLOR 1 ! any colour, except 0
BOX x1,y1,x2,y2 ! and draw the box
(...)
COLOR 0 ! background-colour
BOX x1,y1,x2,y2 ! erase the box
~GRAF_SHRINKBOX((x2-x1)/2,(y2-y1)/2,0,0,x1,y1,x2-x1,y2-y1)
In my Dutch GFA-manual someone switched start and finish in the
description of GRAF_SHRINKBOX.
ALERT and FORM_ALERT
An Alert-box with one button (usually 'OK') is a little
frustrating for the user. Try to offer a choice:
ALERT 3,"This job will take |about 25 minutes",1,"OK|Cancel",k
If you need an empty line in an Alert-box, use a space between
two vertical rules:
ALERT,3,"...| |...",1,"...",k
GFA-Basic allows 4 lines of 30 characters (High/Medium rez) if
you use ALERT, but with FORM_ALERT you can use 5 lines. In both
cases you can use not more than 3 buttons, each at most 8
characters (High/Medium rez) wide:
m$=" line 1 | line 2 | line 3 | line 4 "
ALERT 3,m$,1," OK ",k
'
m$="[3][ line 1 | line 2 | line 3 | line 4 | line 5 ][ OK ]"
k=FORM_ALERT(1,m$)
You can show a GFA-error in an ALERT-box as follows:
gfa$=ERR$(ERR)
m$=MID$(gfa$,4,LEN(gfa$)-11)
m$=" *** GFA-Error *** |"+m$
ALERT 3,m$,1,"Sorry",k
If some characters are not visible in a button (or a button is
completely invisible), try broadening the Alert-box by adding
spaces to the widest text-line. If the widest text-line is as
long as the button-string, the Alert-box should look allright.
If you have pressed the left mouse-button on the very spot where
an Alert-button is about to appear, something goes wrong. GEM
appears to remember your last mouse-click, and erroneously
assumes you pressed the button after the Alert-box appeared. GEM
only selects the button if the mouse-click occurred in the exact
area of the Alert-button. To avoid this problem you should make
sure the user has released the mouse-button before you call the
Alert-box:
REPEAT
UNTIL MOUSEK=0 ! wait until mouse-buttons released
By the way, the AES uses an 8K buffer (one quarter of the
screen) to save the part of the screen where the Alert-box
appears. Ditto for a menu.
SHEL_GET and SHEL_PUT
GFA-Basic is run from a 'Shell-Program', usually the desktop. In
that case the file DESKTOP.INF can be found in the Environment-
Buffer. You can examine this file by transferring it to a string:
d$=STRING$(1024,0)
r%=SHEL_GET(1024,d$)
PRINTing this string is much easier than using a disk-editor to
examine DESKTOP.INF.
After changing the string, you could put it back in the buffer
with:
r%=SHEL_PUT(1024,d$)
This way you could change the lay-out of the desktop. If you
change the string, you should know that the desktop recognizes
the end of DESKTOP.INF by the byte &H1A. So don't forget to put
CHR$(26) at the end. If you want to save the new buffer, try:
OPEN "O",#1,"\DESKTOP.INF"
PRINT #1,LEFT$(d$,INSTR(d$,CHR$(26)))
CLOSE #1
Is that all there is to tell about the AES-library? Certainly
not, so at this point you will probably be disappointed, unless
you have read the paragraph 'The Author' in the chapter
'INTRODUCTION'. If you have any useful addition for this chapter,
please send it to me!
Procedures (CHAPTER.24)
Alert ALERT
Alert-box with 5 text-lines (instead of 4):
m$="Line 1|Line 2|Line 3|Line 4|Line 5"
@alert(1,m$,1," OK ",k) ! same parameters as ALERT
Box_grow and Box_shrink BOX_GROW
Show growing/shrinking box before drawing/erasing a rectangle:
@box_grow(50,50,200,200)
(...)
@box_shrink(50,50,200,200)
Disclaimer
The text of the articles is identical to the originals like they appeared
in old ST NEWS issues. Please take into consideration that the author(s)
was (were) a lot younger and less responsible back then. So bad jokes,
bad English, youthful arrogance, insults, bravura, over-crediting and
tastelessness should be taken with at least a grain of salt. Any contact
and/or payment information, as well as deadlines/release dates of any
kind should be regarded as outdated. Due to the fact that these pages are
not actually contained in an Atari executable here, references to scroll
texts, featured demo screens and hidden articles may also be irrelevant.