Asfianda / agk

Automatically exported from code.google.com/p/agk
0 stars 0 forks source link

Bug GetEditBoxChanged + Return Key #532

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. see example
2. win 8
3.

What is the expected output? What do you see instead?
want:input, enter key, changed=1
see:input, enter key, lost focus, changed=0?
see:input, lost focus, changed=1

What version of the product are you using? On what operating system?
108 Beta 11

Please provide any additional information below.

//TEST

    //-------------------------------- Chat

    iBox=CreateEditBox()
    SetEditBoxBackgroundColor(iBox,255,255,255,128)

    SetEditBoxBorderColor(iBox,0,0,0,128)
    SetEditBoxBorderSize(iBox,0)
    SetEditBoxCursorBlinkTime(iBox,1)
    SetEditBoxCursorColor(iBox,255,255,255)
    SetEditBoxCursorWidth(iBox,0.5)
    SetEditBoxDepth(iBox,999)

    SetEditBoxMaxChars(iBox,32)
    SetEditBoxMaxLines(iBox,1)
    SetEditBoxMultiLine(iBox,0)
    SetEditBoxPosition(iBox,0,95)
    SetEditBoxSize(iBox,100,5)
    SetEditBoxText(iBox,"")
    SetEditBoxTextColor(iBox,255,255,255)
    SetEditBoxTextSize(iBox,4)

    //--------------------------------

do
    //focus,input,enter key,lost focus : not changed^^
    //focus,input,lost focus : changed=1

    if GetEditBoxChanged(iBox)=1
        changed=1
    endif
    print(changed)

    sync()

loop
end

Original issue reported on code.google.com by waitmess...@gmail.com on 15 Apr 2013 at 8:22

GoogleCodeExporter commented 9 years ago
You specify that you expect the changed value to be zero in certain 
circumstances.

However, your sample code never sets it to zero. It is initially zero, but the 
first time someone enters any text, it becomes one. And you don't do anything 
to change it back to zero.

There is also the command GetEditBoxHasFocus that will indicate whether it 
loses focus (indicated by returning zero).

Cheers,
Ancient Lady
TGC AGK Community Tester (not an employee)

Original comment by lady...@triassicassociates.com on 19 Apr 2013 at 8:49

GoogleCodeExporter commented 9 years ago
its just a test, if you press enter key the changed flag on screen is 0.
if i get the 1 i restart the programm and test again.
anyway this command don't work as i expect.
before some changes it works only with lostfocus per mouse click in world and 
the enterkey don't do lost focus.

Original comment by waitmess...@gmail.com on 20 Apr 2013 at 6:15

GoogleCodeExporter commented 9 years ago
The enter key is not supposed to lose focus. If anything, it is to indicate (in 
a single line input) that the input is done.

Where would you expect the focus to go upon hitting enter?

Even in things like web pages, the enter key doesn't always make you loose 
focus. If you see your cursor move to another field, it is because the 
programmer specifically catches the enter key and moves the input focus.

I think this is not a bug so much as a feature request.
Cheers,
Ancient Lady
TGC AGK Community Tester (not an employee)

Original comment by lady...@triassicassociates.com on 22 Apr 2013 at 2:33

GoogleCodeExporter commented 9 years ago
i want know only if the input is done.
the changed come not each key, so it must be the end of input.
now if you press the enter key i get NO changed=1, you must click in box again
and then outside this box for a lostfocus, then you get the changed.
i use a textbox for a chat in a multiplayer game.
anyway, i input my text, press enter because i am finish and this function
don't tell me changed, this is wrong.

Original comment by waitmess...@gmail.com on 22 Apr 2013 at 5:48

GoogleCodeExporter commented 9 years ago
Thanks for the example code, fixed in beta 12

Original comment by P.S.John...@gmail.com on 23 Apr 2013 at 9:25