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 

[SOLVED] 6-10GuiContextMenu

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



Joined: 18 Apr 2007
Posts: 127

PostPosted: Sat Dec 13, 2008 8:28 pm    Post subject: [SOLVED] 6-10GuiContextMenu Reply with quote

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 Sun Dec 14, 2008 12:08 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Dra_Gon



Joined: 25 May 2007
Posts: 373

PostPosted: Sat Dec 13, 2008 9:14 pm    Post subject: Reply with quote

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! Embarassed 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.
_________________

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

My WritersCafe profile>>
http://www.writerscafe.org/writers/BlueDragonFire/
Back to top
View user's profile Send private message Send e-mail
Dra_Gon



Joined: 25 May 2007
Posts: 373

PostPosted: Sat Dec 13, 2008 9:27 pm    Post subject: Reply with quote

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 Laughing
_________________

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

My WritersCafe profile>>
http://www.writerscafe.org/writers/BlueDragonFire/
Back to top
View user's profile Send private message Send e-mail
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Sat Dec 13, 2008 10:40 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
lilljimpa



Joined: 18 Apr 2007
Posts: 127

PostPosted: Sun Dec 14, 2008 12:08 am    Post subject: Reply with quote

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)...
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
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