Template for Autoresized Subrollout Dialog

i am extreme beginner with maxscript, i can write UIs based on commands i get from listener, and with showproperties, etc.

i would like to create a dialog that automatically resizes,

i know i need subrollouts for this,
but the problem is that the subrollout height still has to be defined in order for the main dialog to have that height, which kind of defeats the purpose im trying to create, a @small@ dialog, that can expand when the subrollouts are expanded....

my question is, how can i script this autoresize function?

here is some code i have

a functino for autoresize from a quickRender script..

function autoResize = (
	-- resize dialog to fit new rollouts	
		local subRolloutsHeight = 0
		for i = 1 to quickRender2Roll.ui_quickToolsSubRoll.rollouts.count where ( quickRender2Roll.ui_quickToolsSubRoll.rollouts[i] != undefined )do (			
			if QuickRender2Roll.ui_quickToolsSubRoll.rollouts[i].open then ( subRolloutsHeight += ( QuickRender2Roll.ui_quickToolsSubRoll.rollouts[i].height + 26 )	)
			else ( subRolloutsHeight += 24 )			
		totalHeight = ( subRolloutsHeight + 134 )		
		if _blurQuickRender2.dialogMinimized then ( _blurQuickRender2.dialogHeightMax = totalHeight )
		else ( 			
			_blurQuickRender2.dialogHeightMax = totalHeight
			QuickRender2Roll.height = totalHeight 
		setINISetting iniFileString "Defaults" "dialogHeightMax" (_blurQuickRender2.dialogHeightMax as string)

and heres the code i have for a subrollout template

(rollout mainDialog "My Main Dialog" (
subrollout subRoll "the containter" height:200
rollout roll1 "Options" 
	( groupbox grp_vray "" 
	multilistbox lbx_VcamObjects "Cameras:" height:6 width:160 align:#center
    checkbox chk_onTarget "Target"  align:#left across:3
     checkbox chk_onExposure "Expos"  align:#left
	checkbox chk_onClip "Clip"  align:#right
	checkbox chk_onDof "DOF"  align:#left across:3
	checkbox chk_onMblur "MBlur"  align:#left
   checkbox chk_onFocus "Foc"  align:#right
	dropdownlist ddl_type items:#("Still Cam","Movie Cam","Video Cam") width:150 align:#center tooltip:"Mode" selection:3
      --spinner spn_radius "Particle Radius:" range:[0,10000,5.0] fieldwidth:40 type:#worldunits align:#right
      spinner spn_filmgate "Film Gate:" range:[0,1000,35] fieldwidth:40 type:#worldUnits align:#right
      spinner spn_focallength "Focal Length:" range:[0,1000,15] fieldwidth:40 type:#worldUnits align:#right
      spinner spn_fstop "F-Stop:" range:[0,1000,4] fieldwidth:40 type:#float align:#right
      spinner spn_sspeed "Shutter Speed:" range:[0,10000,200] fieldwidth:40 type:#integer align:#right
      spinner spn_iso "ISO:" range:[0,1000,200] fieldwidth:40 type:#float align:#right
	   spinner spn_subdivs "Sub Divisions:" range:[0,100,16] fieldwidth:40 type:#integer align:#right
--rollout roll2 "Another roll" 
createDialog mainDialog lockwidth:true lockheight:false
AddSubRollout mainDialog.subRoll roll1 rolledup:true
--AddSubRollout mainDialog.subRoll roll2 rolledup:False


im trying to create a useful vray script, which im almost done with, its just now id like to have an automatic expanding dialog

thanks for any help!


Comment viewing options

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

ok i figured it out

ok i figured it out

Comment viewing options

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