AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Gui Control "G" (GoSub) bug?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
JBensimon



Joined: 16 Nov 2004
Posts: 130
Location: New York

PostPosted: Tue Nov 16, 2004 6:58 am    Post subject: Gui Control "G" (GoSub) bug? Reply with quote

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
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Tue Nov 16, 2004 1:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
JBensimon



Joined: 16 Nov 2004
Posts: 130
Location: New York

PostPosted: Wed Nov 17, 2004 5:48 am    Post subject: Reply with quote

Amazing response. Thank you, Chris.
Back to top
View user's profile Send private message Visit poster's website
Gre



Joined: 12 Oct 2004
Posts: 77
Location: São Paulo ,Brazil

PostPosted: Thu Nov 18, 2004 12:54 am    Post subject: Reply with quote

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
View user's profile Send private message
JBensimon



Joined: 16 Nov 2004
Posts: 130
Location: New York

PostPosted: Thu Nov 18, 2004 5:13 am    Post subject: Not quite fixed... Reply with quote

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
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Thu Nov 18, 2004 9:42 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
JBensimon



Joined: 16 Nov 2004
Posts: 130
Location: New York

PostPosted: Sat Nov 20, 2004 12:59 pm    Post subject: Works for me! Reply with quote

The new behavior appears to be perfect. Thanks, Chris.
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10465

PostPosted: Sat Nov 20, 2004 4:13 pm    Post subject: Reply with quote

Thanks for the feedback -- and for your original bug reports (without which it probably would have stayed broken for a month).
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group