AutoHotkey Community

It is currently May 26th, 2012, 10:55 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: October 30th, 2009, 10:31 pm 
Offline

Joined: December 24th, 2008, 3:25 am
Posts: 1401
Location: :noitacoL
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: )


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 12:46 am 
Offline

Joined: August 22nd, 2009, 11:23 pm
Posts: 294
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

_________________
Image
"Man's quest for knowledge is an expanding series whose limit is infinity"


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2009, 6:20 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
Code:
Gui, 1:-Disable

should be
Code:
Gui, 1:-Disabled

just a typo...

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 1st, 2009, 4:17 am 
I did try the '2:' bit in a number of times/ways....

however the missing 'd' at the end of disable(d).... arggg. :evil:


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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 9th, 2010, 1:43 pm 
Offline

Joined: June 23rd, 2010, 1:56 pm
Posts: 10
carco-nli wrote:
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.

Actually, this post and your typo was helpful. I was making the same mistake in leaving the "d" off the end of Disabled.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 9th, 2010, 6:47 pm 
Offline

Joined: December 24th, 2008, 3:25 am
Posts: 1401
Location: :noitacoL
Phantom465 wrote:
carco-nli wrote:
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.

Actually, this post and your typo was helpful. I was making the same mistake in leaving the "d" off the end of Disabled.



Yay for a Zombie thread saving the day! 8)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 10th, 2010, 3:42 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3330
Location: Simi Valley, CA
I'll put up with any number of zombie threads so long as I know a new user searched the forums before posting. :lol:

++postcount

_________________
Ternary (a ? b : c) guide     TSV Table Manipulation Library
Post code inside [code][/code] tags!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 10th, 2010, 3:58 am 
Offline
User avatar

Joined: September 5th, 2009, 2:06 pm
Posts: 1713
Location: Somewhere near you
Image <-- Do you mean this one?

_________________
Image
The quick onyx goblin jumps over the lazy dwarf


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: hyper_, JSLover, Kirtman, Leef_me, Maestr0, Miguel, XstatyK and 61 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group