Syntax checking a field
BlitzMax Forums/MaxGUI Module/Syntax checking a field
| ||
| whats the event handle for detecting if the text in a field has changed? Not just when return has been pressed but as soon as a value has been entered and focus has left the gadget |
| ||
SuperStrict
Local MyWindow:TGadget=CreateWindow("TextField Example", 200,200,320,240)
Local Label0:TGadget=CreateLabel("Pls enter your name:",10,10,100,20,MyWindow)
Local Label1:TGadget=CreateLabel("You have keyed in:",10,40,200,40,MyWindow)
Local MyInput:TGadget=CreateTextField(110,10,180,20,MyWindow)
setgadgettext(myinput,"Hello World")
Repeat
WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
Case EVENT_GADGETACTION
SetStatusText(mywindow,"Text changed")
End Select
Forever
|
| ||
| that only does it for all fields, i want to do it on a per field basis ie: select eventsource() Case fld_to If EventData() =TEXT_CHANGED Then 'perform syntax checking on this field EndIf |
| ||
SuperStrict
Local MyWindow:TGadget=CreateWindow("TextField Example", 200,200,320,240)
Local Label0:TGadget=CreateLabel("Pls enter your name:",10,10,100,20,MyWindow)
Local Label1:TGadget=CreateLabel("You have keyed in:",10,40,200,40,MyWindow)
Local MyInput:TGadget=CreateTextField(110,10,180,20,MyWindow)
SetGadgetText(myinput,"Hello World")
Repeat
WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
Case EVENT_GADGETACTION
Select EventSource()
Case myinput
SetStatusText(mywindow , "Myinput changed")
End Select
End Select
Forever
|
| ||
| Great, thatl do it... damn why didnt i think of that!! LOL its late thx |
| ||
| The EVENT_GADGETLOSTFOCUS event might be useful too... |