Radio Buttons - Spacing

I was wondering if you knew a way to control the vertical spacing of radio buttons in a single column?
I've noticed in some of the max UI for instance in the Preferences Rendering tab that in the Field Order the vertical spacing is larger than other parts of the UI using radio buttons.
Help would be great. Thanks
John Martini

Comments

Comment viewing options

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

try this instead

try(destroyDialog ::rlRB)catch()
 
rollout rlRB "Vertical"
(  
 	fn fnOpt idx= (
		range = #(rlRB.rbA, rlRB.rbB, rlRB.rbC)
		for o in range where idx != o do 
		(
			o.state = 0
		)
 	)
 
	label lbTypes "Types:" pos:[10,10]
	radiobuttons rbA "" labels:#("A") pos:[60,10] default:1
	radiobuttons rbB "" labels:#("B") pos:[60,40] default:0
	radiobuttons rbC "" labels:#("C") pos:[60,90] default:0
 
	on rbA changed state do (fnOpt rlRB.rbA)
	on rbB changed state do (fnOpt rlRB.rbB)
	on rbC changed state do (fnOpt rlRB.rbC)
)
createDialog rlRB 150 150

John Martini
Digital Artist
http://www.JokerMartini.com (new site)

barigazy's picture

Very nice, John. Now it's

Very nice, John.
Now it's works.
I avoid to use radiobuttons ctrl, instead,
I use checkboxes that mimic the behavior of radiobuttons.
Anyway, thanks for sharing this interesting solution.

bga

JokerMartini's picture

SOLUTION!

try(destroyDialog ::rlRB)catch()
rollout rlRB "Vertical"
(
	local range = #(rlRB.rbA, rlRB.rbB, rlRB.rbC)
 
	fn fnOpt idx= (
		for o in range where idx != o do 
		(
			o.state = 0
		)
	)
 
	label lbTypes "Types:" pos:[10,10]
	radiobuttons rbA "" labels:#("A") pos:[60,10] default:1
	radiobuttons rbB "" labels:#("B") pos:[60,40] default:0
	radiobuttons rbC "" labels:#("C") pos:[60,90] default:0
 
	on rbA changed state do (fnOpt rlRB.rbA)
	on rbB changed state do (fnOpt rlRB.rbB)
	on rbC changed state do (fnOpt rlRB.rbC)
)
createDialog rlRB 150 150

John Martini
Digital Artist
http://www.JokerMartini.com (new site)

barigazy's picture

I don't know but something is

I don't know but something is wrong.
When i run tour code max throw this error:

-- Error occurred in anonymous codeblock; filename: D:\...; position: 549; line: 22
-- Unknown property: "rbA" in undefined

bga

Anubis's picture

I also wondered can I do

I also wondered can I do this. Definitely no such feature available. I suspect that its possible (because we can set the state of radio buttons to 0 to deselect) to accomplish this with multiple rbuttons using separate rbutton for each label, but so far I have not tested it.

my recent MAXScripts RSS (archive here)

Comment viewing options

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