Notifications
Clear all

[Closed] cui.dockDialogBar #cui_dock_top

When I call this from script on a dockable dialog, it automatically aligns the dialogbar UNDERNEATH the max main toolbar, when there is clearly space for this next to it. Has anyone found a way around this behaviour?

6 Replies

I couldn’t find any good solution. That’s why i always auto-dock at the bottom.

ballsacks. Stupid max. Thanks Denis.

I have a max rollout that is kind of acting like a borderless dialog (with an empty style array). It is not docked. I have set the parent property of the rollout to max, and when max minimizes, the dialog does too.

Only quirk is if you have two max instances open, it loses the ability to twin the correct dialog to the foreground of the current instance. So we can have a situation where the dialog clicked is the max instance in the background, and the not the one being currently worked in.

Until this weird docking behaviour presented itself, I thought it might be a solution. But i don’t really want to dock at the bottom.

Watch this video.

//youtu.be/-UCXlXwitqs

The docking part starts from 1:50. This script alwas run when 3dsMax starts and it is always docked to the Top, right after main toolbar buttons.
I don’t know if I have the proper solution, but it the scripts works as you want it I can show what I use to dock the toolbar.

this is not probably a problem to dock something at top. the problem is the docked toolbar (dialog) is always going on first line, and it doesn’t care is there enough room or not. the same behavior for the left and right docking. only bottom docking can take (actually takes) a new line

Hi Kostadin,

Yes! The docking behaviour you have for dock_top is what I am after. On my max it always places the docked dialog below the main toolbar (enlarging the area at the top) If I manually move the dialog to the right of the main toolbar it is fine, but i don’t understand why it cant put it there in the first place. Your solution would be useful, as the script is our main pipeline menu system that loads automatically on max start.

First download and watch this video.

This is the code that I use when the rollout with the buttons are created.
I use the same code to dock the rollout(without reading the ini file).



on rol_miauuSnapsToogle open do
(
			if doesFileExist iniFile do
			(
				 try
				 (					
					dockPos = ((getINISetting iniFile "Rollout" "DockPos") as string)
					case dockPos of
					(
						"cui_dock_top":
						(
							try(cui.UnRegisterDialogBar rol_miauuSnapsToogle)catch()
							--	rearrange buttons to be horizontal
							for b = 1 to btnsArr.count do
							(
								btnsArr[b].pos = [( b * 26), 0]
							)
							rol_miauuSnapsToogle.height = 25
							rol_miauuSnapsToogle.width = 363
							cui.RegisterDialogBar rol_miauuSnapsToogle minSize:[363,25] maxSize:[363,25] style:#(#cui_dock_horz)
							cui.DockDialogBar rol_miauuSnapsToogle #cui_dock_top
							try(setINISetting iniFile "Rollout" "DockPos" (#cui_dock_top as string))catch()
						)
						"cui_dock_bottom":
						(
							try(cui.UnRegisterDialogBar rol_miauuSnapsToogle)catch()
							--	rearrange buttons to be horizontal
							for b = 1 to btnsArr.count do
							(
								btnsArr[b].pos = [( b * 26), 0]
							)
							rol_miauuSnapsToogle.height = 25
							rol_miauuSnapsToogle.width = 363
							cui.RegisterDialogBar rol_miauuSnapsToogle minSize:[363,25] maxSize:[363,25] style:#(#cui_dock_horz)
							cui.DockDialogBar rol_miauuSnapsToogle #cui_dock_bottom
							try(setINISetting iniFile "Rollout" "DockPos" (#cui_dock_bottom as string))catch()
						)
						"cui_dock_left":
						(
							try(cui.UnRegisterDialogBar rol_miauuSnapsToogle)catch()
							--	rearrange buttons to be vertical 
							for b = 1 to btnsArr.count do
							(
								btnsArr[b].pos = [0, ( b * 26)]
							)
							rol_miauuSnapsToogle.height = 363
							rol_miauuSnapsToogle.width = 25
							--
							cui.RegisterDialogBar rol_miauuSnapsToogle minSize:[25,363] maxSize:[25,363] style:#(#cui_dock_vert)
							cui.DockDialogBar rol_miauuSnapsToogle #cui_dock_left
							try(setINISetting iniFile "Rollout" "DockPos" (#cui_dock_left as string))catch()
						)
						"cui_dock_right":
						(
							try(cui.UnRegisterDialogBar rol_miauuSnapsToogle)catch()
							--	rearrange buttons to be vertical 
							for b = 1 to btnsArr.count do
							(
								btnsArr[b].pos = [0, ( b * 26)]
							)
							rol_miauuSnapsToogle.height = 363
							rol_miauuSnapsToogle.width = 25
							cui.RegisterDialogBar rol_miauuSnapsToogle minSize:[25,363] maxSize:[25,363] style:#(#cui_dock_vert)
							cui.DockDialogBar rol_miauuSnapsToogle #cui_dock_right
							try(setINISetting iniFile "Rollout" "DockPos" (#cui_dock_right as string))catch()
						)
						"float":
						(
							setDialogPos rol_miauuSnapsToogle (readvalue ((getINISetting iniFile "Rollout" "Position") as stringStream))
						)
					)
				 )
				 catch()
			)
)

On my Max2014 I have custom toolbar right after the Main toolbar. The docked script’s toolbar is the last in the line, but it always loads in the same position.