#include <sstream>
#include <iostream>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
using namespace Dali;
mScrollParent = Actor::New();
mScrollParent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- mScrollParent.SetAnchorPoint( AnchorPoint::CENTER );
- mScrollParent.SetParentOrigin( ParentOrigin::CENTER );
+ mScrollParent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mScrollParent.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
// create background
Toolkit::ImageView background = Toolkit::ImageView::New( BACKGROUND_IMAGE );
Stage::GetCurrent().Add( background );
background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- background.SetAnchorPoint( AnchorPoint::CENTER );
- background.SetParentOrigin( ParentOrigin::CENTER );
+ background.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ background.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
PopulatePages();
}
pageActor.SetBackgroundColor( Vector4( 0.0f, 0.0f, 0.0f, 0.5f ) );
- pageActor.SetParentOrigin( ParentOrigin::CENTER );
- pageActor.SetAnchorPoint( AnchorPoint::CENTER );
+ pageActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ pageActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
pageActor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
- pageActor.SetSizeModeFactor( Vector3( PAGE_SCALE_FACTOR_X, PAGE_SCALE_FACTOR_Y, 1.0f ) );
+ pageActor.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( PAGE_SCALE_FACTOR_X, PAGE_SCALE_FACTOR_Y, 1.0f ) );
return pageActor;
}
imageView.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
imageView.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
- imageView.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
- imageView.SetAnchorPoint( AnchorPoint::CENTER );
- imageView.SetParentOrigin( ParentOrigin::CENTER );
- imageView.SetSizeModeFactor( Vector3( IMAGE_AREA, IMAGE_AREA, 1.0f ) );
+ imageView.SetProperty( Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
+ imageView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ imageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ imageView.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3( IMAGE_AREA, IMAGE_AREA, 1.0f ) );
return imageView;
}
{
Toolkit::CheckBoxButton button = Toolkit::CheckBoxButton::New();
button.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
- button.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
- button.SetAnchorPoint( AnchorPoint::CENTER );
- button.SetParentOrigin( ParentOrigin::CENTER );
+ button.SetProperty( Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
button.SetProperty( Toolkit::Button::Property::SELECTED, ( currentIconIndex % 2 == 0 ) ); // Select half the button
return button;
{
// Create parent icon view
Toolkit::Control iconView = Toolkit::Control::New();
- iconView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- iconView.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ iconView.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ iconView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
if( !mConfig.mTableViewEnabled )
{
float rowX = x * COL_WIDTH + PADDING;
float rowY = y * ROW_HEIGHT + PADDING;
- iconView.SetSize( Vector3( COL_WIDTH, ROW_HEIGHT, 1.0f ) );
- iconView.SetPosition( Vector3( rowX, rowY, 0.0f ) );
+ iconView.SetProperty( Actor::Property::SIZE, Vector3( COL_WIDTH, ROW_HEIGHT, 1.0f ) );
+ iconView.SetProperty( Actor::Property::POSITION, Vector3( rowX, rowY, 0.0f ) );
}
else
{
iconView.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
- iconView.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
+ iconView.SetProperty( Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
}
Actor icon;
if( useTextLabel )
{
Toolkit::TextLabel textLabel = Toolkit::TextLabel::New( DEMO_APPS_NAMES[currentIconIndex] );
- textLabel.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- textLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ textLabel.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ textLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
textLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
textLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) ); // White.
textLabel.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, ( ( static_cast<float>( ROW_HEIGHT * LABEL_AREA ) * 72.0f ) / dpi.y ) * 0.25f );
Toolkit::Control control = Toolkit::Control::New();
control.SetProperty( Toolkit::Control::Property::BACKGROUND, map );
- control.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- control.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+ control.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER );
+ control.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
icon.Add( control );
}
}
AddIconsToPage( page, mConfig.mUseTextLabel );
// Move page 'a little bit up'.
- page.SetParentOrigin( ParentOrigin::CENTER );
- page.SetAnchorPoint( AnchorPoint::CENTER );
- page.SetPosition( Vector3( stageSize.x * i, 0.0f, 0.0f ) );
+ page.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ page.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ page.SetProperty( Actor::Property::POSITION, Vector3( stageSize.x * i, 0.0f, 0.0f ) );
mScrollParent.Add( page );
}
- mScrollParent.SetOpacity( 1.0f );
- mScrollParent.SetScale( Vector3::ONE );
+ mScrollParent.SetProperty( Actor::Property::OPACITY, 1.0f );
+ mScrollParent.SetProperty( Actor::Property::SCALE, Vector3::ONE );
// Fade in.
ShowAnimation();