+ Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
+
+ if ( control )
+ {
+ Control& controlImpl( GetImplementation( control ) );
+
+ switch ( index )
+ {
+ case Toolkit::Control::Property::STYLE_NAME:
+ {
+ controlImpl.SetStyleName( value.Get< std::string >() );
+ break;
+ }
+
+ case Toolkit::Control::Property::BACKGROUND_COLOR:
+ {
+ DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
+ controlImpl.SetBackgroundColor( value.Get< Vector4 >() );
+ break;
+ }
+
+ case Toolkit::Control::Property::BACKGROUND_IMAGE:
+ {
+ DALI_LOG_WARNING( "BACKGROUND_IMAGE property is deprecated. Use BACKGROUND property instead\n" );
+ Image image = Scripting::NewImage( value );
+ if ( image )
+ {
+ controlImpl.SetBackgroundImage( image );
+ }
+ else
+ {
+ // An empty map means the background is no longer required
+ controlImpl.ClearBackground();
+ }
+ break;
+ }
+
+ case Toolkit::Control::Property::KEY_INPUT_FOCUS:
+ {
+ if ( value.Get< bool >() )
+ {
+ controlImpl.SetKeyInputFocus();
+ }
+ else
+ {
+ controlImpl.ClearKeyInputFocus();
+ }
+ break;
+ }
+
+ case Toolkit::Control::Property::BACKGROUND:
+ {
+ const Property::Map* map = value.GetMap();
+ if( map )
+ {
+ controlImpl.SetBackground( *map );
+ }
+ else
+ {
+ // The background is not a property map, so we should clear the background
+ controlImpl.ClearBackground();
+ }
+ break;
+ }
+ }
+ }