array of TextFields

BlitzMax Forums/BlitzMax Beginners Area/array of TextFields

julianbury(Posted 2009) [#1]
I wish to make an App that requires multiple TextFields.
I need to identify them numerically.
So, Can I make an array of pointers to them?

Also, I am confused by how to make an array at all ... (TF stands for TextField)

Global TF:IntTypeId[]
Global TF[] = New IntTypeId[10]

For i=0 To 9
	TF[i]:TGadget = CreateTextField:TGadget(2, i*20, 196, 16,window:TGadget,0)
	SetGadgetFilter(TF[i], keyFilter)
Next

'==================================

Function keyFilter:Int(event:TEvent, context:Object)
Select Event.ID
	Case EVENT_KEYCHAR
	If event.data = 13 Then End
	If event.data < 32 Or  event.data > 122 Then Return False
	End Select
	Return True
End Function


Can any of you correct this or tell me it cannot be done?

julianbury (-_-)


plash(Posted 2009) [#2]
Global TF:TGadget[10]

For i=0 To 9
	TF[i] = CreateTextField:TGadget(2, i*20, 196, 16,window:TGadget,0)
	SetGadgetFilter(TF[i], keyFilter)
Next

'==================================

Function keyFilter:Int(event:TEvent, context:Object)
Select Event.ID
	Case EVENT_KEYCHAR
	If event.data = 13 Then End
	If event.data < 32 Or  event.data > 122 Then Return False
	End Select
	Return True
End Function



julianbury(Posted 2009) [#3]
Dear Plash,

Thank you so much.

(^_^)


julianbury(Posted 2009) [#4]
Hiya Plash :-)

Text appears in the textfields as I type but I need to make it all uppercase whichever case is typed.

I cannot see where to impose that adjustment. Can you advise me, please?

Thank you for your kind attention ...

(-_-)