We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I'm trying to resize the text in a ListBox. I managed to do it with the big box ("Big Size"). But I've tried several things and I can not change the other box ("small size"). Here's the code:
import controlP5.*;
ControlP5 cp5;
ListBox l;
int cnt = 0;
void setup() {
size(700, 400);
ControlP5.printPublicMethodsFor(ListBox.class);
cp5 = new ControlP5(this);
l = cp5.addListBox("myList")
.setPosition(100, 100)
.setSize(320, 220)
.setItemHeight(35)
.setBarHeight(35)
.setColorBackground(color(255, 128))
.setColorActive(color(0))
.setColorForeground(color(255, 100,0));
int SIZE = 12;
PFont fonst = createFont("Arial",30,true);
ControlFont font = new ControlFont(fonst,SIZE*2);
l.captionLabel().toUpperCase(false).setFont(font);
l.captionLabel().set("Big Size").setFont(font);
l.captionLabel().setColor(0x33330000).setFixedSize(false);
l.captionLabel().style().marginTop = 3;
l.valueLabel().style().marginTop = 3;
String [] A = {"small size"};
ListBox lbi = l.addItems(A);
lbi.setColorBackground(0x99990000);lbi.valueLabel().toUpperCase(false).setFont(font).style().marginTop = 3;//l.captionLabel().se// toUpperCase(false).setFont(font);
}
void draw() {}
greetings and thanks advance
Answers
You'll get a better response if you format your code. Here's how:
http://forum.processing.org/two/discussion/8045/how-to-format-code-and-text
@sojamo please, could you help me?
After much research I think I'm trying to do, is not possible With CP5. https://code.google.com/p/controlp5/source/browse/trunk/src/controlP5/ListBoxItem.java I think it would be good to add in future updates of the bookstore a textfont() to modify the size of the items.
although this is not possible. I take this opportunity to acknowledge the tremendous work done in developing the CP5 library.... @sojamo