DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
- map.push_back( Property::StringValuePair( "type", "ImageActor" ) );
+ map[ "type" ] = "ImageActor";
button.SetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR, map );
DALI_TEST_EQUALS( "ImageActor", button.GetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
- map.push_back( Property::StringValuePair( "type", "Actor" ) );
+ map[ "type" ] = "Actor";
button.SetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR, map );
DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
- map.push_back( Property::StringValuePair( "type", "Actor" ) );
+ map[ "type" ] = "Actor";
button.SetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR, map );
DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
DALI_TEST_EQUALS( "TextView", button.GetProperty( PushButton::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
- map.push_back( Property::StringValuePair( "type", "Actor" ) );
+ map[ "type" ] = "Actor";
button.SetProperty( PushButton::PROPERTY_LABEL_ACTOR, map );
DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
//{ "policy": "fixed", "value": 30.0 },
Property::Map item1;
- item1.push_back( Property::StringValuePair( "policy", "fixed" ) );
- item1.push_back( Property::StringValuePair( "value", 30.f) );
+ item1[ "policy" ] = "fixed";
+ item1[ "value" ] = 30.f;
//{ "policy": "relative", "value": 0.2 },
Property::Map item2;
- item2.push_back( Property::StringValuePair( "policy", "relative" ) );
- item2.push_back( Property::StringValuePair( "value", 0.2f ) );
+ item2[ "policy" ] = "relative";
+ item2[ "value" ] = 0.2f;
// Test "layout-rows" property
DALI_TEST_CHECK( tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::PROPERTY_LAYOUT_ROWS );
* }
*/
Property::Map layoutRows;
- layoutRows.push_back( Property::StringValuePair("1", item1) );
- layoutRows.push_back( Property::StringValuePair("3", item2) );
+ layoutRows[ "1" ] = item1;
+ layoutRows[ "3" ] = item2;
tableView.SetProperty( TableView::PROPERTY_LAYOUT_ROWS, layoutRows );
DALI_TEST_EQUALS( tableView.GetFixedHeight( 1u ), 30.f, TEST_LOCATION );
DALI_TEST_EQUALS( tableView.GetRelativeHeight( 3u ), 0.2f, TEST_LOCATION );
Property::Map layoutRowsGet = tableView.GetProperty(TableView::PROPERTY_LAYOUT_ROWS).Get<Property::Map>();
- DALI_TEST_CHECK( layoutRowsGet[0].first.compare(layoutRows[0].first) == 0 );
- DALI_TEST_CHECK( layoutRowsGet[0].second.GetValue( "policy" ).Get<std::string>().compare(layoutRows[0].second.GetValue( "policy" ).Get<std::string>()) == 0 );
- DALI_TEST_EQUALS( layoutRowsGet[0].second.GetValue( "value" ).Get<float>(),layoutRows[0].second.GetValue( "value" ).Get<float>(), TEST_LOCATION );
- DALI_TEST_CHECK( layoutRowsGet[1].first.compare(layoutRows[1].first) == 0 );
- DALI_TEST_CHECK( layoutRowsGet[1].second.GetValue( "policy" ).Get<std::string>().compare(layoutRows[1].second.GetValue( "policy" ).Get<std::string>()) == 0 );
- DALI_TEST_EQUALS( layoutRowsGet[1].second.GetValue( "value" ).Get<float>(),layoutRows[1].second.GetValue( "value" ).Get<float>(), TEST_LOCATION );
+ DALI_TEST_CHECK( layoutRowsGet.GetKey(0).compare(layoutRows.GetKey(0)) == 0 );
+ DALI_TEST_CHECK( layoutRowsGet.GetValue(0).GetValue( "policy" ).Get<std::string>().compare(layoutRows.GetValue(0).GetValue( "policy" ).Get<std::string>()) == 0 );
+ DALI_TEST_EQUALS( layoutRowsGet.GetValue(0).GetValue( "value" ).Get<float>(),layoutRows.GetValue(0).GetValue( "value" ).Get<float>(), TEST_LOCATION );
+ DALI_TEST_CHECK( layoutRowsGet.GetKey(1).compare(layoutRows.GetKey(1)) == 0 );
+ DALI_TEST_CHECK( layoutRowsGet.GetValue(1).GetValue( "policy" ).Get<std::string>().compare(layoutRows.GetValue(1).GetValue( "policy" ).Get<std::string>()) == 0 );
+ DALI_TEST_EQUALS( layoutRowsGet.GetValue(1).GetValue( "value" ).Get<float>(),layoutRows.GetValue(1).GetValue( "value" ).Get<float>(), TEST_LOCATION );
// Test "layout-columns" property
DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_LAYOUT_COLUMNS ) == TableView::PROPERTY_LAYOUT_COLUMNS );
* }
*/
Property::Map layoutColumns;
- layoutColumns.push_back( Property::StringValuePair("2", item2) );
- layoutColumns.push_back( Property::StringValuePair("3", item1) );
+ layoutColumns[ "2" ] = item2;
+ layoutColumns[ "3" ] = item1;
tableView.SetProperty( TableView::PROPERTY_LAYOUT_COLUMNS, layoutColumns );
DALI_TEST_EQUALS( tableView.GetRelativeWidth( 2u ), 0.2f, TEST_LOCATION );
DALI_TEST_EQUALS( tableView.GetFixedWidth( 3u ), 30.f, TEST_LOCATION );
Property::Map layoutColumnsGet = tableView.GetProperty(TableView::PROPERTY_LAYOUT_COLUMNS).Get<Property::Map>();
- DALI_TEST_CHECK( layoutColumnsGet[0].first.compare(layoutColumns[0].first) == 0 );
- DALI_TEST_CHECK( layoutColumnsGet[0].second.GetValue( "policy" ).Get<std::string>().compare(layoutColumns[0].second.GetValue( "policy" ).Get<std::string>()) == 0 );
- DALI_TEST_EQUALS( layoutColumnsGet[0].second.GetValue( "value" ).Get<float>(),layoutColumns[0].second.GetValue( "value" ).Get<float>(), TEST_LOCATION );
- DALI_TEST_CHECK( layoutColumnsGet[1].first.compare(layoutColumns[1].first) == 0 );
- DALI_TEST_CHECK( layoutColumnsGet[1].second.GetValue( "policy" ).Get<std::string>().compare(layoutColumns[1].second.GetValue( "policy" ).Get<std::string>()) == 0 );
- DALI_TEST_EQUALS( layoutColumnsGet[1].second.GetValue( "value" ).Get<float>(),layoutColumns[1].second.GetValue( "value" ).Get<float>(), TEST_LOCATION );
+ DALI_TEST_CHECK( layoutColumnsGet.GetKey(0).compare(layoutColumns.GetKey(0)) == 0 );
+ DALI_TEST_CHECK( layoutColumnsGet.GetValue(0).GetValue( "policy" ).Get<std::string>().compare(layoutColumns.GetValue(0).GetValue( "policy" ).Get<std::string>()) == 0 );
+ DALI_TEST_EQUALS( layoutColumnsGet.GetValue(0).GetValue( "value" ).Get<float>(),layoutColumns.GetValue(0).GetValue( "value" ).Get<float>(), TEST_LOCATION );
+ DALI_TEST_CHECK( layoutColumnsGet.GetKey(1).compare(layoutColumns.GetKey(1)) == 0 );
+ DALI_TEST_CHECK( layoutColumnsGet.GetValue(1).GetValue( "policy" ).Get<std::string>().compare(layoutColumns.GetValue(1).GetValue( "policy" ).Get<std::string>()) == 0 );
+ DALI_TEST_EQUALS( layoutColumnsGet.GetValue(1).GetValue( "value" ).Get<float>(),layoutColumns.GetValue(1).GetValue( "value" ).Get<float>(), TEST_LOCATION );
END_TEST;
}
DALI_TEST_CHECK( !control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
DALI_TEST_EQUALS( control.GetProperty( Control::PROPERTY_BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
- DALI_TEST_CHECK( control.GetProperty( Control::PROPERTY_BACKGROUND ).Get< Property::Map >().empty() );
+ DALI_TEST_CHECK( !control.GetProperty( Control::PROPERTY_BACKGROUND ).Get< Property::Map >().Count() );
control.SetProperty( Control::PROPERTY_BACKGROUND_COLOR, Color::RED );
DALI_TEST_CHECK( control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetProperty( Control::PROPERTY_BACKGROUND_COLOR ).Get< Vector4 >(), Color::RED, TEST_LOCATION );
Property::Map imageMap;
- imageMap.push_back( Property::StringValuePair( "filename", "TestImage" ) );
+ imageMap[ "filename" ] = "TestImage";
Property::Map map;
- map.push_back( Property::StringValuePair( "image", imageMap ) );
+ map[ "image" ] = imageMap;
control.SetProperty( Control::PROPERTY_BACKGROUND, map );
DALI_TEST_CHECK( control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
DALI_TEST_CHECK( !control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
DALI_TEST_EQUALS( control.GetProperty( Control::PROPERTY_BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
- DALI_TEST_CHECK( control.GetProperty( Control::PROPERTY_BACKGROUND ).Get< Property::Map >().empty() );
+ DALI_TEST_CHECK( !control.GetProperty( Control::PROPERTY_BACKGROUND ).Get< Property::Map >().Count() );
END_TEST;
}
}
case Property::MAP:
{
- ret = std::string("Map Size=") + ToString( value.Get<Property::Map>().size() );
+ ret = std::string("Map Size=") + ToString( value.Get<Property::Map>().Count() );
break;
}
case Property::TYPE_COUNT:
if( Property::MAP == value.GetType() )
{
Property::Map map = value.Get<Property::Map>();
- unsigned int rowIndex;
- for( Property::Map::const_iterator iter = map.begin(); iter != map.end(); iter++)
+ unsigned int rowIndex(0);
+ for ( unsigned int i = 0, count = map.Count(); i < count; ++i )
{
- if( istringstream(iter->first) >> rowIndex // the key is a number
- && Property::MAP == (iter->second).GetType())
+ Property::Value& item = map.GetValue(i);
+
+ if( istringstream(map.GetKey(i)) >> rowIndex // the key is a number
+ && Property::MAP == item.GetType())
{
- Property::Value item = iter->second;
if( item.HasKey( "policy" ) && item.HasKey( "value" ) )
{
Toolkit::TableView::LayoutPolicy policy = Scripting::GetEnumeration< Toolkit::TableView::LayoutPolicy >( item.GetValue("policy").Get<string>(), LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT );
{
Property::StringValuePair valuePair( "value", fixedSize[index] );
Property::Map item;
- item.push_back( fixedPolicyPair );
- item.push_back( valuePair );
+ item[ fixedPolicyPair.first ] = fixedPolicyPair.second;
+ item[ valuePair.first ] = valuePair.second;
- map.push_back( Property::StringValuePair( static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str(), item ) );
+ map[ static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str() ] = item;
}
else if( ! EqualsZero( relativeSize[index] ) )
{
Property::StringValuePair valuePair( "value", relativeSize[index] );
Property::Map item;
- item.push_back( relativePolicyPair );
- item.push_back( valuePair );
+ item[ relativePolicyPair.first ] = relativePolicyPair.second;
+ item[ valuePair.first ] = valuePair.second;
- map.push_back( Property::StringValuePair( static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str(), item ) );
+ map[ static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str() ] = item;
}
}
}
controlImpl.SetBackground( image );
}
}
- else if ( value.Get< Property::Map >().empty() )
+ else if ( ! value.Get< Property::Map >().Count() )
{
// An empty map means the background is no longer required
controlImpl.ClearBackground();
Image image = imageActor.GetImage();
Property::Map imageMap;
Scripting::CreatePropertyMap( image, imageMap );
- map.push_back( Property::StringValuePair( "image", imageMap ) );
+ map[ "image" ] = imageMap;
}
}
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/vector-wrapper.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/scroll-component.h>
namespace Dali DALI_IMPORT_API
// EXTERNAL INCLUDES
#include <boost/function.hpp>
+#include <dali/public-api/common/vector-wrapper.h>
// INTERNAL INCLUDES
-#include <dali/dali.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
namespace Dali DALI_IMPORT_API
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/vector-wrapper.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/enums.h>
#include <dali-toolkit/public-api/controls/control.h>
// EXTERNAL INCLUDES
#include <utility> // std::pair
-#include <dali/dali.h>
+#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/common/vector-wrapper.h>
namespace Dali DALI_IMPORT_API
{
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/vector-wrapper.h>
namespace Dali DALI_IMPORT_API
{
*
*/
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
+
// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
#include <dali-toolkit/public-api/controls/control.h>
namespace Dali DALI_IMPORT_API
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
-
#include <dali/public-api/text/text.h>
#include <dali/public-api/text/text-style.h>
*
*/
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/alignment/alignment.h>