how to get radio buttons working?

Post Reply
User avatar
seal58
Posts: 377
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

how to get radio buttons working?

Post by seal58 »

Hello,

radio buttons normally are very common to chose one of several states. In VMD I could not find a good solution yet. (f.e. slider)

Basically I use SetValue() to turn active button state on and off. That should switch button "LED" on and off too.
With toggle button it looks good first, but previously active button stays ON until it is push second time. (That's normal for toggle button.)
With simple button switching also works, but on all previously active buttons LED stays ON until mouse hover appears. Might that be a bug?
Benard
Posts: 62
Joined: Mon Oct 01, 2018 11:40 am

Re: how to get radio buttons working?

Post by Benard »

I'm not sure if this is what you mean, but have you tried setting the Group ID for the toggles that are part of a set to a non-zero number? This will turn the other toggles off automatically when a new one is selected.
User avatar
seal58
Posts: 377
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Re: how to get radio buttons working?

Post by seal58 »

Thanks for that hint.
I did not hear of a "group ID" yet. Now I looked for it in GUI properties and in the GUI interface, but I cannot find anything.
Can you please explain it?
Regards
User avatar
seal58
Posts: 377
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Re: how to get radio buttons working?

Post by seal58 »

I must correct myself. Now I found ID entry between ToggleButton properties.

When debug mode in new VMD version gets working again, I will test the use of group ID.
Thank you again.
User avatar
seal58
Posts: 377
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Re: how to get radio buttons working?

Post by seal58 »

Hello again,

the definition of the group ID was the "missing link".

Basically all radio button groups work now (at least on logical level). But there is still a little fault on vizualation.

All radio buttons look inactive after loading the module first time until one button is pushed by clicking with mouse.
When I click on a button, it will change it's look, and this state will be storaged and recovered automatically by VMD.

Even though I defined one button in each radio group as "initially toggled", this seems not to be used by VMD system. After I tested the module in debug mode and changed button state, only new state will be recovered after next compilation, but not
"Initially toggled" state.

When I read out button states with GetValue() methode within Initialise(), I can see initially toggled buttons to be active.
Even though I use SetValue() addtionally, buttons stay looking inactive.

These two scans show the difference. First picture is the look in design mode. Initianlly toggled buttons are on.
The attachment pulser in design mode.jpg is no longer available

This is in debug mode. First three radio button groups have been already changed during test. Their state stays recovered.
The other groups look off, even each first buttons are active.
pulser in design mode.jpg
pulser in design mode.jpg (62.65 KiB) Viewed 5446 times
I'll be happy to get helpful replys.
User avatar
seal58
Posts: 377
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Re: how to get radio buttons working?

Post by seal58 »

Each time, I want to add second image, first one dissappears.
Here is the second image during debug mode:
pulser in debug mode.jpg
pulser in debug mode.jpg (48.42 KiB) Viewed 5445 times
User avatar
seal58
Posts: 377
Joined: Fri Jul 12, 2019 5:28 pm
Location: Rostock, Germany
Contact:

Re: how to get radio buttons working?

Post by seal58 »

Meanwhile I published the module. I'm very happy that it looks as it should in VM.
So the VMD seems to be the reason of visualation problems. :)
Post Reply

Return to “Module Designer”