I've read alot of the posts on using multiple GUI's and I'm still trying to understand the concept of using different GUI's out of order. I have a complex script which currently has 4 GUI's. I want to add a new one that will appear at the beginning of the script if a certain condition is met. I created the new GUI as #5 using code such as Gui, 5:Show.
My problem happens when the condition is met and I use Goto to get to GUI #5, get the input I need, then return to show GUI #1. GUI #1 displays OK, but none of the buttons work. Is this possible to accomplish or do I need to re-number all my GUI's?
Here's the beginning of the code (check for condition):
Code:
IfExist, %ProgramFiles%\Newforma\Fourth Edition\Project Center\ProjectCenter.exe
{
IfExist, C:\Program Files\DriveMap\DriveMap.exe
{
IfExist, %ProgramFiles%\LaunchPad\LaunchPadPrefs.ini
{
IniRead, PrefSet, %ProgramFiles%\LaunchPad\LaunchPadPrefs.ini, Settings, MappingProgram
If PrefSet = 1
Mapper = Drivemap
If PrefSet = 2
Mapper = Newforma
}
else
Goto, MappingPref
}
else
Mapper = Newforma
}
Here's the GUI #5:
Code:
MappingPref:
Gui, 5:Add, Text, x36 y10 w220 h20 , Choose your drive mapping preference:
Gui, 5:Add, Radio, vMapPref Checked x76 y40 w120 h30 , DriveMap
Gui, 5:Add, Radio, x76 y70 w120 h30 , Newforma
Gui, 5:Add, Button, x86 y110 w100 h30 , OK
; Generated using SmartGUI Creator 4.0
IfExist, %ProgramFiles%\LaunchPad\LaunchPadPrefs.ini
{
IniRead, PrefSet, %ProgramFiles%\LaunchPad\LaunchPadPrefs.ini, Settings, MappingProgram
GuiControl,, MapPref, %PrefSet%
}
Gui, 5:Show, x131 y91 h159 w293, New GUI Window
pause
5GuiClose:
ExitApp
5ButtonOK:
Gui,5:submit,hide
IfNotExist, %ProgramFiles%\LaunchPad
FileCreateDir, %ProgramFiles%\LaunchPad
IniWrite, %MapPref%, %ProgramFiles%\LaunchPad\LaunchPadPrefs.ini, Settings, MappingProgram
Gui,5:destroy
Gui, 1:Default
Goto, Step1
Goto, Step1 brings the script back to a point right where we were after the condition checking to launch GUI #1.
Any help is much appreciated!!