X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-button.cpp;h=69b60b544ff601998ec5386b841869dabf9d9279;hp=cbecb9b635e4edda73cc248dbc4e2167a8a584e6;hb=ca99959003c0445d5afb437e2be26361dff51623;hpb=0695455c9e382f0b19d9e1062a384c32b91f0a38 diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-button.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-button.cpp index cbecb9b..69b60b5 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-button.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-button.cpp @@ -17,7 +17,6 @@ #include #include #include -#include using namespace Dali; using namespace Dali::Toolkit; @@ -58,7 +57,7 @@ Test::TestButton TestButton::New() } TestButton::TestButton() -: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS|REQUIRES_STYLE_CHANGE_SIGNALS ) ) +: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ) { } @@ -72,6 +71,7 @@ void TestButton::SetProperty( BaseObject* object, Property::Index index, const P if ( button ) { + TestButton& buttonImpl = GetImpl(button); switch ( index ) { case Test::TestButton::Property::PRESS_TRANSITION: @@ -79,19 +79,28 @@ void TestButton::SetProperty( BaseObject* object, Property::Index index, const P if( value.GetType() == Property::MAP ) { Property::Map* valueMap = value.GetMap(); - TestButton& buttonImpl = GetImpl(button); buttonImpl.mPressTransitionData.Clear(); NewAnimation( *valueMap, buttonImpl.mPressTransitionData ); } else if( value.GetType() == Property::ARRAY ) { Property::Array* valueArray = value.GetArray(); - TestButton& buttonImpl = GetImpl(button); buttonImpl.mPressTransitionData.Clear(); NewAnimation( *valueArray, buttonImpl.mPressTransitionData ); } break; } + case Test::TestButton::Property::BACKGROUND_COLOR: + { + buttonImpl.mBackgroundColor = value.Get(); + break; + } + + case Test::TestButton::Property::FOREGROUND_COLOR: + { + buttonImpl.mForegroundColor = value.Get(); + break; + } } } } @@ -100,6 +109,8 @@ Property::Value TestButton::GetProperty( BaseObject* object, Property::Index pro { Test::TestButton button = Test::TestButton::DownCast( Dali::BaseHandle( object ) ); + Property::Value value; + if ( button ) { TestButton& buttonImpl = GetImpl(button); @@ -108,22 +119,26 @@ Property::Value TestButton::GetProperty( BaseObject* object, Property::Index pro case Test::TestButton::Property::PRESS_TRANSITION: { return ConvertAnimationMap(buttonImpl.mPressTransitionData); - break; } case Test::TestButton::Property::RELEASE_TRANSITION: { return ConvertAnimationMap(buttonImpl.mReleaseTransitionData); - break; } case Test::TestButton::Property::DISABLED_TRANSITION: { return ConvertAnimationMap(buttonImpl.mDisabledTransitionData); - break; } case Test::TestButton::Property::ENABLED_TRANSITION: { return ConvertAnimationMap(buttonImpl.mEnabledTransitionData); - break; + } + case Test::TestButton::Property::BACKGROUND_COLOR: + { + return Property::Value(buttonImpl.mBackgroundColor); + } + case Test::TestButton::Property::FOREGROUND_COLOR: + { + return Property::Value(buttonImpl.mForegroundColor); } } } @@ -142,6 +157,8 @@ DALI_PROPERTY_REGISTRATION( Test, TestButton, "pressTransition", ARRAY, PRESS_TR DALI_PROPERTY_REGISTRATION( Test, TestButton, "releaseTransition", ARRAY, RELEASE_TRANSITION) DALI_PROPERTY_REGISTRATION( Test, TestButton, "disabledTransition", ARRAY, DISABLED_TRANSITION ) DALI_PROPERTY_REGISTRATION( Test, TestButton, "enabledTransition", ARRAY, ENABLED_TRANSITION ) +DALI_PROPERTY_REGISTRATION( Test, TestButton, "backgroundColor", VECTOR4, BACKGROUND_COLOR ) +DALI_PROPERTY_REGISTRATION( Test, TestButton, "foregroundColor", VECTOR4, FOREGROUND_COLOR ) DALI_TYPE_REGISTRATION_END()