denverpotsmoker Posted September 9, 2015 Share Posted September 9, 2015 I have a question about the multi-radio button UI element. In the example: byte Amount1 = 0; // [1] Delete|Black|White ...what does [1] mean? Thanks! Quote The Rise of the Creative Class by: Richard Florida Link to comment Share on other sites More sharing options...
MJW Posted September 9, 2015 Share Posted September 9, 2015 (edited) 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. Edited September 9, 2015 by MJW Quote Link to comment Share on other sites More sharing options...
BoltBait Posted September 9, 2015 Share Posted September 9, 2015 I suspect it's just a trick to inform the CodeLab code generator that it's a radio button, not a drop-down list. Exactly this. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
MJW Posted September 9, 2015 Share Posted September 9, 2015 (edited) 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. Edited September 10, 2015 by MJW 1 Quote Link to comment Share on other sites More sharing options...
denverpotsmoker Posted September 10, 2015 Author Share Posted September 10, 2015 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. Quote The Rise of the Creative Class by: Richard Florida Link to comment Share on other sites More sharing options...
BoltBait Posted September 12, 2015 Share Posted September 12, 2015 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. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.