AutoHotkey Community

It is currently May 26th, 2012, 12:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: December 13th, 2008, 9:28 pm 
Offline

Joined: April 18th, 2007, 9:03 am
Posts: 127
6GuiContextMenu:
7GuiContextMenu:
8GuiContextMenu:
9GuiContextMenu:
10GuiContextMenu:
code

instead of making multi row for each gui can't i make like

6-10GuiContextMenu:
code

_________________
you'll have to excuse me...I'm from Sweden, so my English is not that good...(but now it's better cuz JSLover/Guest is helping me)...


Last edited by lilljimpa on December 14th, 2008, 1:08 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 10:14 pm 
Offline

Joined: May 25th, 2007, 6:13 pm
Posts: 373
Depends on the code and what is being done with those GUI's. If you have the same Context Menu for each of your GUI's then I don't see a problem with it.

Also, when you're dealing with multiple GUI's, you can use a_Gui to get the GUI number. Though I'm not sure if a Context Menu will allow that. The Docs mention a few of the instances which it will show a number, but you can try it if your Context Menu needs to be GUI-specific.

Ciao,
Dra'Gon

EDIT: OOPS! :oops: I just reread your question, didn't see that last part. That "6-10" thing probably won't respond to the context menu. But it seems to me I've seen a command which will allow for different Label names to be launched by GUI's automatically. I'll see if I can find it if someone else doesn't respond.

_________________
Image
For a good laugh {hopefully} >> megamatts.50megs.com

My WritersCafe profile>>
http://www.writerscafe.org/writers/BlueDragonFire/


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 10:27 pm 
Offline

Joined: May 25th, 2007, 6:13 pm
Posts: 373
Found it!

Code:
Gui 2:+LabelMyGui


Unfortunately, this will affect ALL GUI event labels for the GUI's you use this for. For instance, if on those GUI's {6-10} you put:
Code:
Gui 6:+Label6-10

Then your "6GuiClose:" would need to be "6-10GuiClose:" {same with the other GUI's}.

However, in a case like that you could do:
Code:
6-10GuiClose:
   Gui, %a_Gui%:Destroy
Return

And that should destroy only the GUI which launched the label.

Hope that helped a bit.

Ciao,
Dra'Gon

EDIT: I just noticed this is my "Year" Post {#365}. Woo-Hoo! :wink: :lol:

_________________
Image
For a good laugh {hopefully} >> megamatts.50megs.com

My WritersCafe profile>>
http://www.writerscafe.org/writers/BlueDragonFire/


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 11:40 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Here's a short bit of working code to illustrate Dra_Gon's explanation.
Code:
Loop,4
{
 Gui, %A_Index%:+Label1-4
 Gui, %A_Index%:Add, Text, w400, test %A_Index%
 Gui, %A_Index%:Show,% "y" 150*A_Index, %A_Index%
}
return

1-4Close:
ExitApp

1-4ContextMenu:
MsgBox, This is the context menu for Gui #%A_Gui%.
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2008, 1:08 am 
Offline

Joined: April 18th, 2007, 9:03 am
Posts: 127
thank you all

_________________
you'll have to excuse me...I'm from Sweden, so my English is not that good...(but now it's better cuz JSLover/Guest is helping me)...


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Morpheus, SKAN and 12 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