Merge "Replaced Image with Texture in cube transition effect. All references to the...
authorPaul Wisbey <p.wisbey@samsung.com>
Fri, 8 Jul 2016 10:31:11 +0000 (03:31 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Fri, 8 Jul 2016 10:31:11 +0000 (03:31 -0700)
automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp
dali-toolkit/internal/controls/buttons/button-impl.cpp

index a8aca48..07b810f 100644 (file)
@@ -147,3 +147,59 @@ int UtcDaliCheckBoxButtonSetGetSelected(void)
   DALI_TEST_CHECK( gCheckBoxButtonState );
   END_TEST;
 }
+
+int UtcDaliCheckBoxSetLabelP(void)
+{
+  TestApplication application;
+
+  CheckBoxButton checkBox = CheckBoxButton::New();
+
+  Property::Map propertyMap;
+  propertyMap.Insert("text",  "activate");
+  checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
+
+  DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION ); // Change to use GerProperty once that code is implemented
+
+  END_TEST;
+}
+
+int UtcDaliCheckBoxSetLabelDisabledP(void)
+{
+  TestApplication application;
+
+  CheckBoxButton checkBox = CheckBoxButton::New();
+  Stage::GetCurrent().Add( checkBox );
+
+  checkBox.SetSize( Vector2( 20.0f, 20.0f ) );
+  checkBox.SetDisabledBackgroundImage( "Image.jpg" );
+
+  application.SendNotification();
+  application.Render();
+
+  Property::Map propertyMap;
+  propertyMap.Insert("text",  "activate");
+  checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true);
+
+  checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
+
+  DALI_TEST_CHECK(  checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
+  DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION ); // Change to use GerProperty once that code is implemented
+
+  END_TEST;
+}
+
+int UtcDaliCheckBoxSettingDisabled(void)
+{
+  ToolkitTestApplication application;
+
+  CheckBoxButton checkBox = CheckBoxButton::New();
+
+  checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), true);
+  DALI_TEST_CHECK(  checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
+
+  checkBox.SetProperty(checkBox.GetPropertyIndex("disabled"), false);
+
+  DALI_TEST_CHECK(  !checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
+
+  END_TEST;
+}
index 30e84a9..dc00a3c 100644 (file)
@@ -722,32 +722,6 @@ std::string Button::GetSelectedImageFilename() const
   return std::string();
 }
 
-std::string Button::GetBackgroundImageFilename() const
-{
-  if( mBackgroundContent )
-  {
-    ResourceImage image = ResourceImage::DownCast( mBackgroundContent );
-    if( image )
-    {
-      return image.GetUrl();
-    }
-  }
-  return std::string();
-}
-
-std::string Button::GetSelectedBackgroundImageFilename() const
-{
-  if( mSelectedBackgroundContent )
-  {
-    ResourceImage image = ResourceImage::DownCast( mSelectedBackgroundContent );
-    if( image )
-    {
-      return image.GetUrl();
-    }
-  }
-  return std::string();
-}
-
 std::string Button::GetDisabledImageFilename() const
 {
   if( mDisabledContent )
@@ -761,32 +735,6 @@ std::string Button::GetDisabledImageFilename() const
   return std::string();
 }
 
-std::string Button::GetDisabledSelectedImageFilename() const
-{
-  if( mDisabledSelectedContent )
-  {
-    ResourceImage image = ResourceImage::DownCast( mDisabledSelectedContent );
-    if( image )
-    {
-      return image.GetUrl();
-    }
-  }
-  return std::string();
-}
-
-std::string Button::GetDisabledBackgroundImageFilename() const
-{
-  if( mDisabledBackgroundContent )
-  {
-    ResourceImage image = ResourceImage::DownCast( mDisabledBackgroundContent );
-    if( image )
-    {
-      return image.GetUrl();
-    }
-  }
-  return std::string();
-}
-
 bool Button::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
 {
   bool ret = false;