Jump to content

Multi-Radio Button UI Question


Recommended Posts

I suspect it's just a trick to inform the CodeLab code generator that it's a radio button, not a drop-down list. Unfortunately, the default value for radio buttons and list controls seems to always be the first choice, which results in some inelegance when there are two controls with the same choices, but the preferred default is different.

 

EDIT: Actually, the second part of my comment is something of a non sequitur, since the value in braces doesn't determine the default value. I do wish, though, that radio buttons and list controls obeyed the default set by the value the variable is equated to.

Link to post
Share on other sites

I have an idea that would eliminate the need for tricks like that (by replacing it with what I consider to be a better trick), and would allow the the angle control default to be values other than 45. C# has a feature which is similar to C's typedef statements. If at the top of the file you say,

 

using AngleControl = System.Double;

 

AngleControl becomes an alias for double.

 

Then the UI section could have:

 

AngleControl Amount1 = 0; // [0,360] Rotation Angle

 

Unfortunately, for backward compatibility the old methods would still need to work.

 

EDIT: Fixed the command format. I originally forgot the equal sign (too used to typedefs, I suppose),  Changed "double" to "System.Double."  C# doesn't allow "using AngleControl = double;"; "using DoubleVector = PaintDotNet.Pair<double, double>;" works, even though "double" is part of the definition. I'm sure there's a good reason for that.

Link to post
Share on other sites

Thanks for the helpful reply!

 

I wish UI's could be more like real electronics, tho I haven't been too happy with the audio program VST

"realism" look in particular...but it's probably mostly how the controls behave to mouse control. Turning VST knobs

is difficult with a mouse.

 

I was thinking about it today and (I think) a drop-down list is supposed to be like a knob control. You know,

the knob is "inside" the device and each "turn" reveals an option.

 

Judging from the example code, I suppose multi-radio buttons can only have one choice...You know, IF 1 & 2 are selected...

then do something.

 

So I'll probably go with three check boxes (which I think is supposed to be like switches) for my plugin.

 

Thanks again.

The Rise of the Creative Class

by: Richard Florida

Link to post
Share on other sites

I have an idea that would eliminate the need for tricks like that (by replacing it with what I consider to be a better trick), and would allow the the angle control default to be values other than 45. C# has a feature which is similar to C's typedef statements. If at the top of the file you say,

 

using AngleControl = System.Double;

 

AngleControl becomes an alias for double.

 

Then the UI section could have:

 

AngleControl Amount1 = 0; // [0,360] Rotation Angle

 

Unfortunately, for backward compatibility the old methods would still need to work.

 

EDIT: Fixed the command format. I originally forgot the equal sign (too used to typedefs, I suppose),  Changed "double" to "System.Double."  C# doesn't allow "using AngleControl = double;"; "using DoubleVector = PaintDotNet.Pair<double, double>;" works, even though "double" is part of the definition. I'm sure there's a good reason for that.

That's a great idea.

I have implemented this for the 2.7 release of CodeLab.

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...