cinder/Cinder — pull request #419 by richardeakin (2014-04-20 21:56:06+00:00)
Title: InterfaceGl: named params + callbacks

This supersedes #387. @numeric thanks for the initiative continued work on this.

This adds some missing functionality to `params::InterfaceGl`, as well as missing doxygen docs. List of source changes:

Options can now be added using the named parameter idiom:

```cpp
mParams->addParam( "Cube Size", &mObjSize ).min( 0.1f ).max( 20.5f ).keyIncr( "z" ).keyDecr( "Z" ).precision( 2 ).step( 0.02f );
```

You can add an update callback as an option that is fired after a target is updated by ATB:

```cpp
mParams->addParam( "some value", &mSomeValue ).updateFn( [this] { console() << "new value: " << mSomeValue << std::endl; } );
```

You can also add a setter + getter, which does not require a target to bind to:

```cpp
std::function setter	= std::bind( &TweakBarApp::setLightDirection, this, std::placeholders::_1 );
std::function getter	= std::bind( &TweakBarApp::getLightDirection, this );
mParams->addParam( "Light Direction", setter, getter );
```

Andrew, note that this is different from what you reviewed the other day; while you could also manage this with the other addParam function (and passing in null for the target pointer), that way is a bit confusing interface wise. This method is clearer IMO: you don't need a target, you need two std::function's instead.

I've added all possible types that ATB supports, there were a couple left out before like uint8_t, uint16_t, etc.

The old addParam() methods that take an optionsStr are still in there, though marked deprecated.

Sample has been updated, a few more usage examples were added for the callback stuff.