Page 1 of 1

how to get radio buttons working?

Posted: Sat Aug 24, 2019 7:35 am
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?

Re: how to get radio buttons working?

Posted: Sat Aug 24, 2019 12:20 pm
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.

Re: how to get radio buttons working?

Posted: Sat Aug 24, 2019 3:45 pm
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

Re: how to get radio buttons working?

Posted: Sat Aug 24, 2019 3:50 pm
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.

Re: how to get radio buttons working?

Posted: Tue Aug 27, 2019 12:45 pm
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 5453 times
I'll be happy to get helpful replys.

Re: how to get radio buttons working?

Posted: Tue Aug 27, 2019 12:48 pm
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 5452 times

Re: how to get radio buttons working?

Posted: Wed Aug 28, 2019 5:27 pm
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. :)