Created
May 21, 2019 15:58
-
-
Save stevechap416/07c335a3c09de421594441bdbc680ead to your computer and use it in GitHub Desktop.
Maxscript: Tabbed Panel UI Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Creates a tabbed panel UI for complex maxscript tools. | |
--The concept for this script came from one of the great minds over at the CGTalk forum | |
--but I cannnot for the life of me find the original post. If you find it let me know. | |
global panelOne | |
global panelTwo | |
global panelThree | |
rollout panelOne "Panel Script Template" width:350 height:230 | |
( | |
checkbutton ckb1 "Panel One" pos:[4,10] width:68 height:20 checked:true | |
checkbutton ckb2 "Panel Two" pos:[77,10] width:68 height:20 check:false | |
checkbutton ckb3 "Panel Three" pos:[150,10] width:68 height:20 check:false | |
GroupBox grp1 "" pos:[4,22] width:340 height:200 | |
button panelOneButton "This is a button on panel 1" pos:[10,38] | |
--Basically telling the script to destory this rollout and open the selected rollout in its place. | |
on ckb1 changed state do | |
( | |
ckb1.state = true | |
) | |
on ckb2 changed state do | |
( | |
local dialogpos = getdialogpos panelOne | |
createdialog panelTwo pos:dialogpos style:#(#style_toolwindow, #style_sysmenu) | |
destroydialog panelone | |
) | |
on ckb3 changed state do | |
( | |
local dialogpos = getdialogpos panelOne | |
createdialog panelThree pos:dialogpos style:#(#style_toolwindow, #style_sysmenu) | |
destroydialog panelOne | |
) | |
) | |
rollout panelTwo "Panel Script Template" width:350 height:230 | |
( | |
checkbutton ckb1 "Panel One" pos:[4,10] width:68 height:20 | |
checkbutton ckb2 "Panel Two" pos:[77,10] width:68 height:20 checked:true | |
checkbutton ckb3 "Panel Three" pos:[150,10] width:68 height:20 check:false | |
GroupBox grp1 "" pos:[4,22] width:340 height:200 | |
button panelOneButton "This is a button on panel 2" pos:[10,38] | |
--Basically telling the script to destory this rollout and open the selected rollout in its place. | |
on ckb1 changed state do | |
( | |
local dialogpos = getdialogpos panelTwo | |
createdialog panelOne pos:dialogpos style:#(#style_toolwindow, #style_sysmenu) | |
destroydialog panelTwo | |
) | |
on ckb2 changed state do | |
( | |
ckb2.state = true | |
) | |
on ckb3 changed state do | |
( | |
local dialogpos = getdialogpos panelTwo | |
createdialog panelThree pos:dialogpos style:#(#style_toolwindow, #style_sysmenu) | |
destroydialog panelTwo | |
) | |
) | |
rollout panelThree "Panel Script Template" width:350 height:230 | |
( | |
checkbutton ckb1 "Panel One" pos:[4,10] width:68 height:20 | |
checkbutton ckb2 "Panel Two" pos:[77,10] width:68 height:20 | |
checkbutton ckb3 "Panel Three" pos:[150,10] width:68 height:20 check:false | |
GroupBox grp1 "" pos:[4,22] width:340 height:200 | |
button panelOneButton "This is a button on panel 3" pos:[10,38] | |
--Basically telling the script to destory this rollout and open the selected rollout in its place. | |
on ckb1 changed state do | |
( | |
local dialogpos = getdialogpos panelThree | |
createdialog panelOne pos:dialogpos style:#(#style_toolwindow, #style_sysmenu) | |
destroydialog panelThree | |
) | |
on ckb2 changed state do | |
( | |
local dialogpos = getdialogpos panelThree | |
createdialog panelTwo pos:dialogpos style:#(#style_toolwindow, #style_sysmenu) | |
destroydialog panelThree | |
) | |
on ckb3 changed state do | |
( | |
ckb3.state = true | |
) | |
) | |
--Creates the window with a particular snazzy look. | |
function createMainWindow = ( | |
createdialog panelOne style:#(#style_toolwindow, #style_sysmenu) | |
) | |
--Now create the window | |
createMainWindow() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment