How can I make CommandMenuButton auto-expand?

Next
 From:  Yuan
8918.1 
Hi Michael,

How can I make CommandMenuButton auto-expand?
hovering over it instead of showing the clickable arrowhead?I tried to rewrite the code but it didn't work.

<moi:CommandMenuButton menu="FileMenu.htm" title="File" icon="res://fileicon"><moi:Text textid="File"></moi:CommandMenuButton>

Rewrite to

<moi:CommandMenuButton menu="FileMenu.htm" title="File" icon="res://fileicon" onmouseover="if(this.contains(window.event.fromElement))return;moi.ui.showMenu('FileMenu.htm',this,0,0);"><moi:Text textid="File"></moi:CommandMenuButton>

Thanks a lot!

-Yuan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8918.2 In reply to 8918.1 
Hi Yuan, this should do it in the current MoI v4 beta:

code:
				<moi:CommandMenuButton menu="FileMenu.htm" icon="icons/FileIcon.png"
					onmouseenter="
						var e = document.createEvent( 'MouseEvent' );
						e.initMouseEvent( 'mousedown', false, false, window, 0, window.event.screenX, window.event.screenY, window.event.clientX, window.event.clientY, false, false, false, false, 1, null );
						this.dispatchEvent( e );
					"><moi:Text textid="File"/></moi:CommandMenuButton>


For V3 use onmouseover="" to trigger it instead of onmouseenter=""
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Yuan
8918.3 
Hi Michael,
Thank you for the code provided. I changed the "File", "Help"CommandMenuButton popups. This experience is really good. But it does not work for "ObjectSnap" or "GridSnap". Can it be done for StateButtons as well? At the same time you can hide the "Dropdown" button.
Thanks!
-Yuan
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8918.4 In reply to 8918.3 
Hi Yuan, sorry no that won't work for the Object snap or Grid snap buttons since they don't open the menu when the main button is clicked, instead they toggle the button state on/off when clicked. I don't know of any way to make those buttons have their menus open when just moving over the button but I would not recommend doing that anyway since it would interfere with clicking on the button to turn the snap on/off.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Yuan
8918.5 In reply to 8918.4 
Hi Michael,
It seems better not to modify these things. I like moi very much. Thanks a lot.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All