Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rollout test "test" height:300
- (
- subrollout test1 "test1" height:151
- subrollout test2 "test2" height:151
- )
- rollout test1a "test1a"
- (
- spinner test1as "test1as"
- )
- rollout test1b "test1b"
- (
- spinner test1bs "test1bs"
- )
- createdialog test
- AddSubRollout test.test1 test1a
- AddSubRollout test.test1 test1b
- titles = #( "test1a", "test1b" )
- indexes = #( 2, 1 )
- g = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
- rollupWindows = for w in windows.getChildrenHWND test.hwnd where w[4] == "RollupWindow" collect w[1]
- format ">> %\n" rollupWindows
- for rollupWindowHWND in rollupWindows do
- (
- local IRollupWindow = g.getIRollup (dotnetobject "system.intptr" rollupWindowHWND)
- format "\nIRollupWindow.numpanels: %\n" IRollupWindow.numpanels
- local reordered = false
- for i=0 to IRollupWindow.numpanels-1 do
- (
- local IRollupPanel = IRollupWindow.GetPanel (IRollupWindow.GetPanelDlg i asdotnetobject:true)
- if IRollupPanel != undefined do
- (
- local rollupName = UIAccessor.GetWindowText IRollupPanel.TitleWnd
- format "%: % cat:%\n" i rollupName IRollupPanel.category
- local index = findItem titles rollupName
- format "index %\n" index
- if index > 0 and IRollupPanel.category != indexes[index] do
- (
- -- show IRollupPanel
- IRollupPanel.category = indexes[index]
- reordered = true
- )
- )
- )
- if reordered do
- (
- format "reordered...\n"
- IRollupWindow.updateLayout()
- -- try to save rollup states
- for i=0 to IRollupWindow.numpanels-1 do
- (
- local IRollupPanel = IRollupWindow.GetPanel (IRollupWindow.GetPanelDlg i asdotnetobject:true)
- if IRollupPanel != undefined do
- (
- try ( IRollupWindow.SaveState (dotNetObject "System.IntPtr" IRollupPanel.HInst) ) catch (format "save failed at %\n" i)
- format "reordering %\n" i
- )
- )
- )
- g.ReleaseIRollup IRollupWindow
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement