dropdownlist question

Forgive the newbie question but I can find no examples and should be EZ for readers here.

We're writing a script to take perceptual computing input to drive interactive models. UI needs lots of dropdownlist selectors where the actual selected item is simply X, Y, or Z (very short string). We'd like to put both the list label and the drop down selector all on a single line.

Standard dropdownlist setup puts the label above the list. That uses up two lines and you end up with very wide pull down that has very short list members.

Is there any magic syntax for setting up a dropdownlist where the label and the actual pull down list both sit on the same line?

Thanks!

Comments

Comment viewing options

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

...

Use single lable control for that

try(destroyDialog ::bgaRoll)catch()
rollout bgaRoll "• • •"
(
	label itm "xyz:                uvw:                 rgb:" pos:[5,8]
	dropdownlist ddl1 "" pos:[30,5] width:35 items:#("X","Y","Z")
	dropdownlist ddl2 "" pos:[100,5] width:35 items:#("U","V","W")
	dropdownlist ddl3 "" pos:[170,5] width:35 items:#("R","G","B")
 
)
createDialog bgaRoll 210 30 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

bga

coyote808's picture

dropdownlist

Thank you very much for quick response. That's greatly appreciated.

I should have been more specific. These dropdowns need to work inside a group. It appears that the position pos:[30,5] arguments are not compatible with groups? When those are added, the whole group disappears.

Is there a way to use the same technique within MaxScript groups?

coyote808

barigazy's picture

...

GroupBox is the answer

try(destroyDialog ::bgaRoll)catch()
rollout bgaRoll "• • •"
(
	groupBox grp1 "MyGroup :" pos:[5,5] width:250 height:40 
	label itm "xyz:                      uvw:                       rgb:" pos:[grp1.pos.x+5, grp1.pos.y+18]
	dropdownlist ddl1 "" pos:[grp1.pos.x+30,grp1.pos.y+15] width:35 items:#("X","Y","Z")
	dropdownlist ddl2 "" pos:[grp1.pos.x+120,grp1.pos.y+15] width:35 items:#("U","V","W")
	dropdownlist ddl3 "" pos:[grp1.pos.x+210,grp1.pos.y+15] width:35 items:#("R","G","B")
 
)
createDialog bgaRoll 260 50 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

bga

barigazy's picture

...

Also try to use "offset" property of control instead of "pos" property.
It's difficult for me to test any solution because I not see your dialog code.
So try to experiment a bit more. Use MXS help document

bga

coyote808's picture

dropdownlist

On further experimentation - it's not that position arguments are incompatible with groups. I can add a group around your example dropdowns successfully.

The issue appears to be that I'm not using a createDialog command to build my rollouts. Instead i'm using a series of addrollout commands. Those rollouts are built at the top of the script. At the bottom there is this.

UDP = newRolloutFloater "User Defined Properties" 250 715 50 50
addrollout utilities UDP rolledup: false
addrollout actionSet UDP rolledup: true
addrollout pickableObject UDP rolledup: true
addrollout bitmapTextLabel UDP rolledUp: true
addrollout geometricTextLabel UDP rolledUp: true
addrollout cameraActions UDP rolledUp: true
addrollout shaderActions UDP rolledup: true
addrollout zSortActions UDP rolledup: true
addrollout videoInsertActions UDP rolledup: true
addrollout deformationActions UDP rolledup: true

I'm trying to add these formatted dropdownlists to several of the rollouts in the list above.

coyote808

coyote808's picture

dropdownlist

Thank you very much for your assistance.

I think I've found the problem. The position arguments are working, but they are absolute position values within the rollout (vs. relative to the just previous rollout element). These are big rollouts with lots of detail. The new dropdownlists were appearing at the top. I was looking for them at the bottom. By adding 700 to the Y values in the position arguments, they now appear correctly.

Thanks again for your patience and your help. It's really great to have a resource like this.

Best,

Mike

coyote808

barigazy's picture

...

My pleasure man.

bga

Comment viewing options

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