How to add a new button by clicking an existed button

Hello everyone! This is my first thread!

I want to create a button that you can click it and then add a new button just like the Multi/Sub-Object material .
I don’t know how to make it.

Anyone could help me?
Thank you!

Comments

Comment viewing options

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

Looks like a nice tool,...

Looks like a nice tool,... congratulation ausn.

yup, many way to make UI like this chase by using listbox, dropdownlist, activeXControl, RC menu or etc.
I’m still learning about that. :)

Budi G's picture

No problem ausn :) I'm glad

No problem ausn :)

I'm glad that helped.

ausn's picture

Thank you Budy.I'm trying

Thank you Budy.I'm trying your Script!
Now I have another means to achive my goal instead of using button and checkbox.
I find listbox is easier to deal with.Here’s the interface of my Lights Controls using listbox.

AttachmentSize
LightsControls.jpg 13.16 KB
Budi G's picture

well, try this example

well, try this example script about use button with your case:
ex_HIDDEN_obj00.ms

usage :
run .ms
Select any object in max scene, the button will be appears as according to selection count.
This for hide/unhide object toggle.

So you can modify the script as you want to do.

basicly, you can create normal dialog with button first, then everything that code you can convert as string.

-------

Budi G

AttachmentSize
HIDDEN_obj00.ms 1.83 KB
ausn's picture

Thank you very very

Thank you very very much!
You're very kindhearted!

Michele71's picture

You can create a button and

You can create a button and use "visible" form UI

Try:
----------------------------------------------------
rollout test "Create Button"
(

button a "Press Button"
button b "New Button" visible: false

on a pressed do b.visible= true

on b pressed do b.visible = false

) createdialog test
---------------------------------------------------------
Can be of help to you?

Ciao
Michele71

ausn's picture

Thank you. Your method is

Thank you.
Your method is OK.
But if my goal is 10 buttons using your means, I have to create 10 buttons then make one visible and others invisible, which is also inconvenient.

For instance, I’ve got ten Omni lights with AO shader being applied to mr Light Shader and I’m gonna create a control panel to change the state, On or Off, of the mr Light Shader toggle at one location . I want to add ten labels to display the light’s name and ten checkboxes to change the state. I have to set each “on button pressed do” event.

The problem is if I’ve got 11 lights, I have to add a new label and button manually. If I have 12, I have to add another two…

Could I create a function that can automatically set the number of buttons correctly?

Comment viewing options

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