PLEASE NOTE: this is a forwarded message from Dennis Fast and not me.
-----Original Message-----
From: "Fast, Dennis" <DFast@...>
To: <futurebasic@...>
I am writing a Crossword Puzzle.
I have a grid of 20 cols and 16 rows.
Here is how I create each puzzle cell:
-------------- (beware of line-breaks in the email)
SetRect(r, 20, 31, 50, 61) appearance button _EF1, _activeBtn,,,,, @r,
_kControlEditTextProc=20
=20
tfs.flags =3D
_kControlUseFontMask_kControlUseSizeMask_kControlUseFaceMask_kControlUse
JustMask_kControlUseBackcolorMask_kControlUseForecolorMask
=20
tfs.font =3D fn FMGetFontFamilyFromName("Arial")=20
tfs.size =3D 24=20
tfs.style =3D _boldBit%=20
tfs.just =3D _teJustCenter
tfs.forecolor.red =3D 0
tfs.forecolor.green =3D 0
tfs.forecolor.blue =3D 65535
tfs.backcolor.red =3D 65535
tfs.backcolor.green =3D 65535
tfs.backcolor.blue =3D 65535
=20
def SetButtonFontStyle(_EF1, tfs) s =3D " " def =
SetButtonTextString(_EF1,
s)=20
def buttonhelpSetText(_EF1,"Some Text")
--------------------
First I generate an array of letters, then place the letters into each
box.
I need to color the empty boxes Black. Later I will remove the letters
to leave blank white boxes for the player to enter Black letters into. I
will then check their letters against the correct letter. If it is wrong
I would like to color the wrong letter Red and if it is correct the
letter will turn Blue.
Here is my attempt at color.
--------------------------
local fn FillGrid
' letterNum is the number of the appearance button _EF#=20
' as defined in the ENUM of the Globals file.
letterNum =3D 0=20
for Row =3D 0 to 15
for Col =3D 0 to 19
letterNum++
def SetButtonTextString(letterNum, LetterGrid(Row,Col))
long if LetterGrid(Row,Col) =3D chr$(32)
' The @ DOES appear in the blank
boxes.=20
'Following colors do NOT.
def SetButtonTextString(letterNum, "@")
tfs.backcolor.red =3D 0
tfs.backcolor.green =3D 0
tfs.backcolor.blue =3D 0
def SetButtonFontStyle(letterNum, tfs)
xelse
tfs.forecolor.red =3D 0
tfs.forecolor.green =3D 0
tfs.forecolor.blue =3D 65535
tfs.backcolor.red =3D 65535
tfs.backcolor.green =3D 65535
tfs.backcolor.blue =3D 65535
def SetButtonFontStyle(letterNum, tfs)
end if=20
next Col
Next Row
end fn
--------------------------
I am not being successful.=20
Any suggestions you have would be greatly appreciated.