We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Pages: 1 ... 13 14 15 16 17 
controlP5 (Read 126733 times)
Re: controlP5
Reply #210 - Apr 3rd, 2010, 10:10am
 
I want to prevent the user from moving controls around using alt+mouseDrag. I call controlP5.lock(), but this doesn't seem to do it. I did a search for the "isLock" variable on Google Code and, while lock() sets it, it doesn't seem to be used...? Am I misunderstanding? And is the right method to call to disable control dragging?

Thanks,
- Mike
Re: controlP5
Reply #211 - Apr 4th, 2010, 9:26pm
 
Hi there,
New to the forums, excuse my silly question Smiley

Is there a way to change the text color of a button?

Ultimately, I'm trying to control the color on mouse over and on click.

Thank you!! Fantastic library!

Rosa
Re: controlP5
Reply #212 - Apr 5th, 2010, 5:43am
 
Yes
Code:

controlP5.Button b;
b = controlP5t.addButton("YES",1,100,20,40,20);
b.setColorActive(color(255,50,0,200));
b.setColorBackground(color(100,100,100,200));

You can also set the forground color using "setColorForground()".

Take a look at the reference doc for additional commands.
http://www.sojamo.de/libraries/controlP5/reference/index.html
Re: controlP5
Reply #213 - Apr 5th, 2010, 10:39am
 
Thank you JeffG for the quick response Smiley

While this changes the color of the actual button, it does not change the actual text color.

The text color remains white

Is there any way to modify the actual text color for roll over and on click?

Thank you!

Rosa
Re: controlP5
Reply #214 - Apr 5th, 2010, 10:44am
 
Oh... sorry.. misread your question.
try
b.setColorLabel();
Re: controlP5
Reply #215 - Apr 5th, 2010, 10:48am
 
Perfect! Thank you so much for the quick reply.
You just made my day.

Rosa
Re: controlP5
Reply #216 - Apr 9th, 2010, 6:46am
 
Hi all,

Thanks Andreas for cP5, it's great.
I have 2 questions, mainly about sliders.

1/ Is there any way to make a slider "read-only" (i.e. the user can not interact with the slider, like if it is locked) ?

2/ When the slider is updated, and the label is redrawn, things get messy if the draw loop doesn't clear the screen (with background()).
Is there any way (besides calling background(), which is not an option in my case) to solve this ?

Thanks for reading.

M
Re: controlP5
Reply #217 - Apr 12th, 2010, 1:39am
 
Hi

Is it possible to change the font of the value in controller objects?
I know how too change the font of ie. the label of a Numberbox, but how do I change the font of the value?

/Preben
Re: controlP5
Reply #218 - Apr 12th, 2010, 3:41am
 
its possible, use Controller.valueLabel().setControlFont()

Code:

 PFont pfont = createFont("Times",20,true);
 // use true/false for smooth/no-smooth
 font = new ControlFont(pfont);
 Slider s = controlP5.addSlider("test",0,100,50,100,40,100,40);
 s.valueLabel().setControlFont(font);
 s.captionLabel().setControlFont(font);
Re: controlP5
Reply #219 - Apr 15th, 2010, 2:22am
 
Hello Andreas and others,

Is it possible to disable keyboard shortcuts?  I am having the issue where I have a field that must accept an email address.  This works fine on a US keyboard layout but when using a German keyboard layout on a Mac, the @ symbol is entered with the AltGr + L combination which then hides all of the controls.

Is there a work around for this?  Disabling all 'alt' shortcuts would be ideal.
Re: controlP5
Reply #220 - Apr 15th, 2010, 3:26am
 
have included that in the next version, will update here when its available.
Re: controlP5
Reply #221 - Apr 17th, 2010, 7:28am
 
sojamo wrote on Mar 18th, 2010, 6:18am:
@bkizzy i adjusted your sketch and made comments inside the code accordingly (indicated with // * ). works for you

Code:

import controlP5.*;

ControlP5 controlP5;
ControlWindow controlWindow;
ControlWindowCanvas cc;

class MyCanvas extends ControlWindowCanvas {
 
 public PImage P;

 // * change void setup(PApplet theApplet) to MyCanvas()
 // * setup does not exist in ControlWindowCanvas and would
 // * there for not be called automatically, the constructor will though,
 // * so the loadImage call is made here (once).
 public MyCanvas() {
   P = loadImage("sonicacts.png");
 }

 public void draw(PApplet theApplet) {
   theApplet.background(255);
   theApplet.image(P,0,0);
 }
}



void setup() {
 size(400,400);
 frameRate(30);
 controlP5 = new ControlP5(this);

 controlWindow = controlP5.addControlWindow("controlP5window",100,100,width,height,30);
 controlWindow.setUpdateMode(ControlWindow.NORMAL);

 cc = new MyCanvas();
 cc.pre();
 controlWindow.addCanvas(cc);
}

void draw() {
}



Tried the above code, but getting error "duplicate method setup"
Please help

Thanks
Re: controlP5
Reply #222 - Apr 18th, 2010, 8:41am
 
Andreas, congrats on ControlP5 its really amazing project.
One doubt: how can I use the equivalent of setValue on a listbox ?

I want to load presets of sliders and lists, and I can do that with sliders and so but doesnt seems to work on listboxes

Thanks
Re: controlP5
Reply #223 - Apr 19th, 2010, 4:32am
 
Hi, does anyone know how to move tabs from (0,0) I'm having the same problem as corban below:

corban wrote on Sep 3rd, 2009, 8:45am:
Im trying to setup some tabs and they are rendered starting at 0,0 and I cant find a way to change the position of them. If i use setPosition, it changes the position of the controls the tab contains.

Any ideas

Re: controlP5
Reply #224 - Apr 20th, 2010, 11:05am
 
Hi again,

I was hoping to change the default color of each radio button so that the foreground color of each radio button is different :

radio1 = red
radio2 = blue
radio3 = green

Is there any way to implement this?



         //The Radio Buttons
         rad = controlP5.addRadioButton("radioButton",150,10);

         //The color of the radio button by default
         rad.setColorForeground(color(255));

         //The color of the radio button on mouseover and click
         rad.setColorActive(color(255,0,0));

         //The color of the radio button text label
         rad.setColorLabel(color(255));

         rad.setItemsPerRow(4);
         rad.setSpacingColumn(40);
       
         addToRadioButton(rad,"2007",1);
         addToRadioButton(rad,"2008",2);
         addToRadioButton(rad,"2009",3);


Thanks as always!

Rosa
Pages: 1 ... 13 14 15 16 17