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 +/-disable parent/child GUI, not returning focus to GUI1

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



Joined: 24 Dec 2008
Posts: 768
Location: :noitacoL

PostPosted: Fri Oct 30, 2009 9:31 pm    Post subject: Gui +/-disable parent/child GUI, not returning focus to GUI1 Reply with quote

I copied some code from the help file, about parent/child GUI's.

For some reason though, using almost exactly the same code from the CHM file, when I close GUI2, it will not re-enable GUI1.


Code:

;the  +owner1 and +disable are from the CHM help file

HotString:      ;launched from menu item in main GUI
Gui, 2:+owner1
Gui, 1:+Disabled   ;to prevent user from interacting with main gui
Gui, 2:Add, Text,    x10 y10, Type an abbreviation into field #1, that you would like to turn into a longer phrase.  [ Example:  pls ]`nType what you would like your abbreviation transfroemd to into field #2.  [ Example: Please ]`n"Pls" will now turn into "Please" everytime you type it!

Gui, 2:Add, Text,    x10 y80, 1.) Abbreviation to replace:
Gui, 2:Add, Edit,    yp+18 w120 vShortTerm

Gui, 2:Add, Text,    x10 y130, 2.) Replace abbreviation with:
Gui, 2:Add, Edit,    yp+18 w120 vFullTerm

Gui, 2:Add, Text,   x10 y175, Test it here...
Gui, 2:Add, Edit,    yp+18 w120 r1

Gui, 2:Add, Button, x160 y85 w130 h30 gViewAll, View Existing Strings ;from the file the strings are written to

Gui, 2:Add, Button, x160 y120 w130 h30 gAddNewString, Add this New String  ;to an ahk file, script later reloads main GUI so the hotsrtings will be in effect

Gui, 2:Add, Button, x160 y155 w130 h30 gEdit, Edit/change Existing Strings  ;not implimented yet

Gui, 2:+Resize   ;for testing
Gui, 2:Show, h250 w375, HotString Creation Tool

return


;this is directly from CHM help file
2GuiEscape:
2GuiClose:
Gui, 1:-Disable    ;does not re-enable the main GUI.  It is unclickable, unusable
Gui, Destroy
return




I can't see what I am doing wrong. Killing the GUI2 should return full control to GUI1, but it does not.

Any input? (aside from the typical 'r.t.f.m.' posters Twisted Evil )
_________________
"Unfortunately a "COM for Dummies" book would be a little like "Neurosurgery for Dummies," in the end you're just gonna have to learn" ~Tank
Back to top
View user's profile Send private message AIM Address
txquestor



Joined: 22 Aug 2009
Posts: 294

PostPosted: Fri Oct 30, 2009 11:46 pm    Post subject: Reply with quote

You can't just copy part of a script and expect to it work in your own
if you don't know what it's doing.

If you reread the help on GUI's, you'll find your mistake.
See what I changed in RED

Code:

;this is directly from CHM help file
2GuiEscape:
2GuiClose:
Gui, 1:-Disable    ;does not re-enable the main GUI because in your code you destroyed the main Gui. 
Gui, 2:Destroy
return

_________________

"Man's quest for knowledge is an expanding series whose limit is infinity"
Back to top
View user's profile Send private message
[VxE]



Joined: 07 Oct 2006
Posts: 2342

PostPosted: Sat Oct 31, 2009 5:20 am    Post subject: Reply with quote

Code:
Gui, 1:-Disable

should be
Code:
Gui, 1:-Disabled

just a typo...
_________________
My Home Thread
Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags !
Back to top
View user's profile Send private message
carco-nli
Guest





PostPosted: Sun Nov 01, 2009 3:17 am    Post subject: Reply with quote

I did try the '2:' bit in a number of times/ways....

however the missing 'd' at the end of disable(d).... arggg. Evil or Very Mad


Thank you VxE. Sorry to waste your time, and thanks for your eyes. I will update this Monday morning.


I leave my old posts up for searching reasons, but a forum mod can delete this if wanted. Typos aren't all that helpful to others.
Back to top
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