G-label not running for multi-line Edit control

Report problems with documented functionality
User avatar
Scoox
Posts: 125
Joined: 11 May 2014, 09:12
Location: China

G-label not running for multi-line Edit control

14 Dec 2016, 23:39

Please test the following code. In this example the two Edit controls are identical except that Edit2 is multi-row while Edit1 isn't. When Button is clicked, both edit controls are cleared, which should launch both Edit1() and Edit2(); in practice, only Edit1() is launched.

Code: Select all

#NoEnv
#SingleInstance Force

Gui, Add, Edit, vEdit1 gEdit1 r1
Gui, Add, Edit, vEdit2 gEdit2 r2 ;change this to r1
Gui, Add, Button, vButton gButton, Clear boxes
Gui, Show
Return

Button()
{
	GuiControl,, Edit1
	GuiControl,, Edit2
}

Edit1()
{
	SoundBeep, 1000, 200
}

Edit2()
{
	SoundBeep, 2000, 200
}

GuiClose()
{
	ExitApp
}
Thank you
just me
Posts: 9459
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: G-label not running for multi-line Edit control

15 Dec 2016, 02:28

The docs wrote:A g-label such as gMySubroutine may be listed in the control's options. This would cause the MySubroutine label to be launched automatically whenever the user or the script changes the contents of the control.
EN_CHANGE wrote:The EN_CHANGE notification code is not sent when the ES_MULTILINE style is used and the text is sent through WM_SETTEXT.

Source
I.e. AHK isn't notified of the change. AHK would need to post the notification by itself when processing the GuiControl command.
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: G-label not running for multi-line Edit control

15 Dec 2016, 10:56

prob should update the docs for this case

User avatar
Scoox
Posts: 125
Joined: 11 May 2014, 09:12
Location: China

Re: G-label not running for multi-line Edit control

15 Dec 2016, 12:09

Thank you, that at least explains it. So basically this is a feature? Wouldn't it be beneficial if single-line and multi-line both worked the same way? I'm not a programmer so I don't know the technical reasons behind this limitation, but as a newbie I scratched my head quite a while over this one, especially since there was no mention in the help. I really appreciate your responses, really helpful, cheers!

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 50 guests