Multiple Styles for Controls?
-
Is it possible to create multiple styles for the same control? Like, if I wanted to have a couple different looking buttons or knobs for instance.
The only way I currently see is check the id of the control in my Look and Feel and draw based on that. But that's an awful way because it makes my code not reusable between plugins.
-
@bwoogie You could create an array of selected components and just apply its own laf functions to them. You could make how ever many different lafs you want. Make sure you're using LocalLookAndFeel as opposed to GlobalLookAndFeel. Does that answer your question? I think im understanding what you're asking.
-
@Chazrox Yes, that makes sense. That may be the way I'll do it, if a better way doesn't show up. I'd prefer to be able to just change a style setting in the gui editor - like how you'd choose a knob or a slider. But at least I'll have a method.
-
@bwoogie The only way I think you can change the actual style of the knob/button like that (and we're not just talking about colour and dimensions right?), you can use filmstrip images and just load different ones through the property editor. Then you can change the images individually.