Page 1 of 1

MenuStrips

Posted: Mon Feb 11, 2013 9:55 pm
by djrikki
Hi,

Come across a very awkward limitation, although you give examples of the Cut, Copy and Paste menustrips in the documentation it appears that it is not possible to reference the same contextmenu twice!

Code: Select all

Menustrip object 'clipboard' has already been used!

Re: MenuStrips

Posted: Mon Feb 11, 2013 10:14 pm
by djrikki
How do I retrieve the ID of the gadget underneath the context menu that I have clicked on? (assuming the above is false and that I can share the same menustrip)

Re: MenuStrips

Posted: Mon Feb 11, 2013 10:18 pm
by djrikki
In fact... even with an ID how the hell do I find out what text the user has highlighted out of a string field? (because it might not be the full contents)

Re: MenuStrips

Posted: Tue Feb 12, 2013 4:54 pm
by airsoftsoftwair
It is possible to use the same context menu twice for multiple MUI objects but only within the same window! But you must not use a window's menustrip as a context menu or vice versa.
Check Area.ContextMenuTrigger to find out about the gadget underneath the context menu.

Re: MenuStrips

Posted: Wed Feb 13, 2013 7:41 pm
by djrikki
Nope, I just cannot get this to work. How do I use ContextMenuTrigger? In the examples you also have msg.triggervalue no mention in the documentation however?

Please can you can a short example in XML and HW.

Re: MenuStrips

Posted: Fri Feb 15, 2013 3:40 pm
by airsoftsoftwair
Suppose you want to have a context menu on a button, it works like that:

Code: Select all

<button contextmenu="id_of_context_menu" notify="contextmenutrigger" id="button_1">Test</button>
Whenever the user selects an item from the context menu, your event callback will be called with msg.ID set to the ID of the button ("button_1") and msg.TriggerValue set to the ID of the menu item that has been selected.

BIG PROBLEM: I've just realized that there's a bug in MUI Royale 1.0 which prevents msg.TriggerValue from getting the ID of the selected menu item. I'll fix this for the next version.

Re: MenuStrips

Posted: Wed Mar 13, 2013 11:26 pm
by djrikki
Yeah that is a big problem! Am moving on to Clipboard functionality now. ^.^ I look forward to your next release.

Re: MenuStrips

Posted: Wed Mar 13, 2013 11:32 pm
by djrikki
Again, I realise its a MUI limitation that I cannot use a menustrip between windows... but Jack now has 31 windows! Thats a lot of unnecessary duplication. :lol: Not all of them have String gadgets though.

Re: MenuStrips

Posted: Thu Mar 14, 2013 9:57 pm
by airsoftsoftwair
You could use Application.Menustrip to set a global menu strip for all windows that do not define their own menustrip. This way you should be to reduce menu strip overhead a little.