 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Carcophan
Joined: 24 Dec 2008 Posts: 768 Location: :noitacoL
|
Posted: Fri Oct 30, 2009 9:31 pm Post subject: Gui +/-disable parent/child GUI, not returning focus to GUI1 |
|
|
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 ) _________________ "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 |
|
 |
txquestor
Joined: 22 Aug 2009 Posts: 294
|
Posted: Fri Oct 30, 2009 11:46 pm Post subject: |
|
|
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 |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 2342
|
Posted: Sat Oct 31, 2009 5:20 am Post subject: |
|
|
should be
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 |
|
 |
carco-nli Guest
|
Posted: Sun Nov 01, 2009 3:17 am Post subject: |
|
|
I did try the '2:' bit in a number of times/ways....
however the missing 'd' at the end of disable(d).... arggg.
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|