I think I’ve isolated one error you might have done : If you use “ofxGuiApp” instead of “ofBase” you don’t need to declare or initialize any ofxGui* variable… everything is done in the background… so if you try to redo it in your testapp you might have strange errors… I put that in the example I’ve uploaded…
compiling on osx 10.6.1 I had one compilation error at line 137 of ofxGuiPoints.cpp
expression in new declarator must have integral or enumeration type
GLfloat* verts = new GLfloat[mMaxVal.x*2];
explicitly casting mMaxVal.x*2 to an int solved this, although I haven’t looked into the further implications this might have.
I hope that was the only problem!
Anyway I’ve made a little class that take cares of the “drag” option. You’ll need to add an “ofxGuiMovable” object in the ofxGuiApp (or anywhere if you don’t use ofxGuiApp) and instanciate it (in the ofxGuiApp constructor for example) …
mover = new ofxGuiMovable(gui);
Is there a svn for the addon?
It’s a bit hard for others to keep track on the latest code if there isn’t…
I’ve just repacked the source (including ofxGuiMovable, added in ofxGuiApp too) and example, which are all simongeilfus’s version, into a zip.
I’ve eliminated all the errors I’ve got when compiling with OF0061 in CodeBlocks on Ubuntu9.10.
A install.xml is included too.
So is this the latest version of ofxGui? I have to admit I am a bit confused.
In your download, in ofxGuiTypes.h there’s #define OFXGUI_VERSION “0.06”, which is the same (I think) as stiwi’s upload on alphakanal.de (but there most modfied dates of the src files are older/2008, so i figure that one is the oldest).
But then, on the Nuigroup homepage you can find an ofxGui Version 0.10 (here). One difference, e.g. is the kofxGui_Tags “SWITCH” entry, which is not in andyli’s version. so did they work from another version?
Incidentally, Alexandre’s version in Quasecinema also is 0.10…
Which one should i start from (I guess andyli’s)?
Also, what’s up with ofGuiRadar? Is that a GUI element? Is there a reason why it’s not included in ofxGuiPanel (e.g. no addRadar method)?
what’s the proper policy for versioning? (it can’t be right that many versions have 0.06, no?)
Sorry for the noob questions, but I’m trying to understand what’s necessary to adapt/extend ofxGui (e.g. a vertical slider more in line with hardware controller fader placement, trying to make an interface for my midi controller).
edited to add that I have my eyes on ofxGui because i like the styling and premade elements that are available there (knob&matrix e.g.). i also took a look into ofxSimpleGuiToo (the “pages” feature is really nice!) and ofxEasyGui (example project always segfaults after a couple seconds). Any other options?
edit #2 (don’t know how strict the doublepost policy is on here ;))
So it seems i was wrong, the download from alphakanal/vimeo is also already 0.10. so andyli, is it possible that you used an old version to cobble together the changes? let’s see, maybe i can track down the changes in a meaningful way, maybe there’s a good way to merge everything…
so, I’m currently comparing and trying to merge andyli’s 0.06 and stiwi’s 0.10 version. Meld is a great tool for that.
there’s not that many different changes, I leave those alone where I can’t see what the newer/better version is.
What I found is that the Switch and Radar elements are missing in andyli’s, and I have successfully begun to include the switch (it works in the GUI, I still have to see if changes, events etc. work correctly). The Radar element seems to be a todo of stiwi’s, I still have to dig deeper to find out what is needed to complete it.
okay, it seems properly finalizing the integration of the Switch element is a couple skill levels above mine. GUI integration works, though, so I get a working element I can click correctly.
I decided to concentrate on smaller things first, take a smaller bite:
I successfully fixed chrisoshea’s bug remark #9, hitbox issues in the button matrix.
New file and patch file for ofxGuiMatrix.cpp (from andyli’s version) are attached.
Sorry about the many empty line changes, I don’t know what exactly ate all the tabs in the empty lines; significant changes are around L191 and L292.
It would be nice if someone could check if it works for them, and if my code is alright (it helps to increase the spacing in the example file, otherwise the gaps are soo small).
I also have a combo (dropdown) box and text input box patch for simpleguitoo that I’ll be wanting to share soon. I’m not aware of other patches that have these - please let me know if someone already made them. These are fairly common gui elements so I was hoping someone could review and commit it to svn. Is there a better way to submit a patch than just posting it here? AFAIK there’s no devel mailing lists for the addons svn is there?
hey combo and text input for simpleguitoo would be great! they’ve been on my todo list forever but never got round to it.
it’s on githib, so if you fork and stuff I can pull it back in (or something like that, not fully comfortable with git yet).
cool, I’ll clean things up and it’ll probably be a few days. I’ll let you know on this thread or let me know if there’s a more preferred way.
github sounds like a good idea, i have been thinking about getting an account.
do you know if it would be ok to host ofxGui there? i’m not sure because the source files have “Copyright 2008 alphakanal. All rights reserved” as license information.
If yes, maybe i can put andyli’s version up, and merge in my changes. can’t promise very much maintentance, though.
andyli seems to have a github account, but seems he’s doing Haxe these days…
Okay, I put a combo box in github and sent a pull request. Let me know how it looks and if there’s trouble. Really new to github, and not entirely sure how it works. Let me know if you prefer format-patch based sequential patches (which I already saved before pushing).
I added it to the example as well so you should be able to get a quick idea of how it looks. There’s one peculiar thing I added to ofxSimpleGuiPage, because comboboxes often have the ability to have ‘event-stealing’ focus while they are selected, and they get drawn over other controls while they are selected.
hey, i didn’t receive a pull request, i also don’t see any forking in the network
am i looking at the right place?
oops. There’s another repo that isn’t forked from you.
I’ll fork yours, patch, and do another pull request
Ok, its in. Hopefully the message/pull request gets to you, but if not, here’s the msg:
Here’s a combo box patch. The example should link against the modified ofxMSA and ofxSimpleGuiToo src.
There are some peculiar things I should mention -
in ofxMSAInteractiveObject I made hitTest() virtual so that it could deal with expansion/overlap of the combobox
in ofxSimpleGuiPage I added functions for getting and releasing ‘event-stealing’ focus which combo boxes need to steal the pages events and draw over other controls when they are expanded. So I touched event/drawing functions too.
Let me know how things go or if there’s some changes you don’t like.
i love it! and god bless github.
its merged in now. I made a few minor mods:
height of the combox box is same as all the other controls for aesthetic reasons (you can still change it by overriding config.comboBoxHeight)
changed all char* stuff to string (makes the code much simpler)
added config.comboBoxTextHeight so combo box can be as tall as the other controls, but the dropdown is not as padded
added XML save/load methods
added setValue(int index); and setValue(string s); so you can programatically set the chosen item (needed for xml loading).
added getIndexForTitle(); (needed for a few methods)
renamed getChoice to getValue() to be consistent with rest of API
renamed getChoiceTitle() / setChoiceTitle() to getTitleForIndex() / setTitleForIndex() to be consistent with rest of API
removed a few of the member variables that weren’t being used.
P.S. the event stealing thing is a good idea. I actually want to implement it in a way so that the testApp doesn’t get the event if you click on the gui (e.g. in a paint app). but I haven’t found a way to do it yet entirely from the gui since testApp gets the event before the gui does! Need to hack fake it in a bad way :S
That was a fast integration. Thanks, it looks nice and the changes make sense. I took note of your changes and I’ll try to make the text input less pain for you to merge by being more consistent.
Re:Event stealing, yeah I found it hard to think of what is non-hacky. But in testApp vs ofxSimpleGuiToo event stealing, its one-on-one, so maybe its cleaner. What happens if you deregister the testApp when you feel like it in update() by using ofRemoveListener? I don’t really know how things work with events in of yet though.
I contacted stiwi, and got permission to host ofxGui (under GPL), so it is available here:
I already commited the matrix hitbox bug, and will work in the rest of my changes soon.
I posted a screenshot of the current version of ofxGui (and ofxSimpleGuiToo and the ofxControlPanel GUI in ofxVideoGrabber), at http://forum.openframeworks.cc/t/different-guis-for-openframeworks/4376/0