Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Easy List

Author
Message
Revolution
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location:
Posted: 9th Jan 2003 18:00
I have made this code for all you people who are board of bad option lists.



X=
Y=
Width=
Length=


Rem set up the look at the correct position
sync on
load image "up.bmp",1
load image "mid.bmp",2
load image "down.bmp",3
load image "ok.bmp",4
load image "cancel.bmp",5

ink rgb(255,255,255),0
box x,y,x+width-17,y+47
paste image 1,x+(width-16),y
paste image 2,x+(width-16),y+16
paste image 3,x+(width-16),y+32
paste image 4,x,y+58
paste image 5,x+40,y+58


Rem look at the list
Dim list$(length)
load array "list",list$()


Rem print the list
out:
for a=1 to 3
ink rgb(255,255,255),0
box x,y,x+width-17,y+47
set cursor x,y+((a-1)*16)
if a+extra=pick then ink rgb(100,200,100),rgb(255,255,255) : print checklist string$(a+extra#) else ink 0,rgb(255,255,255) : print checklist string$(a+extra#)
next a
sync
return


Rem loop
do
if mouseclick()=1 then
mx=mousex()
my=mousey()
repeat
until mouseclick()=0
gosub click
endif
sync
loop


Rem Click
Click:
if mx>x and mxy and myx+width-16 and mxy and my0
extra=extra-1
gosub out
endif

if mx>x+width-16 and mxy+32 and myx and mxy+58 and my0
goto ending
endif

if mx>x+40 and mxy+58 and my
Revolution
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location:
Posted: 9th Jan 2003 18:09
Annoying!



Images:
up 16x16 up arrow
mid 16x16 background tile
down 16x16 down arrow
ok 30x16 ok button
cancel 30x16 cancel button

Values:
use the first few lines to set where the list will be in your program. Recomended width is over 200. length is the length of the list.

List:
the list should be put into an array called 'list'


Any suport needed post or email j@higgs0029.freeserve.co.uk

Login to post a reply

Server time is: 2024-03-29 15:31:49
Your offset time is: 2024-03-29 15:31:49