Textfield not registering Return
BlitzPlus Forums/BlitzPlus Programming/Textfield not registering Return
| ||
I've posted this in the bugs forum, but seeing as that gets about as many visitors as most old people's homes once the family have dumped their elders there I thought I'd try it here, too.pseudo_group_window = CreateWindow("Select Name For Group",ClientWidth(Desktop())/2,ClientHeight(Desktop())/2,256,128,0,1) pseudo_group_textfield = CreateTextField (16,16,ClientWidth(pseudo_group_window)-32,16,pseudo_group_window) SetGadgetText (pseudo_group_textfield,"hello") Repeat id=WaitEvent() DebugLog "Event = $"+Right$(Hex$(id),4) + " "+EventSource() + " "+EventData() Select id Case EVENT_GADGET If EventSource() = pseudo_group_textfield SetGadgetText (pseudo_group_label,EventData()) If EventData() = 13 Stop Exit EndIf EndIf End Select Forever Basically pressing enter in the textfield generates an event of value $104 (which doesn't exist) and the EventSource and EventData are both 0. Wuh? |
| ||
This is a problem, it work before but not now. I hear that someone used a button with the style set to 4. But I don't know how it work if you have more then one textfield that need's this function. Maybe the button and textfield needs to be in the same group?? |
| ||
Textfield isnt meant to have multiple lines, so that problem it. It just ignores them. |
| ||
If you look at this example: http://www.blitzbasic.com/codearcs/codearcs.php?code=1040 ..you will see that you can get the ENTER event (13) from the URLgo button. Not ideal, but it works, and BlitzMax MaxGUI works like this as well. |
| ||
Also try on a textarea but just make it the height of a field, and immed. grab the enter and clear the area |
| ||
@Beaker: Your code don't catch Enter anymore after the latest update of Blitz+. |
| ||
So it doesn't. Bummer. :( |
| ||
Fixed by changing the button style to 4: URLgo = CreateButton ("GO!",620,10,60,20,panel,4) Checkout the online help here: http://www.blitzbasic.com/bpdocs/command.php?name=CreateButton&ref=gui_cat |
| ||
Ta' muchly, I'll look into these solutions. However is it just me, or is that really kinda' @#!* that it's broken? I know that BP is lacking in many features but actually breaking existing ones is a plain crappy move on Mark's part. |
| ||
It's not broken, it was changed. I think it is an improvement. Also, I think the change was made by Skid, not Mark. |
| ||
How is it an improvement? If something works just peachy, and then stops working in the way that everybody expected it to work, then that's broken. Oh sure, we might have a button as well now, but that means cramming it into an existing layout which might have been carefully designed and won't easily accomodate such a thing (not a problem in my case). I don't mind extended functionality at all, I just mind people changing the goalposts. |
| ||
In my case I didn't use any buttons to my textfield from the begining, so I just made a 'emty' on like this,EnterButton=CreateButton("",0,0,0,0,Parent,4) So I don't need to change my layout. |