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 ... 3 4 5 6 7 ... 17
controlP5 (Read 126740 times)
Re: controlP5
Reply #60 - Mar 26th, 2008, 4:25pm
 
sojamo wrote on Jun 15th, 2007, 6:10pm:
hi klaus,
with translate you "displace objects within the display window", which also applies to whatever gets drawn by controlP5, as all controlP5 elements are drawn at the end of the draw method. to get around this you could use pushMatrix() and popMatrix() to encapsulate your translations, e.g.
Code:

void draw() {
pushMatrix();
// all your drawings go here, e.g.
translate(100,100);
fill(255);
rect(0,0,20,20);
popMatrix();
}

hope this helps,
andi


Hello Andreas

Do you know of a way to specify the Push/Popmatrix to a unique tab so it does not appear in all of them?
If it turns out that I'm not doing enough research I do apologise.

A lecturer in my college has recommended ControlP5 to many students, and I agree it was a good idea.

Re: controlP5
Reply #61 - Mar 26th, 2008, 4:33pm
 
Actually, I'll use the ControlEvent handler.
D'oh.
Re: controlP5
Reply #62 - May 8th, 2008, 11:33pm
 
sojamo wrote on Jan 25th, 2008, 4:42am:
regarding the source, all source code is available at sourceforge under sourceforge.net/viewvc/sojamop5/trunk/src/controlP5 if you are interested in getting your hands on the code and you need an ant file to compile controlP5, let me know. currently all the libs i am working on are compiled by one ant file all together.


An ant file for controlP5 alone would be great!

I recently used controlP5 for a project, and I think I will probably use it again in the future. I was thinking about making some additions though, so I checked out the source today. I can navigate the source fine, but I'm still learning how to set up projects in Eclipse.

So if that offer's still on the table, I'm interested.

Thanks!
Re: controlP5
Reply #63 - May 9th, 2008, 3:45am
 
hi,
i updated the svn repository and added a separate build file for controlP5 located in folder buildFiles. please read the comments inside of the buildControlP5.xml ant file. execute the ant file from the command line by using
ant -f buildControlP5.xml
controlP5 will now compile into a folder tmp inside of the trunk folder.
best,
andi
Re: controlP5
Reply #64 - May 15th, 2008, 6:00pm
 
Hello and thanx for the great library. One (simple I guess) question:
I have a textfield, and I want to process the text when the user presses the return key or a button. The button works great with getText(), but what am I supposed to do when the enter key is pressed?
Re: controlP5
Reply #65 - May 16th, 2008, 5:41am
 
hi,
when you hit the enter or return key in a textfield, you can receive the content of the texfield in controlEvent. see the example below and make changes so it  fits your needs. you can also check the example ControlP5textfield that comes with the library.
best,
andi

Code:

import controlP5.*;

ControlP5 controlP5;
Textfield myTextfield;

void setup() {
size(400,400);
frameRate(25);
controlP5 = new ControlP5(this);
myTextfield = controlP5.addTextfield("textfieldController",100,160,200,20);
}

void draw() {
background(0);
}

void controlEvent(ControlEvent theEvent) {
println("got an event from "+theEvent.controller().name());
println(theEvent.controller().stringValue());
}


Re: controlP5
Reply #66 - May 19th, 2008, 4:09am
 
Hey, I'm having trouble with the documentation. None of the constructors are specified! Also, the source code on SourceForge seems to be unavailable. I just want to figure out what variables to pass into the controllers and whatnot. Is this documented anywhere?
Re: controlP5
Reply #67 - May 19th, 2008, 11:28am
 
hi,
i moved the repository to sojamop5/trunk/src/controlP5/. the link in the documentation that comes with the zip was not updated (is now), but the website had the right link.
controllers do not use a constructor when created, but are created by controlP5 using the add-methods. from this link you get a list of methods that are used to add controllers. click on a add-method and you get the information about its parameters (the variables to pass into the controllers).
each controller e.g. a button is extended by controller. what you can do with e.g. a button controller you can read from the shared controller documentation here, or its individual documentation. (this applies to all the other controllers, too).
best,
andi
Re: controlP5
Reply #68 - May 20th, 2008, 2:53am
 
Geez this library is well done. Amazing possibilities with this, thanks for helping!
Re: controlP5
Reply #69 - May 25th, 2008, 5:47pm
 
hi,
i updated controlP5 to version 0.2.8
issues fixed:
* controllers that extend ControllerGroup (e.g. scrollList or textarea) can now be moved to controlWindows. use method moveTo instead of setWindow and setTab.
* added a new class to draw into controlWindows. the class is called ControlWindowCanvas, it is an abstract class and needs to be extended by your own canvas class. see the ControlP5canvas example.
* controlWindows are only updated by default when they are in focus. this can be changed by using controlWindow.setUpdateMode(ControlWindow.NORMAL);
the window is then update continuously. switch back by using
controlWindow.setUpdateMode(ControlWindow.ECONOMIC);
to save cpu.
* different renderers (OPENGL, JAVA2D, etc.) can be used for a controlWindow. howto take a look at the documentation (theRenderer parameter is a String such as "OPENGL", "JAVA2D", etc).
* frameRate can be set for a controlWindow.
* controlP5.register(Controller) is public now. havnt tested it though.

best,
andi
Re: controlP5
Reply #70 - May 25th, 2008, 6:26pm
 
Hi Andi.

I was wondering if you could post an example of how to use sdrop with a control window.

I found http://www.sojamo.de/libraries/drop/documentation/sdrop_method_addcomponent.htm

this command in the documentation but could not really get it to work. Right now I simply use a PFrame window as my control window since this gives me more control I guess.
Re: controlP5
Reply #71 - May 26th, 2008, 4:24am
 
Hi Andi,

I have few questions:

Can tabs be reorganized via something similar to 'alt+drag' or via code ?

I just discovered that it's possible to have two rows of tabs. I'm creating tabs dynamically, is there a way for me to know when I reach the end of the second row ?

Can a ControllerGroup dispatch an event ?

Thanks,

//h
Re: controlP5
Reply #72 - May 26th, 2008, 11:41pm
 
Hi there,

I've been playing around using controlP5 and have a run into a problem with textfields and keyboard control.

I have some basic keyboard commands to control the application - 'c' to clear the screen and 'Space' to save an image. I also have a p5 Textfield used to enter in the desired filename. Of course when the user is typing the filename and hits c both the letter c and the clear screen command are activated.

It seems like the best thing would be to detect if the textfield is active or not, and use that data to disable / enable the keyboard based commands. How would i determine if the textfield is active? There is a setFocus method, but there does not seem to be a getFocus method.
Re: controlP5
Reply #73 - May 29th, 2008, 7:53am
 
at moka.
thanks for pointing this out, i did update sDrop and added an example that shows how to use sDrop with a controlWindow and any other window that is of type Component. hope this helps,
best,
andi
Re: controlP5
Reply #74 - May 29th, 2008, 8:00am
 
at dRosen.
you can check if a textfield is active or not with
yourTextfield.isFocus();
will return true or false. i updated the current version available for download. should do the job now.
best,
andi

Pages: 1 ... 3 4 5 6 7 ... 17