ofxMSAFluid and ofxSimpleGuiToo examples fixed

@Vinz, yup you’re right. Pre snowleopard that wasn’t an issue, but i’ve fixed it now and committed to svn (Was a copy-paste error)

@stephanschulz, i’m afraid doesn’t work with ofxiphone yet (no poco in ofxiphone). When i get a chance I want to make ofxsimpleguitoo poco independant

hi memo

i like your simpleguitoo very much.
how can i get the values of these gui elements.

i want to move a ofRect according to two 1d sliders.

thanks,\
stephan.

Hi, You pass in variables to the ui, and the sliders modify those variables directly. E.g.

  
float myvar1;  
float myvar2;  
  
ui.addSlider("Variable 1", myvar1, 0, 100);  
ui.addSlider("Variable 2", myvar2, 0, 100);  
  

as soon as you move slider ‘Variable 1’, you myvar1 will automatically update, and Variable 2 to myvar2. hope that helps.

thanks so much. it works !

Hello again.

So it is all working very nicely.

i noticed if i use ofxSimpleGuiSliderInt the value in the slider is still a float with many digits after the comma.

update:
i forgot to declare the array as an int
float fGUI[300];
int iGUI[300];

BUT still the number in the slider looks like this 3.0000 or 4.0000. how do i get rid of all the zeros?

update:
i found inside the ofxSimpleGuiSliderBase.h file the following line:

  
ofDrawBitmapString(name+": "+ofToString((*value), 6), 3, height - 4);  

the 6 determines the amount of digits after the comma.
so i changed 6 to 0.
but now also the float sliders don’t show any digits after the comma.

i also noticed when adding a button gui.addButton(); the label name can’t contain a comma.
gui.addButton(“Hello, Hello”, bGUI[bi++]);
this will result in settings not being loaded.
stephan.

p.s. all these comments are here to eventually improve this already great addon :slight_smile:

Checking out ofxSimpleGuiToo and looks like a very helpful addon. I just downloaded it and when I run the example I get

  
addons\ofxsimpleguitoo\src\ofxsimpleguicontrol.cpp(62) : error C4716: 'ofxSimpleGuiControl::setConfig' : must return a value  

for setConfig, setName, setKey, settextColor, etc. Is this related to the pointer changes above? thanks

running VS2008 on XP

i am running on Windows XP, using visual studio 2008 and i am getting the same error as above whe i compile simpleguitoo addon. Sombody tried to fix it?
thanks in advance,

Luca

Hi everybody!

I have the same issue when compiling under visual c++, any idea to solve this problem??

2 or 3 guys more and we will be enough to get up a petition for that :slight_smile:

Hi mick,
i have patched the code, and now it works perfectly under windows, compiled with Visual studio. But i don’t know how to contribute so it can be public.

regards,
Luca

Hi luca!

I think you can upload a file with your post using “upload attachment” function, in bottom of the page when writing a message.

It would be nice to share this fix with everybody :slight_smile:

Regards

Hi mick,
sorry for the delay in replying. Here it’s my contribute.
I did several fixes for Windows Visual Studio compilation in ofxSimpleGuiToo and in
the MSAFluid example, testApp.cpp.
I will be curious if somebody can check if the sources can stil compile under Mac or Linux,

Best Regards,
Luca

fluids.zip

Thanks! it works fine now :slight_smile:

I wonder if the current version of ofxSimpleGuiToo (_v1.2.zip) works properly under Linux.
I could successfully compile and link the example and the GUI elements are shown,
but the sliders can not be controlled by the mouse. Only some of the elements seem to react to mouse/user input.
I’m new to OF. Do I need to set some #defines or is this a Linux specific bug?
Got anybody the example (properly) working under linux (Ubuntu) ?

Thanks for any advice

OK. Found the problem:

  
  
  
	void update() {  
		if(!enabled) return;  
  
		if(lock) {  
			updateSlider();  
		}  
  
		enabled = false;  
	}  
  
  

the controls are disabled on update. If I outcomment “enabled = false” everything seems to work properly. Strange. What was intended by setting enabled to false?

Cheers
mo

I already signaled the problem to memo a long time ago but it seems the code on his google repository was not corrected. You can find a corrected one on github (github.com/dopuskh3/ofx-projects/addons/)
regards,
F.

thanks :slight_smile:

Hey guys, yea I remember this problem. It is very strange because the code works perfectly on windows and mac, so must be a problem unique to linux for some reason I’m not sure of. I will look into it when I get a chance (though i don’t have access to a linux machine at this point).

Just a guess…but a lot of problems you get in Linux after porting code from win32/osx are often uninitialized variables. Don’t assume that any variables will be initialized to any particular value unless you do so explicitly.

[quote author=“zagorskij”]Hi mick,
sorry for the delay in replying. Here it’s my contribute.
I did several fixes for Windows Visual Studio compilation in ofxSimpleGuiToo and in
the MSAFluid example, testApp.cpp.
I will be curious if somebody can check if the sources can stil compile under Mac or Linux,

Best Regards,
Luca[/quote]

First, thanks for posting this.
Second, v1.2 does not use the boolean “hasTitle” anymore (located in ofxSimpleGuiControl.h) and you will have a compile error.

I just updated the current ofxSimpleGuiControl.cpp by adding

  
return *this;  

that you pointed out to all the functions that caused a compile error.

[attachment=0:1e7fjgs7]ofxSimpleGuiControl.zip[/attachment:1e7fjgs7]

Hope it helps.

ofxSimpleGuiControl.zip

If anyone is interested, I’ve made a working Code::Blocks for Windows project to run the ofxMSAFluid demo. This works with openFrameworks pre release v0.061.

Attached zip contains the workspace/project files. Unzip these into your “[ofx]/addons/ofxMSAFluid/example” folder. Be sure that you have the latest of the following in your “addons” folder:

ofxMSAFluid
ofxMSAInteractiveObject
ofxOsc
ofxSimpleGuiToo
ofxTuio
ofxXmlSettings

ofxMSAFluid_win_cb.zip