Removed deprecated use of SetImage( ResourceImage) from slider
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / slider / slider-impl.cpp
index 03883d2..213818a 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
 #include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/images/resource-image.h>
+#include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -134,7 +134,7 @@ Dali::Toolkit::Slider Slider::New()
 }
 
 Slider::Slider()
-: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
   mState( NORMAL ),
   mPopupVisual(""),
   mPopupArrowVisual(""),
@@ -205,10 +205,6 @@ void Slider::OnInitialize()
   self.TouchSignal().Connect( this, &Slider::OnTouch );
 }
 
-void Slider::OnSizeSet( const Vector3& size )
-{
-}
-
 void Slider::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   SetHitRegion( Vector2( size.x, GetHitRegion().y ) );
@@ -524,8 +520,9 @@ void Slider::CreatePopupImage( const std::string& filename )
 {
   if( mPopup && ( filename.size() > 0 ) )
   {
-    Image image = ResourceImage::New( filename );
-    mPopup.SetImage( image );
+    Property::Map map;
+    map[Toolkit::ImageVisual::Property::URL] = filename;
+    mPopup.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
   }
 }
 
@@ -561,8 +558,9 @@ void Slider::CreatePopupArrowImage( const std::string& filename )
 {
   if( mPopupArrow && ( filename.size() > 0 ) )
   {
-    Image image = ResourceImage::New( filename );
-    mPopupArrow.SetImage( image );
+    Property::Map map;
+    map[Toolkit::ImageVisual::Property::URL] = filename;
+    mPopupArrow.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
   }
 }