gosub makeGUI
copy bitmap 1,0
set current bitmap 0
gosub prepArray
sync on
 
set text size 10
do
gosub showdata
set cursor 400,400
`print testing data
sync
loop
 
 
 
 
function eBox(x1,y1,x2,y2)
line x1,y1,x1,y2
line x1,y1,x2,y1
line x2,y1,x2,y2
line x2,y2,x1,y2
endfunction
 
 
 
 
showdata:
copy bitmap 1,0
ink rgb(200,200,200),0
for t=0 to (nEnt-1)
	Text 10,50+(t*15),Detail$(t,1)
next t
ink rgb(255,255,255),0
Text 10,50+(selected*15),Detail$(selected,1)
For t=0 to 4
	Text 400,100+(t*20),Detail$(selected,t+1)
next t
text 570,180,Detail$(selected,6)
if mousey()>50 and mousey()<470 and mousex()<320
	if mouseclick()=1
		selected=INT((mousey()-50)/15)
	endif
endif
rty=0
sty=0
rly=0
sly=0
brs$=bin$(Val(Detail$(selected,0)))
lrs=LEN(brs$)
If Val(Mid$(brs$,lrs-3))=1 then rty=1
If Val(Mid$(brs$,lrs-2))=1 then sty=1
If Val(Mid$(brs$,lrs-1))=1 then rly=1
If Val(Mid$(brs$,lrs))=1 then sly=1
if rty=1 then box 452,45,458,51
if sty=1 then box 602,45,608,51
if rly=1 then box 452,65,458,71
if sly=1 then box 602,65,608,71
return
 
 
 
prepArray:
dim Detail$(49,6)
nEnt=2
Detail$(0,0)="11"
Detail$(0,1)="Smith, Frank"
Detail$(0,2)="15 Poo Street"
Detail$(0,3)="Weebum Village"
Detail$(0,4)="Bottom"
Detail$(0,5)="England"
Detail$(0,6)="NE346HZ"
 
Detail$(1,0)="7"
Detail$(1,1)="Jones, Bernard"
Detail$(1,2)="82 Goodheart Lane"
Detail$(1,3)="Birmingham"
Detail$(1,5)="England"
Detail$(1,6)="GQ388Z"
return
 
 
makeGUI:
create bitmap 1,640,480
set text font "arial"
ink rgb(100,100,100),0
box 0,0,639,30
ink rgb(255,255,255),0
set text size 16
center text 320,0,"Christmas Card List"
line 0,30,639,30
line 320,30,320,479
set text size 10
text 330,40,"Recieved This Year" : eBox(450,43,460,53)
text 510,40,"Sent This Year" : eBox(600,43,610,53)
text 330,60,"Recieved Last Year" : eBox(450,63,460,73)
text 510,60,"Sent Last Year" : eBox(600,63,610,73)
text 330,100,"Name:"  : eBox(390,100,630,116)
text 330,120,"Address:"  : eBox(390,120,630,136)  : eBox(390,140,630,156)  : eBox(390,160,630,176)  
text 330,180,"Country:" : eBox(390,180,495,196) : text 502,180,"Postcode:" : eBox(565,180,630,196)
line 320,230,639,230
line 320,250,639,250
line 320,255,639,255
line 320,275,639,275
line 320,280,639,280
line 320,300,639,300
line 320,305,639,305
line 320,325,639,325
line 320,330,639,330
line 320,350,639,350
set text size 14
center text 480,230,"+ ADD CONTACT +"
center text 480,255,"+ EDIT CONTACT DETAILS +"
center text 480,280,"+ DELETE CONTACT +"
center text 480,305,"+ SAVE DATABASE +"
center text 480,330,"+ ORDER ALPHABETICALLY +"
for t=50 to 470 step 15
	line 0,t,300,t
next t
`displays 28 on screen at once
line 300,50,300,470
eBox(300,50,320,70)
eBox(300,450,320,470)
ink rgb(200,200,200),0
box 301,51,319,69
box 301,451,319,469
return