Look at this function and tell me what you think about it
I made it whith DBC, don´t know if works on DBP.
rem *---*---*---*---*---*---*---*---*
rem *Created by Bluedeep* 11/4/2003 *
rem *---*---*---*---*---*---*---*---*
rem this is example of my inputbox-function.
rem box activates when cursor is over it.
rem you can set box active by pressing left mousebutton
rem over the box, doing so it´s active even when cursor is not over it.
rem if you want to deactive it, just leftclick somewhere on screen.
rem you can use right mousebutton to move box around
rem the screen if (movable) is set to 1.
set display mode 800,600,16
sync on : sync rate 0
do
if voidboxes=0
rem just drawing something in to backround :)
ink rgb(rnd(255),rnd(255),rnd(255)),0
c1=rnd(700) : c2=rnd(500)
box c1,c2,c1+100,c2+100
endif
a$=inputbox(300,300,200,0,0,100,80,80,180,1)
if a$="showfps" then fps=1
if a$="hidefps" then fps=0
if a$="hideboxes" then voidboxes=1
if a$="showboxes" then voidboxes=0
if a$<>"" then b$=a$
ink rgb(200,200,200),0
print b$
if fps=1 then text 750,5,str$(screen fps())
sync : cls
loop
rem px and py = x and y position
rem max = width
rem br, bg and bb = backroundcolor
rem tr, tg and tb = textcolor
rem movable = can it be moved
function inputbox(px,py,max,br,bg,bb,tr,tg,tb,movable)
if firstuse=0 then line$="" : firstuse=1
if oldpx<>px or oldpy<>py then moved=0 : firstuse=0 : line$="" : active=0
oldpx=px : oldpy=py
if moved=1 then px=fx : py=fy
if mousein(px,py,px+max,py+17)=0 and moving=0 and active=0
br=br/2 : bg=bg/2 : bb=bb/2
tr=tr/2 : tg=tg/2 : tb=tb/2
endif
if moving=1
moved=1
fx=mousex()-max/2 : fy=mousey()-8
if mouseclick()=0 then moving=0
if fx<0 then fx=0
if fy<0 then fy=0
if fx+max>screen width() then fx=screen width()-(max+5)
if fy+17>screen height() then fy=screen height()-20
endif
if mousein(px,py,px+max,py+17)=1 or moving=1 or active=1
if mouseclick()=2 and movable=1 then moving=1
if inkey$()="" and scancode()<>14 and mouseclick()<>1 then readytopress=1
if readytopress=1
if mouseclick()=1
readytopress=0
if active=0
active=1
else
active=0
endif
endif
if inkey$()<>"" then readytopress=0
if scancode()=14 then line$=left$(line$,len(line$)-1) : readytopress=0 : goto screening
new$=inkey$()
stri$=""
if returnkey()=1 then stri$=line$ : line$="" : new$="" : goto screening
if len(line$)<max/10 then line$=line$+new$
endif
endif
screening:
ink rgb(br,bg,bb),0
box px,py,px+max,py+17
ink rgb(tr,tg,tb),0
text px,py,line$
endfunction stri$
rem small mouseover detect function
function mousein(x,y,x2,y2)
bole=0
if mousex()>x and mousex()<x2
if mousey()>y and mousey()<y2 then bole=1
endif
endfunction bole