[Closed] Tabs and UI components
hi nicolas,
if you are desperate to keep backward compatibility, here’s a hacky way of faking a tabstrip look. If you build a line of checkbuttons so that they resemble a tabstrip, (there was a layout style that allowed it to look like this anyway) on each checkbutton press you could store the last dialog position, destroy the dialog and create the other dialog in the same position. Effectively the checkbutton doesnt change its state, and resets the others, they are on each rollout at the top
-- Fake Tabstrip Test
rollout one "Rollout One" width:162 height:137
(
checkbutton ckb1 "1" pos:[4,3] width:51 height:20 checked:true
checkbutton ckb2 "2" pos:[56,3] width:51 height:20
checkbutton ckb3 "3" pos:[108,3] width:51 height:20
GroupBox grp1 "" pos:[4,16] width:155 height:115
colorPicker cp1 "ColorPicker" pos:[27,47] width:109 height:18
dropdownList ddl1 "DropDownList" pos:[24,74] width:117 height:40
on ckb1 changed state do
(
ckb1.state = true
)
on ckb2 changed state do
(
local dialogpos = getdialogpos one
createdialog two pos:dialogpos style:#(#style_toolwindow, #style_sysmenu)
destroydialog one
)
on ckb3 changed state do
(
local dialogpos = getdialogpos one
createdialog three pos:dialogpos style:#(#style_toolwindow, #style_sysmenu)
destroydialog three
)
)
rollout two "Rollout Two" width:162 height:137
(
checkbutton ckb1 "1" pos:[4,3] width:51 height:20
checkbutton ckb2 "2" pos:[56,3] width:51 height:20 checked:true
checkbutton ckb3 "3" pos:[108,3] width:51 height:20
GroupBox grp1 "" pos:[4,16] width:155 height:115
progressBar pb1 "ProgressBar" pos:[16,47] width:123 height:15
slider sld1 "Slider" pos:[15,76] width:127 height:44
on ckb1 changed state do
(
local dialogpos = getdialogpos two
createdialog one pos:dialogpos style:#(#style_toolwindow, #style_sysmenu)
destroydialog two
)
on ckb2 changed state do
(
ckb2.state = true
)
on ckb3 changed state do
(
local dialogpos = getdialogpos two
createdialog three pos:dialogpos style:#(#style_toolwindow, #style_sysmenu)
destroydialog two
)
)
rollout three "Rollout Three" width:162 height:137
(
checkbutton ckb1 "1" pos:[4,3] width:51 height:20
checkbutton ckb2 "2" pos:[56,3] width:51 height:20
checkbutton ckb3 "3" pos:[108,3] width:51 height:20 checked:true
GroupBox grp1 "" pos:[4,16] width:155 height:115
radioButtons rdo1 "RadioButtons" pos:[14,46] width:29 height:78 labels:#("1", "2", "3", "4","5","6","7","8") default:1 columns:2
on ckb1 changed state do
(
local dialogpos = getdialogpos three
createdialog one pos:dialogpos style:#(#style_toolwindow, #style_sysmenu)
destroydialog three
)
on ckb2 changed state do
(
local dialogpos = getdialogpos three
createdialog two pos:dialogpos style:#(#style_toolwindow, #style_sysmenu)
destroydialog three
)
on ckb3 changed state do
(
ckb3.state = true
)
)
createdialog one style:#(#style_toolwindow, #style_sysmenu)
By using dialogs and not subrollouts you avoid the rollout window bar issue you spoke of. otherwise, you are going to have to go for a dotnet version to keep 32/64 bit compatibility.
Hi Pete,
Thanks a lot for your suggestion, I take this sample ! in fact, I had done a similar thing with the previous version of the script I’m working on again … I wanted to use tabs because I thought it was the “nice & clean” way to do it. But really, I’m still trying to be at ease with maxscript, and I want to avoid as much as possible to use .Net stuff I’ll see what solution become the evidence
Thanks again !
regards.