Property::Map shadowMapSet;
Property::Map shadowMapGet;
- shadowMapSet.Insert( "color", "green" );
- shadowMapSet.Insert( "offset", "2 2" );
+ shadowMapSet.Insert( "color", Color::GREEN );
+ shadowMapSet.Insert( "offset", Vector2(2.0f, 2.0f) );
+ shadowMapSet.Insert( "blurRadius", 5.0f );
label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
shadowMapSet.Clear();
Property::Map shadowDisabledMapGet;
- shadowDisabledMapGet.Insert( "color", "green" );
- shadowDisabledMapGet.Insert( "offset", "0 0" );
+ shadowDisabledMapGet.Insert( "color", Color::GREEN );
+ shadowDisabledMapGet.Insert( "offset", Vector2(0.0f, 0.0f) );
+ shadowDisabledMapGet.Insert( "blurRadius", 5.0f );
label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
label.SetProperty( TextLabel::Property::ELLIPSIS, true );
DALI_TEST_CHECK( label.GetProperty<bool>( TextLabel::Property::ELLIPSIS ) );
+ // Check the layout direction property
+ label.SetProperty( Actor::Property::LAYOUT_DIRECTION, LayoutDirection::RIGHT_TO_LEFT );
+ DALI_TEST_EQUALS( label.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::RIGHT_TO_LEFT ), TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
END_TEST;
}
// Render some text with the shared atlas backend
labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+
+ labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+ labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+
+ labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+ labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
application.SendNotification();
application.Render();
END_TEST;
}
-int UtcDaliToolkitTextlabelTextWarpMode(void)
+int UtcDaliToolkitTextlabelTextWrapMode(void)
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitTextlabelTextWarpMode");
//label.SetProperty( TextLabel::Property::POINT_SIZE, 18 );
Stage::GetCurrent().Add( label );
- label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WRAP_MODE_WORD" );
+ label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WORD" );
+ DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION );
application.SendNotification();
application.Render();
lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
DALI_TEST_EQUALS( lineCount, 4, TEST_LOCATION );
+ label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "CHARACTER" );
+ DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
+ application.SendNotification();
+ application.Render();
- label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "WRAP_MODE_CHARACTER" );
+ label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, Text::LineWrap::WORD );
+ DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::WORD ), TEST_LOCATION );
application.SendNotification();
application.Render();
+ lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
+ DALI_TEST_EQUALS( lineCount, 4, TEST_LOCATION );
+
+ label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, Text::LineWrap::CHARACTER );
+ DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
lineCount = label.GetProperty<int>( TextLabel::Property::LINE_COUNT );
DALI_TEST_EQUALS( lineCount, 3, TEST_LOCATION );
+ tet_infoline( "Ensure invalid string does not change wrapping mode" );
+ label.SetProperty( TextLabel::Property::LINE_WRAP_MODE, "InvalidWrapMode" );
+ DALI_TEST_EQUALS( label.GetProperty< int >( TextLabel::Property::LINE_WRAP_MODE ), static_cast< int >( Text::LineWrap::CHARACTER ), TEST_LOCATION );
+
END_TEST;
}
Property::Map shadowMapSet;
shadowMapSet.Insert( "color", "green" );
shadowMapSet.Insert( "offset", "2 2" );
+ shadowMapSet.Insert( "blurRadius", "3" );
label.SetProperty( TextLabel::Property::SHADOW, shadowMapSet );
outlineMapSet["color"] = Color::RED;