@Andrew
yep thats a bug. i will take a look.
@Travis_W
controlP5's constructor can only be initiated with a reference to your sketch/PApplet, custom classes are not allowed. instead of using multiple instances of controlP5, why not declaring one global instance of controlP5 and use it within your other classes. controllers can be arranged in groups, so each custom class could have its own group of controllers which are turned on/off whenever you need/dont need them?
@Dimitre
thats right, listboxes can't be saved/loaded yet, sorry.
@rosa
taken from the ControlP5radioButton example with adjustments:
Code:
import controlP5.*;
ControlP5 controlP5;
int myColorBackground = color(0,0,0);
RadioButton r;
void setup() {
size(400,400);
smooth();
controlP5 = new ControlP5(this);
r = controlP5.addRadioButton("radioButton",20,160);
r.setColorForeground(color(120));
r.setColorActive(color(255));
r.setColorLabel(color(255));
r.setItemsPerRow(5);
r.setSpacingColumn(50);
addToRadioButton(r,"red",1, color(255,0,0));
addToRadioButton(r,"green",2, color(0,255,0));
addToRadioButton(r,"blue",3, color(0,0,255));
}
void addToRadioButton(RadioButton theRadioButton, String theName, int theValue, int theColor ) {
Toggle t = theRadioButton.addItem(theName,theValue);
t.setColorBackground(theColor);
t.captionLabel().setColorBackground(color(80));
t.captionLabel().style().movePadding(2,0,-1,2);
t.captionLabel().style().moveMargin(-2,0,0,-3);
t.captionLabel().style().backgroundWidth = 46;
}
void draw() {
background(myColorBackground);
}