Hey eveyone. I just downloaded the DBPro Demo today and spent about 20 minutes writing my first DBP function.
I have not yet figured out how to force the text to "wrap". I'm sure It will deal with finding the string length, comparing it to the width of the text box and "cutting" where necessary. I am just not sure how at the moment.
FUNCTION CreateBox(TL1,TL2,BR1,BR2,MenuHead$,Message$)
rem ** COLOR VARIABLES **
BorderColor=RGB(200,0,0)
HeadColor1=RGB(200,0,0)
HeadColor2=RGB(100,100,100)
BoxBody1=RGB(200,100,100)
BoxBody2=RGB(200,100,200)
BoxBody3=RGB(100,100,100)
BoxBody4=RGB(200,50,100)
HeadTextSize=16
CloseTextSize=15
HeadtextColor=RGB(0,0,0)
CloseTextColor=RGB(0,0,0)
MessageTextColor=RGB(10,50,0)
CloseBorder1=RGB(50,50,50)
CloseBorder2=RGB(255,255,255)
CloseBgColor=RGB(100,100,100)
rem ** END VARIABLES **
rem ** DRAW BOX **
BOX TL1-1,TL2-1,BR1+1,BR2+1,BorderColor,BorderColor,BorderColor,BorderColor
BOX TL1,TL2,BR1,BR2,BoxBody1,BoxBody2,BoxBody3,BoxBody4
BOX TL1,TL2,BR1,TL2+20,HeadColor1,HeadColor1,HeadColor2,HeadColor2
rem ** Create Close Button **
BOX (BR1-(BR1-TL1)/2)-26,(BR2-31),(BR1-(BR1-TL1)/2)+26,(BR2-4),CloseBorder1,CloseBorder2,CloseBorder1,CloseBorder2
BOX (BR1-(BR1-TL1)/2)-25,(BR2-30),(BR1-(BR1-TL1)/2)+25,(BR2-5),CloseBgColor,CloseBgColor,CloseBgColor,CloseBgColor
SET TEXT SIZE CloseTextSize
INK CloseTextColor,CloseTextColor
CENTER TEXT (BR1-(BR1-TL1)/2),(BR2-25),"CLOSE"
rem ** END CLOSE BUTTON
SET TEXT SIZE HeadTextSize
INK HeadTextColor,HeadTextColor
SET TEXT TO BOLD
CENTER TEXT (BR1-((BR1-TL1)/2)),TL2+2,MenuHead$
INK MessageTextColor,MessageTextColor
SET TEXT TO NORMAL
TEXT (TL1+5),(TL2+25),Message$
ENDFUNCTION
Please don't be too harsh, as it is my first piece of code.