General Max Menu Dropdown Button

Hi Folks!
Recently i saw one 3Dmax script "Quickselection" here from Martin Breidt.
And it create one toolbar button with dropdown menu, its activates left mouse button.

My qestion is, is that bossible make my own customizable toolbar button, with that menu?
Example, if i click button, then dropdown menu shows me list of my commonly used menu items like
(Button)
----------
Save File
Undo
Redo
Rename
Array...
----------
Point is, that i can close top of 3Ds Max menubar, for extra space.
I hope i was enough clear, and i think its bossible, but not with google!

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Xkontod's picture

Thank you Miauu! Everything

Thank you Miauu!
Everything is working. Im satisfied right now.
But is there way, add submenu items?

(
 
	(		 
		rcMenu rcMapSize
		(
			menuItem Ava "Open"
			menuItem Tagasi "Undo"
			menuItem QuadCap "QuadCap"
 
			on Ava picked do max file open
			on Tagasi picked do max undo
			on QuadCap picked do fileIn ((getDir #userScripts)+"\\Menu\\rapidQCap.mse")
 
		) 
		rcPos = mouse.screenpos
		popUpMenu rcMapSize pos:rcPos align:#align_topcenter
	)
)
)
miauu's picture

.

(
	rcMenu rcMapSize
	(
		menuItem setGridSpacing1 "1" checked:false
		menuItem setGridSpacing5 "5" checked:false
		menuItem setGridSpacing10 "10" checked:false
		menuItem setGridSpacing50 "50" checked:false
		menuItem setGridSpacing100 "100" checked:false
		menuItem setGridSpacing500 "500" checked:false
		menuItem setGridSpacing1000 "1000" checked:false
		menuItem setGridSpacing5000 "5000" checked:false
		menuItem setGridSpacing10000 "10000" checked:false
 
		subMenu "Sub Menu" 
		(
			menuItem subMenu01 "SubMenu 01"
			menuItem subMenu02 "SubMenu 02"
			subMenu "Another Sub Menu"
			(
				menuItem subMenu03 "SubMenu 03"
				menuItem subMenu04 "SubMenu 04"
			)
		)
 
		on subMenu03 picked do (print "Sub Menu 03 was pressed")
 
		on setGridSpacing1 picked do SetGridSpacing 1
		on setGridSpacing5 picked do SetGridSpacing 5
		on setGridSpacing10 picked do SetGridSpacing 10
		on setGridSpacing50 picked do SetGridSpacing 50
		on setGridSpacing100 picked do SetGridSpacing 100
		on setGridSpacing500 picked do SetGridSpacing 500
		on setGridSpacing1000 picked do SetGridSpacing 1000
		on setGridSpacing5000 picked do SetGridSpacing 5000
		on setGridSpacing10000 picked do SetGridSpacing 10000			
	) 
	rcPos = mouse.screenpos
	popUpMenu rcMapSize pos:rcPos align:#align_vcentercenter		
)
miauu's picture
Xkontod's picture

Thank you! I think that would

Thank you!
I think that would work for me, and I test later on. But i really like, if that menu pops-up just one toolbar button. Is that some how bossible. I try later mix two scripts. i hope, that no cause problems with you and mr.Breidt.

Actual script is:

macroScript QuickSelection
	category:"MB Tools"
(
	-- dynamically build RCMenu + event handlers	
	numSels = getNumNamedSelSets()
	-- get all named selections and sort them alphabetically
	sel_list = #()
	for i = 1 to numSels do (
		append sel_list (getNamedSelSetName i)
	)
	sort sel_list
	-- build menu
	i = 0
	menustr = "RCMenu QuickSelsubMenu (\n"
	append menustr ("menuItem m_title \"QuickSelection v1.2\" enabled:false\n")
	append menustr ("separator sep0\n")
	-- collect named selection sets
	for selname in sel_list do (
		itemname = "m" + (i as string)
		selstr = "selectionSets[\"" + selname + "\"]"
		append menustr ("MenuItem " + itemname + " \"&" + selname + "\"\n")
		append menustr ("on " + itemname + " picked do ( select " + selstr + "; unhide " + selstr + " )\n")
		i += 1
	)
	-- add copyright entry
	append menustr ("separator sep1\n")
	append menustr ("menuItem m_extra \"© '03 [email protected]\"\n")
	append menustr ("on m_extra picked do ( ShellLaunch \"mailto:[email protected]\" \"\" )\n")
	append menustr (")\n")
	QuickSelSubMenu = execute menustr
 
	-- show popup menu
	popUpMenu QuickSelsubMenu
)
 
<code>
miauu's picture

.

Just use this:

-- show popup menu
popUpMenu QuickSelsubMenu pos:mouse.screenpos align:#align_vcentercenter

and the RCMenu will appear under the mouse cursor. If you want to run it via toolbar button the rc menu will appear over the button(where you click with the mouse cursor).

"i hope, that no cause problems with you and mr.Breidt."
Just give credits to the guys whose scripts you use to build your own tool.  :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.