+ if( button.GetName() == "checkbox1" )
+ {
+ if( button.IsSelected() )
+ {
+ button.SetLabel("CheckBox1 is selected");
+ }
+ else
+ {
+ button.SetLabel("CheckBox1 is unselected");
+ }
+ }
+
+ if( button.GetName() == "checkbox2" )
+ {
+ if( button.IsSelected() )
+ {
+ button.SetLabel("CheckBox2 is selected");
+ }
+ else
+ {
+ button.SetLabel("CheckBox2 is unselected");
+ }
+ }
+
+ if( button.GetName() == "checkbox3" )
+ {
+ if( button.IsSelected() )
+ {
+ button.SetLabel("CheckBox3 is selected");
+ }
+ else
+ {
+ button.SetLabel("CheckBox3 is unselected");
+ }
+ }
+
+ return true;
+ }
+
+ bool OnTouchEvent( Actor actor, const TouchEvent& event )
+ {
+ if( 1u == event.GetPointCount() )
+ {
+ const TouchPoint::State state = event.GetPoint(0u).state;
+
+ // Clamp to integer values; this is to reduce flicking due to pixel misalignment
+ const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
+
+ if( TouchPoint::Down == state )
+ {
+ mLastPoint = localPoint;
+ mAnimation = Animation::New( 0.25f );
+ }
+ else if( TouchPoint::Motion == state )
+ {
+ if( mAnimation )
+ {
+ mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunction::LINEAR );
+ mAnimation.Play();
+ mLastPoint = localPoint;
+ }
+ }
+ }
+