I tried the EnableRadio change, and that somehow broke my check function so I could no longer submit. I tried moving it before "Check" and when I select the radio button it exits the app. I played with submit a little bit, but it didn't seem to change. I then added an extra return to Check in case that was causing the failure. The GUI stopped exiting, but checking the radio button no longer writes to my setup.ini file (listed in Check).
My current code (including some stuff I didn't show before):
Code: Select all
Gui, Add, Text, x92 y79 w390 h30 , Please verify your AutoHotKey folder:
Gui, Add, Radio, x92 y139 w290 h30 altsubmit gCheck vRadioGroup , Default C:\User\My Documents ;radio size position name and functions which includes tags
Gui, Add, Radio, x92 y209 w60 h30 altsubmit gCheck vCustomRadio Disabled, Custom
Gui, Add, Edit, x152 y209 w230 h30 vEditGroup gEnableRadio, Type here ;a field to add text
Gui, Add, Button, x92 y289 w100 h30 , Cancel
Gui, Add, Button, x282 y289 w100 h30 Disabled , Submit
Gui, Tab, Step3
...
Return
EnableRadio:
GuiControlGet, EditText,, EditGroup
if ( EditText != "Type here" && EditText != "" )
GuiControl, Enable, CustomRadio
Else
GuiControl, Disable, CustomRadio
return ; https://autohotkey.com/boards/viewtopic.php?f=5&t=52015
;button section
Check: ;radio button functions
gui, submit, nohide
if (RadioGroup = 1){
IniWrite, %A_MyDocuments%, %A_MyDocuments%\hotkey\autohotkey\setup.ini, FilePath, SetupPath
Gui, Tab, Step2
Gui, Add, Button, x282 y289 w100 h30 , Submit
return
}
else if (RadioGroup = 2){
Gui, Tab, Step2
Gui, Add, Button, x282 y289 w100 h30 , Submit
return
}
return
ButtonCancel:
ExitApp
return
ButtonSubmit:
;Still in progress regarding file paths
send ^{Tab}
if (RadioGroup = 2){
IniWrite, %EditGroup%, %A_MyDocuments%\hotkey\autohotkey\setup.ini, FilePath, SetupPath
...
return
}
else {
RunWait, %A_MyDocuments%\hotkey\autohotkey\GetRes.ahk, %A_MyDocuments%\hotkey\autohotkey ;tells the program to run the resolution finder. path should be updated
...
return
}