| View previous topic :: View next topic |
| Author |
Message |
JBensimon
Joined: 16 Nov 2004 Posts: 130 Location: New York
|
Posted: Tue Nov 16, 2004 6:58 am Post subject: Gui Control "G" (GoSub) bug? |
|
|
Hi.
Recently discovered AutoHotkey and am amazed at how powerfully, yet compatibly, it extends good old AutoIt2. Great job, and thanks!
Playing with the Gui features, I think I may have stumbled onto an issue: I thought that if an option like gLABEL is added to a radio button, the subroutine at LABEL would be executed when the state of the button changes, but it appears in fact to also execute when the button merely gains focus (e.g. via the Tab key). In fact, if the radio button is the first control in a dialog, its associated subroutine executes as soon as the dialog is displayed.
Thanks again,
Jacques. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10465
|
Posted: Tue Nov 16, 2004 1:56 pm Post subject: |
|
|
Thanks for reporting it. I've updated the installer to fix it: http://www.autohotkey.com/download/
"Fixed radio buttons so that receiving focus does not generate an unwanted launch of the g-label." |
|
| Back to top |
|
 |
JBensimon
Joined: 16 Nov 2004 Posts: 130 Location: New York
|
Posted: Wed Nov 17, 2004 5:48 am Post subject: |
|
|
| Amazing response. Thank you, Chris. |
|
| Back to top |
|
 |
Gre
Joined: 12 Oct 2004 Posts: 77 Location: São Paulo ,Brazil
|
Posted: Thu Nov 18, 2004 12:54 am Post subject: |
|
|
just downloaded new version, and my radio gsub are not working anymore.
Must I change something in my scripts?
thanks
EDIT
It is working...but only after a second click on the radio buttons |
|
| Back to top |
|
 |
JBensimon
Joined: 16 Nov 2004 Posts: 130 Location: New York
|
Posted: Thu Nov 18, 2004 5:13 am Post subject: Not quite fixed... |
|
|
Hi.
After testing, it appears that the radio gLabel is now executed when the first radio button in the group is selected (with a mouse click or space bar) or when the arrow key is used to navigate between radio buttons, but it is *not* executed if radio buttons other than the first are directly selected via mouse click.
This sample code illustrates this (it displays three radio buttons -- none of which is selected by default -- and a disabled check box. I wanted to have the check box become enabled only when one of the radio buttons has been selected):
Gui, Add, Text,, Select a button:
Gui, Add, Radio, gEnableCheck vRadioValue, Radio option 1
Gui, Add, Radio, gEnableCheck, Radio option 2
Gui, Add, Radio, gEnableCheck, Radio option 3
Gui, Add, Checkbox, Disabled vCheckValue, Checkbox option
Gui, Show,, Test
Return
EnableCheck:
GuiControl, Enable, CheckValue
Return
GuiClose:
ExitApp
CORRECTION:
Also found that the gLabel is in fact executed if a radio button is clicked twice. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10465
|
Posted: Thu Nov 18, 2004 9:42 pm Post subject: |
|
|
I think I've fixed quite a few problems thanks to your detailed reports. Here are the details:
Fixed radio buttons so that: 1) the g-label won't be launched just because the button receives keyboard focus; 2) the g-label is launched once rather than twice for each selection of a new button via the arrow keys; 3) focus is on the correct radio in the group when the group receives keyboard focus; and 4) back-to-back radio groups give their first radio button a tabstop.
If you have time, please re-download and give it a try. http://www.autohotkey.com/download/ |
|
| Back to top |
|
 |
JBensimon
Joined: 16 Nov 2004 Posts: 130 Location: New York
|
Posted: Sat Nov 20, 2004 12:59 pm Post subject: Works for me! |
|
|
| The new behavior appears to be perfect. Thanks, Chris. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10465
|
Posted: Sat Nov 20, 2004 4:13 pm Post subject: |
|
|
| Thanks for the feedback -- and for your original bug reports (without which it probably would have stayed broken for a month). |
|
| Back to top |
|
 |
|