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 

Need Gui button help...

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
mAdDoG



Joined: 29 Dec 2004
Posts: 65

PostPosted: Mon Mar 07, 2005 11:13 pm    Post subject: Need Gui button help... Reply with quote

Hi guys-

How can I make a "Next" button work for multple Gui's within a script?

Code:

HoleType:

Gui, Add, Radio, vHole_Type Checked x166 y20 w60 h30, Drilled
Gui, Add, Radio, x166 y60 w60 h30, Tapped
Gui, Add, Radio, x166 y100 w60 h30, Reamed
Gui, Add, Button, x246 y60 w40 h30, Next
Gui, Show, h144 w300, Hole Type
Gui, Color, White

Return
ButtonNext:
Gui, Submit

Gui, Destroy


HoleShape:

Gui, Add, Radio, vHole_Shape Checked x166 y20 w60 h30, Through
Gui, Add, Radio, x166 y60 w60 h30, Pointed
Gui, Add, Radio, x166 y100 w70 h30, Flat-Bottom
Gui, Add, Button, x246 y60 w40 h30, Next
Gui, Show, h144 w300, Hole Shape
Gui, Color, White

Return
ButtonNext:
Gui, Submit

Gui, Destroy

MsgBox, %Hole_Type%, %Hole_Shape% 
Return

GuiClose:
ExitApp

_________________
-buttons, buttons,...
I like to push all the buttons!!!
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Mon Mar 07, 2005 11:40 pm    Post subject: Reply with quote

mAdDoG wrote:
HoleType:
...
Gui, Add, Button, x246 y60 w40 h30, Next
Change this to: Gui, Add, Button, gNext x246 y60 w40 h30, Next

mAdDoG wrote:
HoleShape:
...
Gui, Add, Button, x246 y60 w40 h30, Next
Change this to: Gui, Add, Button, gNext x246 y60 w40 h30, Next

mAdDoG wrote:
ButtonNext:
Gui, Submit
Change this to:
Next:
Gui, Submit


Instead of using ButtonNext you're declaring a gosub routine when pressing the next button, should work...
_________________

Back to top
View user's profile Send private message Visit poster's website
mAdDoG



Joined: 29 Dec 2004
Posts: 65

PostPosted: Tue Mar 08, 2005 12:13 am    Post subject: Reply with quote

Quote:
gNext


Error: "Target label does not exist"
_________________
-buttons, buttons,...
I like to push all the buttons!!!
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Tue Mar 08, 2005 1:08 am    Post subject: Reply with quote

mAdDoG wrote:
Error: "Target label does not exist"
Did you remember to change ButtonNext: to Next: ?
_________________

Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Wed Mar 09, 2005 12:36 am    Post subject: Reply with quote

Says "Next" has been defined more than once.
Would it be better to use "Ok"? (default button name?)
I will eventually have many more gui's to add to this script,
& would like to share the same submit-button name somehow...
The script does work w/different button names when I used:
ButtonNext, &, ButtonOk

Code:

HoleType:

Gui, Add, Radio, vHole_Type Checked x166 y20 w60 h30, Drilled
Gui, Add, Radio, x166 y60 w60 h30, Tapped
Gui, Add, Radio, x166 y100 w60 h30, Reamed
Gui, Add, Button, gNext x246 y60 w40 h30, Next
Gui, Show, h144 w300, Hole Type
Gui, Color, White

Return
Next:
Gui, Submit

Gui, Destroy


HoleShape:

Gui, Add, Radio, vHole_Shape Checked x166 y20 w60 h30, Through
Gui, Add, Radio, x166 y60 w60 h30, Pointed
Gui, Add, Radio, x166 y100 w70 h30, Flat-Bottom
Gui, Add, Button, gNext x246 y60 w40 h30, Next
Gui, Show, h144 w300, Hole Shape
Gui, Color, White

Return
Next:
Gui, Submit

Gui, Destroy

MsgBox, %Hole_Type%, %Hole_Shape% 
Return

GuiClose:
ExitApp


Thanks for your help, Titan!
Back to top
Titan



Joined: 11 Aug 2004
Posts: 5390
Location: /b/

PostPosted: Wed Mar 09, 2005 12:51 am    Post subject: Reply with quote

Change the second Next button's lablel to Next_Btn2.

This way you can do:

Next:
Next_Btn2:
ButtonNext:
ButtonOk:
.... CODE ...
Return
_________________

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help 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