demo.AddExample(Example("animated-shapes.example", DALI_DEMO_STR_TITLE_ANIMATED_SHAPES));
demo.AddExample(Example("path-animation.example", DALI_DEMO_STR_TITLE_PATH_ANIMATION));
demo.AddExample(Example("size-negotiation.example", DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE));
+ demo.AddExample(Example("buttons.example", DALI_DEMO_STR_TITLE_BUTTONS));
+ demo.AddExample(Example("logging.example", DALI_DEMO_STR_TITLE_LOGGING));
demo.SortAlphabetically( true );
background.SetAnchorPoint( AnchorPoint::CENTER );
background.SetParentOrigin( ParentOrigin::CENTER );
background.SetZ( -1.0f );
- background.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
return background;
}
mRootActor = TableView::New( 4, 1 );
mRootActor.SetAnchorPoint( AnchorPoint::CENTER );
mRootActor.SetParentOrigin( ParentOrigin::CENTER );
- mRootActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ mRootActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Stage::GetCurrent().Add( mRootActor );
// Toolbar at top
// Add logo
Dali::ImageActor logo = CreateLogo( LOGO_PATH );
logo.SetName( "LOGO_IMAGE" );
- logo.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+ logo.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
const float paddingHeight = ( ( 1.f-TABLE_RELATIVE_SIZE.y ) * stageSize.y );
const float logoMargin = paddingHeight * LOGO_MARGIN_RATIO;
Alignment alignment = Alignment::New();
alignment.SetName( "LOGO_ALIGNMENT" );
alignment.Add( logo );
- alignment.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- alignment.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+ alignment.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ alignment.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
Actor alignmentActor = alignment;
alignmentActor.SetPadding( Padding( 0.0f, 0.0f, logoMargin, logoMargin ));
mRootActor.AddChild( alignment, TableView::CellPosition( 1, 0 ) );
mScrollView.SetAnchorPoint( AnchorPoint::CENTER );
mScrollView.SetParentOrigin( ParentOrigin::CENTER );
- mScrollView.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ mScrollView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
const float buttonsPageMargin = ( 1.0f - TABLE_RELATIVE_SIZE.x ) * 0.5f * stageSize.width;
mScrollView.SetPadding( Padding( buttonsPageMargin, buttonsPageMargin, 0.0f, 0.0f ) );
mScrollViewLayer.SetAnchorPoint( AnchorPoint::CENTER );
mScrollViewLayer.SetParentOrigin( ParentOrigin::CENTER );
mScrollViewLayer.SetDrawMode( DrawMode::OVERLAY );
- mScrollViewLayer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ mScrollViewLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Create solid background colour.
ImageActor backgroundColourActor = Dali::Toolkit::CreateSolidColorActor( BACKGROUND_COLOR );
backgroundColourActor.SetAnchorPoint( AnchorPoint::CENTER );
backgroundColourActor.SetParentOrigin( ParentOrigin::CENTER );
- backgroundColourActor.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ backgroundColourActor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
backgroundColourActor.SetSizeModeFactor( Vector3( 1.0f, 1.5f, 1.0f ) );
backgroundColourActor.SetZ( BACKGROUND_Z );
mScrollViewLayer.Add( backgroundColourActor );
// Populate background and bubbles - needs to be scrollViewLayer so scroll ends show
Actor bubbleContainer = Actor::New();
bubbleContainer.SetRelayoutEnabled( true );
- bubbleContainer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ bubbleContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
bubbleContainer.SetAnchorPoint( AnchorPoint::CENTER );
bubbleContainer.SetParentOrigin( ParentOrigin::CENTER );
mScrollViewLayer.Add( bubbleContainer );
SetupBackground( bubbleContainer );
Alignment buttonsAlignment = Alignment::New();
- buttonsAlignment.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ buttonsAlignment.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
buttonsAlignment.Add( mScrollViewLayer );
mScrollViewLayer.Add( mScrollView );
TableView page = TableView::New( 3, 3 );
page.SetAnchorPoint( AnchorPoint::CENTER );
page.SetParentOrigin( ParentOrigin::CENTER );
- page.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mScrollView.Add( page );
// Calculate the number of images going across (columns) within a page, according to the screen resolution and dpi.
content.SetAnchorPoint( AnchorPoint::CENTER );
content.SetParentOrigin( ParentOrigin::CENTER );
content.SetRelayoutEnabled( true );
- content.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ content.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
content.SetSizeModeFactor( sizeMultiplier );
// create background image
image.SetAnchorPoint( AnchorPoint::CENTER );
image.SetParentOrigin( ParentOrigin::CENTER );
// make the image 100% of tile
- image.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// move image back to get text appear in front
image.SetZ( -1 );
// Add stencil
ImageActor stencil = NewStencilImage();
- stencil.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ stencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
image.Add( stencil );
}
label.SetProperty( TextLabel::Property::TEXT, title );
label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
label.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
- label.SetResizePolicy( FILL_TO_PARENT, HEIGHT );
+ label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
label.SetColor( TABLE_TEXT_STYLE_COLOR );
content.Add( label );
mVersionPopup = Dali::Toolkit::Popup::New();
mVersionPopup.SetParentOrigin( ParentOrigin::CENTER );
mVersionPopup.SetAnchorPoint( AnchorPoint::CENTER );
- mVersionPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
+ mVersionPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
mVersionPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
- mVersionPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+ mVersionPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
mVersionPopup.SetTitle( stream.str() );
mVersionPopup.HideTail();
mVersionPopup.OutsideTouchedSignal().Connect( this, &DaliTableView::HideVersionPopup );
//Create a view
mView = Dali::Toolkit::View::New();
- mView.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ mView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
stage.Add( mView );
//Set background image for the view
mLevelContainer.SetAnchorPoint( AnchorPoint::CENTER );
mLevelContainer.SetParentOrigin( ParentOrigin::CENTER );
mLevelContainer.SetRelayoutEnabled( true );
- mLevelContainer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ mLevelContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mContentLayer.Add( mLevelContainer );
mBrickCount = 0;
{
TextLabel label = TextLabel::New( ShortName( text ) );
label.SetProperty( Dali::Toolkit::Control::Property::STYLE_NAME, "builderlabel" );
- label.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
// Hook up tap detector
mTapDetector.Attach( label );
using namespace Dali;
-namespace
-{
-// Used to produce visually same dimensions on desktop and device builds
-float ScalePointSize( int pointSize )
-{
- Dali::Vector2 dpi = Dali::Stage::GetCurrent().GetDpi();
- float meanDpi = (dpi.height + dpi.width) * 0.5f;
- return pointSize * meanDpi / 220.0f;
-}
-
-} // namespace
-
// Define this so that it is interchangeable
// "DP" stands for Device independent Pixels
-#define DP(x) ScalePointSize(x)
+#define DP(x) x
namespace
const Vector4 BACKGROUND_COLOUR( 1.0f, 1.0f, 1.0f, 0.15f );
// Layout sizes
-const int RADIO_LABEL_THUMBNAIL_SIZE = 48;
+const int RADIO_LABEL_THUMBNAIL_SIZE = 60;
const int RADIO_IMAGE_SPACING = 8;
const int BUTTON_HEIGHT = 48;
TOOLBAR_IMAGE,
TOOLBAR_TITLE );
- int yPos = TOP_MARGIN + MARGIN_SIZE;
+ Toolkit::TableView contentTable = Toolkit::TableView::New( 4, 1 );
+ contentTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ contentTable.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
+// contentTable.TouchedSignal().Connect( this, &ButtonsController::OnTouchEvent );
+
+ for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
+ {
+ contentTable.SetFitHeight( i );
+ }
+
+ contentTable.SetPosition( 0.0f, TOP_MARGIN );
+
+ mContentLayer.Add( contentTable );
// Image selector radio group
- Actor radioGroup2Background = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR );
- radioGroup2Background.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioGroup2Background.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioGroup2Background.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
- radioGroup2Background.SetRelayoutEnabled( true );
- radioGroup2Background.SetSize( DP(348), DP(GROUP2_HEIGHT) );
- mContentLayer.Add( radioGroup2Background );
-
- Actor radioButtonsGroup2 = Actor::New();
- radioButtonsGroup2.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButtonsGroup2.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioButtonsGroup2.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );
- radioButtonsGroup2.SetRelayoutEnabled( true );
- radioButtonsGroup2.SetSize( DP(100), DP(160) );
-
- radioGroup2Background.Add( radioButtonsGroup2 );
+ Toolkit::TableView radioGroup2Background = Toolkit::TableView::New( 2, 2 );
+ radioGroup2Background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ radioGroup2Background.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ radioGroup2Background.SetBackgroundColor( BACKGROUND_COLOUR );
+ radioGroup2Background.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
+ radioGroup2Background.SetFitHeight( 0 );
+ radioGroup2Background.SetFitHeight( 1 );
+ radioGroup2Background.SetFitWidth( 0 );
+
+ contentTable.Add( radioGroup2Background );
+
+ Toolkit::TableView radioButtonsGroup2 = Toolkit::TableView::New( 3, 1 );
+ radioButtonsGroup2.SetCellPadding( Size( 0.0f, MARGIN_SIZE * 0.5f ) );
+ radioButtonsGroup2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ for( unsigned int i = 0; i < radioButtonsGroup2.GetRows(); ++i )
+ {
+ radioButtonsGroup2.SetFitHeight( i );
+ }
+ radioButtonsGroup2.SetFitWidth( 0 );
+
+ radioGroup2Background.AddChild( radioButtonsGroup2, Toolkit::TableView::CellPosition( 0, 0 ) );
int radioY = 0;
// Create select button
mUpdateButton = Toolkit::PushButton::New();
- mUpdateButton.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
- mUpdateButton.SetAnchorPoint( AnchorPoint::TOP_CENTER );
- mUpdateButton.SetPosition( 0, DP(MARGIN_SIZE) );
mUpdateButton.SetLabel( "Select" );
- mUpdateButton.SetSize( DP(100), DP(BUTTON_HEIGHT) );
+ mUpdateButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mUpdateButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
mUpdateButton.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) );
mUpdateButton.ClickedSignal().Connect( this, &ButtonsController::OnButtonClicked );
- radioButtonsGroup2.Add(mUpdateButton);
+ radioGroup2Background.AddChild( mUpdateButton, Toolkit::TableView::CellPosition( 1, 0 ) );
// ImageActor to display selected image
mBigImage1 = ResourceImage::New( BIG_IMAGE_1 );
mBigImage3 = ResourceImage::New( BIG_IMAGE_3 );
mImage = ImageActor::New( mBigImage1 );
- mImage.SetParentOrigin( ParentOrigin::TOP_RIGHT );
- mImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mImage.SetPosition( DP(MARGIN_SIZE), 0 );
- mImage.SetSize( DP(218), DP(218) );
- radioButtonsGroup2.Add( mImage );
+ mImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
+ mImage.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::WIDTH );
+ radioGroup2Background.AddChild( mImage, Toolkit::TableView::CellPosition( 0, 1, 2, 1 ) );
// The enable/disable radio group
- yPos += GROUP2_HEIGHT + MARGIN_SIZE;
+ Toolkit::TableView radioGroup1Background = Toolkit::TableView::New( 1, 1 );
+ radioGroup1Background.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ radioGroup1Background.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ radioGroup1Background.SetBackgroundColor( BACKGROUND_COLOUR );
+ radioGroup1Background.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
+ radioGroup1Background.SetFitHeight( 0 );
- Actor radioGroup1Background = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR );
- radioGroup1Background.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioGroup1Background.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioGroup1Background.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
- radioGroup1Background.SetRelayoutEnabled( true );
- radioGroup1Background.SetSize( DP(348), DP(GROUP1_HEIGHT) );
- mContentLayer.Add( radioGroup1Background );
+ contentTable.Add( radioGroup1Background );
// Radio group
- Actor radioButtonsGroup1 = Actor::New();
- radioButtonsGroup1.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButtonsGroup1.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioButtonsGroup1.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );
+ Toolkit::TableView radioButtonsGroup1 = Toolkit::TableView::New( 2, 1 );
+ radioButtonsGroup1.SetCellPadding( Size( 0.0f, MARGIN_SIZE * 0.5f ) );
+ radioButtonsGroup1.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ for( unsigned int i = 0; i < radioButtonsGroup1.GetRows(); ++i )
+ {
+ radioButtonsGroup1.SetFitHeight( i );
+ }
+ radioButtonsGroup1.SetFitWidth( 0 );
radioGroup1Background.Add( radioButtonsGroup1 );
// First radio button
{
Toolkit::TableView tableView = Toolkit::TableView::New( 1, 2 );
- tableView.SetSize( DP(260), 0.0f );
- tableView.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ tableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ tableView.SetFitHeight( 0 );
+ tableView.SetFitWidth( 0 );
+ tableView.SetFitWidth( 1 );
Toolkit::TextLabel textLabel = Toolkit::TextLabel::New( "Select enabled" );
+ textLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::WIDTH );
+ textLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
+ textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
tableView.AddChild( textLabel, Toolkit::TableView::CellPosition( 0, 0 ) );
ImageActor imageActor = ImageActor::New( ResourceImage::New( ENABLED_IMAGE ) );
imageActor.SetSize( DP(RADIO_LABEL_THUMBNAIL_SIZE), DP(RADIO_LABEL_THUMBNAIL_SIZE) );
- imageActor.SetResizePolicy( FIXED, ALL_DIMENSIONS );
imageActor.SetPadding( Padding( DP(20.0f), 0.0f, 0.0f, 0.0f ) );
tableView.AddChild( imageActor, Toolkit::TableView::CellPosition( 0, 1 ) );
}
// CheckBoxes
- yPos += GROUP1_HEIGHT + MARGIN_SIZE;
+ Toolkit::TableView checkBoxBackground = Toolkit::TableView::New( 3, 1 );
+ checkBoxBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ checkBoxBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ checkBoxBackground.SetBackgroundColor( BACKGROUND_COLOUR );
+ checkBoxBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
- Actor checkBoxBackground = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR );
- checkBoxBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- checkBoxBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
- checkBoxBackground.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
- checkBoxBackground.SetRelayoutEnabled( true );
- checkBoxBackground.SetSize( DP(430), DP(GROUP3_HEIGHT) );
- mContentLayer.Add( checkBoxBackground );
+ for( unsigned int i = 0; i < checkBoxBackground.GetRows(); ++i )
+ {
+ checkBoxBackground.SetFitHeight( i );
+ }
+
+ contentTable.Add( checkBoxBackground );
Dali::Image unselected = Dali::ResourceImage::New( CHECKBOX_UNSELECTED_IMAGE );
Dali::Image selected = Dali::ResourceImage::New( CHECKBOX_SELECTED_IMAGE );
- int checkYPos = MARGIN_SIZE;
-
{
Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New();
checkBox.SetName( "checkbox1" );
- checkBox.SetPosition( DP(MARGIN_SIZE), DP(checkYPos) );
- checkBox.SetParentOrigin( ParentOrigin::TOP_LEFT );
- checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT );
checkBox.SetBackgroundImage( unselected );
checkBox.SetSelectedImage( selected );
checkBox.SetLabel( "CheckBox1 is unselected" );
checkBoxBackground.Add( checkBox );
}
- checkYPos += 60;
-
{
Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New();
checkBox.SetName( "checkbox2" );
- checkBox.SetPosition( DP(MARGIN_SIZE), DP(checkYPos) );
- checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT );
checkBox.SetBackgroundImage( unselected );
checkBox.SetSelectedImage( selected );
checkBox.SetLabel( "CheckBox2 is selected" );
checkBoxBackground.Add( checkBox );
}
- checkYPos += 60;
-
{
Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New();
checkBox.SetName( "checkbox3" );
- checkBox.SetPosition( DP(MARGIN_SIZE), DP(checkYPos) );
- checkBox.SetAnchorPoint( AnchorPoint::TOP_LEFT );
checkBox.SetBackgroundImage( unselected );
checkBox.SetSelectedImage( selected );
checkBox.SetLabel( "CheckBox3 is unselected" );
}
// Create togglabe button
- yPos += GROUP3_HEIGHT + MARGIN_SIZE;
+ Toolkit::TableView toggleBackground = Toolkit::TableView::New( 3, 1 );
+ toggleBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ toggleBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ toggleBackground.SetBackgroundColor( BACKGROUND_COLOUR );
+ toggleBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
+
+ for( unsigned int i = 0; i < toggleBackground.GetRows(); ++i )
+ {
+ toggleBackground.SetFitHeight( i );
+ }
+
+ contentTable.Add( toggleBackground );
- Actor toggleBackground = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR );
- toggleBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- toggleBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
- toggleBackground.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
- toggleBackground.SetRelayoutEnabled( true );
- toggleBackground.SetSize( DP(150 + MARGIN_SIZE * 2), DP(GROUP4_HEIGHT) );
- mContentLayer.Add( toggleBackground );
Toolkit::PushButton toggleButton = Toolkit::PushButton::New();
toggleButton.SetTogglableButton( true );
- toggleButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- toggleButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- toggleButton.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );
toggleButton.SetLabel( "Unselected" );
- toggleButton.SetSize( DP(150), DP(BUTTON_HEIGHT) );
+ toggleButton.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ toggleButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
toggleButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
toggleButton.SetDisabledImage( Dali::ResourceImage::New( PUSHBUTTON_DISABLED_IMAGE ) );
return true;
}
+ bool OnTouchEvent( Actor actor, const TouchEvent& event )
+ {
+ if( 1u == event.GetPointCount() )
+ {
+ const TouchPoint::State state = event.GetPoint(0u).state;
+
+ // Clamp to integer values; this is to reduce flicking due to pixel misalignment
+ const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
+
+ if( TouchPoint::Down == state )
+ {
+ mLastPoint = localPoint;
+ mAnimation = Animation::New( 0.25f );
+ }
+ else if( TouchPoint::Motion == state )
+ {
+ if( mAnimation )
+ {
+ mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunctions::Linear );
+ mAnimation.Play();
+ mLastPoint = localPoint;
+ }
+ }
+ }
+
+ return true;
+ }
+
private:
Application& mApplication;
Toolkit::PushButton mUpdateButton;
+ Animation mAnimation;
+ float mLastPoint;
+
Image mBigImage1;
Image mBigImage2;
Image mBigImage3;
// Scale ScrollView to fit parent (mContentLayer)
mScrollView.SetRelayoutEnabled( true );
- mScrollView.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ mScrollView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Add the scroll view to the content layer
mContentLayer.Add(mScrollView);
shadowActor.SetPosition(Vector3(0.0f, 0.0f, -1.0f));
// Apply size-relative mode to auto-size the image shadow
- shadowActor.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ shadowActor.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
shadowActor.SetSizeModeFactor( ShadowProperty::SIZE_SCALE );
actor.Add( shadowActor );
ImageActor imageActor = ImageActor::New( image );
imageActor.SetParentOrigin( ParentOrigin::CENTER );
imageActor.SetAnchorPoint( AnchorPoint::CENTER );
- imageActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ imageActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
actor.Add( imageActor );
// Add a border image child actor (with a fixed size offset from parent).
borderActor.SetStyle( ImageActor::STYLE_NINE_PATCH );
borderActor.SetNinePatchBorder( CLUSTER_IMAGE_BORDER_ABSOLUTE );
borderActor.SetPosition( Vector3( 0.0f, 0.0f, 1.0f ) );
- borderActor.SetResizePolicy( SIZE_FIXED_OFFSET_FROM_PARENT, ALL_DIMENSIONS );
+ borderActor.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
borderActor.SetSizeModeFactor( Vector3( CLUSTER_IMAGE_BORDER_INDENT - 1.0f, CLUSTER_IMAGE_BORDER_INDENT - 1.0f, 0.0f ) * 2.0f );
actor.Add( borderActor );
pageView.SetParentOrigin(ParentOrigin::CENTER);
pageView.SetPosition(Vector3(stageSize.width * column, 0.0f, 0.0f));
pageView.SetRelayoutEnabled( true );
- pageView.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ pageView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Create cluster actors, add them to scroll view, and set the shear effect with the given center point.
Cluster cluster = CreateClusterActor(clusterType, style);
// show the first image
mCurrentImage = ImageActor::New( LoadStageFillingImage( IMAGES[mIndex] ) );
mCurrentImage.SetPositionInheritanceMode( USE_PARENT_POSITION );
- mCurrentImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mCurrentImage.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
+ mCurrentImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mCurrentImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mParent.Add( mCurrentImage );
mCurrentEffect = mCubeWaveEffect;
mNextImage = ImageActor::New( image );
mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION);
- mNextImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mNextImage.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
+ mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mNextImage.SetRelayoutEnabled( false );
mCurrentEffect.SetTargetImage(mNextImage);
if( image.GetLoadingState() == ResourceLoadingSucceeded )
mCurrentImage = ImageActor::New( LoadStageFillingImage( IMAGES[mIndex] ) );
mCurrentImage.SetRelayoutEnabled( false );
mCurrentImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
- mCurrentImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mCurrentImage.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
+ mCurrentImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mCurrentImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mParent.Add( mCurrentImage );
mPanGestureDetector.Attach( mCurrentImage );
mNextImage = ImageActor::New( image );
mNextImage.SetRelayoutEnabled( false );
mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
- mNextImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mNextImage.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
+ mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mNextImage.SetZ(INITIAL_DEPTH);
mParent.Add( mNextImage );
Vector2 size = Vector2( mCurrentImage.GetCurrentSize() );
Image image = LoadStageFillingImage( IMAGES[ mIndex ] );
mNextImage = ImageActor::New( image );
mNextImage.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
- mNextImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mNextImage.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
+ mNextImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ mNextImage.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mNextImage.SetZ(INITIAL_DEPTH);
mParent.Add( mNextImage );
switch( mCentralLineIndex%4 )
Actor gridActor = Actor::New();
gridActor.SetRelayoutEnabled( true );
- gridActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ gridActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
gridActor.SetParentOrigin( ParentOrigin::CENTER );
gridActor.SetAnchorPoint( AnchorPoint::CENTER );
borderActor.SetStyle( ImageActor::STYLE_NINE_PATCH );
borderActor.SetNinePatchBorder( Vector4( ITEM_IMAGE_BORDER_LEFT, ITEM_IMAGE_BORDER_TOP, ITEM_IMAGE_BORDER_RIGHT, ITEM_IMAGE_BORDER_BOTTOM ) );
borderActor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); // darken with parent image-actor
- borderActor.SetResizePolicy( SIZE_FIXED_OFFSET_FROM_PARENT, ALL_DIMENSIONS );
+ borderActor.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
borderActor.SetSizeModeFactor( ITEM_BORDER_MARGIN_SIZE );
actor.Add(borderActor);
actor.SetKeyboardFocusable( true );
mMenu.OutsideTouchedSignal().Connect( this, &ItemViewExample::HideMenu );
TableView tableView = TableView::New( 0, 0 );
- tableView.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ tableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mMenu.Add( tableView );
Slider slider = Slider::New();
slider.SetProperty( Slider::Property::VALUE, mDurationSeconds );
slider.SetProperty( Slider::Property::VALUE_PRECISION, 2 );
slider.SetProperty( Slider::Property::SHOW_POPUP, true );
- slider.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ slider.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
slider.ValueChangedSignal().Connect( this, &ItemViewExample::SliderValueChange );
tableView.AddChild( slider, TableView::CellPosition( 0, 0 ) );
TextLabel text = TextLabel::New( "Duration" );
text.SetAnchorPoint( ParentOrigin::TOP_LEFT );
text.SetParentOrigin( ParentOrigin::TOP_LEFT );
- text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- text.SetResizePolicy( FIXED, HEIGHT );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ text.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
text.SetSize( Vector2( 0.0f, LABEL_TEXT_SIZE_Y ) );
slider.Add( text );
Actor textContainer = Actor::New();
textContainer.SetRelayoutEnabled( true );
- textContainer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ textContainer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mAlphaFunctionText = TextLabel::New( ALPHA_FUNCTIONS_TEXT[mAlphaFuncIndex] );
mAlphaFunctionText.SetAnchorPoint( ParentOrigin::CENTER );
mAlphaFunctionText.SetParentOrigin( ParentOrigin::CENTER );
text = TextLabel::New( "Alpha Function" );
text.SetAnchorPoint( ParentOrigin::TOP_LEFT );
text.SetParentOrigin( ParentOrigin::TOP_LEFT );
- text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
text.SetSize( 0.0f, LABEL_TEXT_SIZE_Y );
textContainer.Add( text );
using namespace Dali;
-namespace
-{
-// Used to produce visually same dimensions on desktop and device builds
-float ScalePointSize( int pointSize )
-{
- Dali::Vector2 dpi = Dali::Stage::GetCurrent().GetDpi();
- float meanDpi = (dpi.height + dpi.width) * 0.5f;
- return pointSize * meanDpi / 220.0f;
-}
-
-} // namespace
-
// Define this so that it is interchangeable
// "DP" stands for Device independent Pixels
-#define DP(x) ScalePointSize(x)
+#define DP(x) x
//enum ButtonType
//{
TOOLBAR_IMAGE,
TOOLBAR_TITLE );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Toolkit::TableView contentTable = Toolkit::TableView::New( 6, 1 );
+ contentTable.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ contentTable.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ contentTable.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ contentTable.SetParentOrigin( ParentOrigin::TOP_LEFT );
+ contentTable.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
+// contentTable.TouchedSignal().Connect( this, &LoggingController::OnTouchEvent );
+
+ for( unsigned int i = 0; i < contentTable.GetRows(); ++i )
+ {
+ contentTable.SetFitHeight( i );
+ }
+
+ contentTable.SetPosition( 0.0f, TOP_MARGIN );
+
+ mContentLayer.Add( contentTable );
- int yPos = TOP_MARGIN + MARGIN_SIZE;
// Logger selector radio group
- Actor radioGroupBackground = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR );
- radioGroupBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ Toolkit::TableView radioGroupBackground = Toolkit::TableView::New( 2, 1 );
+ radioGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ radioGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ radioGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
radioGroupBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioGroupBackground.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
- radioGroupBackground.SetSize( stageSize.width - 2 * DP(MARGIN_SIZE), DP(LOGGER_RADIO_GROUP_HEIGHT) );
- mContentLayer.Add( radioGroupBackground );
+ radioGroupBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+ radioGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
+
+ contentTable.Add( radioGroupBackground );
// Label
{
label.SetParentOrigin( ParentOrigin::TOP_LEFT );
label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
label.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );
+ label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
radioGroupBackground.Add( label );
+ radioGroupBackground.SetFitHeight( 0 );
}
// Radio group
- Actor radioButtonsGroup = Actor::New();
- radioButtonsGroup.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButtonsGroup.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioButtonsGroup.SetPosition( DP(MARGIN_SIZE), 0 );
+ Toolkit::TableView radioButtonsGroup = Toolkit::TableView::New( 3, 1 );
+ radioButtonsGroup.SetCellPadding( Size( 0.0f, MARGIN_SIZE * 0.5f ) );
+ radioButtonsGroup.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ for( unsigned int i = 0; i < radioButtonsGroup.GetRows(); ++i )
+ {
+ radioButtonsGroup.SetFitHeight( i );
+ }
+ radioButtonsGroup.SetFitWidth( 0 );
radioGroupBackground.Add( radioButtonsGroup );
+ radioGroupBackground.SetFitHeight( 1 );
int radioX = 0;
- int radioY = MARGIN_SIZE + 28;
+ int radioY = 0;
// Radio 1
{
}
// Create/delete/disable group
- yPos += LOGGER_RADIO_GROUP_HEIGHT + MARGIN_SIZE;
+ Toolkit::TableView createGroupBackground = Toolkit::TableView::New( 1, 2 );
+ createGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ createGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ createGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
+ createGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
+ createGroupBackground.SetFitHeight( 0 );
- Actor createGroupBackground = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR );
- createGroupBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- createGroupBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
- createGroupBackground.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
- createGroupBackground.SetSize( stageSize.width - 2 * DP(MARGIN_SIZE), DP(LOGGER_GROUP_HEIGHT) );
- mContentLayer.Add( createGroupBackground );
-
- int buttonXDP = DP(MARGIN_SIZE);
- int buttonWidthDP = (createGroupBackground.GetTargetSize().width - DP(MARGIN_SIZE) * 3) / 2;
+ contentTable.Add( createGroupBackground );
{
Toolkit::PushButton button = Toolkit::PushButton::New();
button.SetName( CREATE_BUTTON_ID );
button.SetLabel( CREATE_BUTTON_TEXT );
- button.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- button.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
- button.SetPosition( buttonXDP, 0 );
- button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) );
+ button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
}
{
- buttonXDP += DP(MARGIN_SIZE) + buttonWidthDP;
-
Toolkit::PushButton button = Toolkit::PushButton::New();
button.SetName( DELETE_BUTTON_ID );
button.SetLabel( DELETE_BUTTON_TEXT );
- button.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- button.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
- button.SetPosition( buttonXDP, 0 );
- button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) );
+ button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
}
// Start/stop group
- yPos += LOGGER_GROUP_HEIGHT + MARGIN_SIZE;
- Actor timingGroupBackground = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR );
- timingGroupBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- timingGroupBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
- timingGroupBackground.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
- timingGroupBackground.SetSize( stageSize.width - 2 * DP(MARGIN_SIZE), DP(LOGGER_GROUP_HEIGHT) );
- mContentLayer.Add( timingGroupBackground );
+ Toolkit::TableView timingGroupBackground = Toolkit::TableView::New( 1, 2 );
+ timingGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ timingGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ timingGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
+ timingGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
+ timingGroupBackground.SetFitHeight( 0 );
- buttonXDP = DP(MARGIN_SIZE);
- buttonWidthDP = (timingGroupBackground.GetTargetSize().width - DP(MARGIN_SIZE) * 3) / 2;
+ contentTable.Add( timingGroupBackground );
{
Toolkit::PushButton button = Toolkit::PushButton::New();
button.SetName( START_BUTTON_ID );
button.SetLabel( START_BUTTON_TEXT );
- button.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- button.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
- button.SetPosition( buttonXDP, 0 );
- button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) );
+ button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
}
{
- buttonXDP += DP(MARGIN_SIZE) + buttonWidthDP;
-
Toolkit::PushButton button = Toolkit::PushButton::New();
button.SetName( STOP_BUTTON_ID );
button.SetLabel( STOP_BUTTON_TEXT );
- button.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- button.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
- button.SetPosition( buttonXDP, 0 );
- button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) );
+ button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
}
// Enable/disable group
- yPos += LOGGER_GROUP_HEIGHT + MARGIN_SIZE;
-
- Actor enableGroupBackground = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR );
- enableGroupBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- enableGroupBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
- enableGroupBackground.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
- enableGroupBackground.SetSize( stageSize.width - 2 * DP(MARGIN_SIZE), DP(LOGGER_GROUP_HEIGHT) );
- mContentLayer.Add( enableGroupBackground );
+ Toolkit::TableView enableGroupBackground = Toolkit::TableView::New( 1, 2 );
+ enableGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ enableGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ enableGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
+ enableGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
+ enableGroupBackground.SetFitHeight( 0 );
- buttonXDP = DP(MARGIN_SIZE);
- buttonWidthDP = (enableGroupBackground.GetTargetSize().width - DP(MARGIN_SIZE) * 3) / 2;
+ contentTable.Add( enableGroupBackground );
{
Toolkit::PushButton button = Toolkit::PushButton::New();
button.SetName( ENABLE_BUTTON_ID );
button.SetLabel( ENABLE_BUTTON_TEXT );
- button.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- button.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
- button.SetPosition( buttonXDP, 0 );
- button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) );
+ button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
}
{
- buttonXDP += DP(MARGIN_SIZE) + buttonWidthDP;
-
Toolkit::PushButton button = Toolkit::PushButton::New();
button.SetName( DISABLE_BUTTON_ID );
button.SetLabel( DISABLE_BUTTON_TEXT );
- button.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- button.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
- button.SetPosition( buttonXDP, 0 );
- button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) );
+ button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
enableGroupBackground.Add( button );
}
- yPos += LOGGER_GROUP_HEIGHT + MARGIN_SIZE;
-
// Logger selector radio group
- unsigned int groupHeight = LOGGER_GROUP_HEIGHT + 30;
+ Toolkit::TableView frequencyRadioGroupBackground = Toolkit::TableView::New( 2, 1 );
+ frequencyRadioGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ frequencyRadioGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ frequencyRadioGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
+ frequencyRadioGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE * 0.5f ) );
+ frequencyRadioGroupBackground.SetFitHeight( 0 );
+ frequencyRadioGroupBackground.SetFitHeight( 1 );
- Actor frequencyRadioGroupBackground = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR );
- frequencyRadioGroupBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- frequencyRadioGroupBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
- frequencyRadioGroupBackground.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
- frequencyRadioGroupBackground.SetSize( stageSize.width - 2 * DP(MARGIN_SIZE), DP(groupHeight) );
- mContentLayer.Add( frequencyRadioGroupBackground );
+ contentTable.Add( frequencyRadioGroupBackground );
// Label
{
Toolkit::TextLabel label = Toolkit::TextLabel::New( FREQUENCY_TEXT );
- label.SetParentOrigin( ParentOrigin::TOP_LEFT );
- label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- label.SetPosition( DP(MARGIN_SIZE), DP(MARGIN_SIZE) );
frequencyRadioGroupBackground.Add( label );
}
// Radio group
- Actor frequencyRadioButtonsGroup = Actor::New();
- frequencyRadioButtonsGroup.SetParentOrigin( ParentOrigin::TOP_LEFT );
- frequencyRadioButtonsGroup.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- frequencyRadioButtonsGroup.SetPosition( DP(MARGIN_SIZE), DP(40) );
+ Toolkit::TableView frequencyRadioButtonsGroup = Toolkit::TableView::New( 1, 3 );
+ frequencyRadioButtonsGroup.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ frequencyRadioButtonsGroup.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ frequencyRadioButtonsGroup.SetFitHeight( 0 );
+ frequencyRadioButtonsGroup.SetPadding( Padding( 0.0f, 0.0f, MARGIN_SIZE, 0.0f ) );
frequencyRadioGroupBackground.Add( frequencyRadioButtonsGroup );
- radioX = 0;
- radioY = 0;
- const int frequencyRadioWidth = 100;
-
// Radio 1
{
Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_1_RADIO_TEXT );
radioButton.SetName( FREQUENCY_1_RADIO_ID );
- radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioButton.SetPosition( DP(radioX), DP(radioY) );
radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );
// Radio 2
{
- radioX += frequencyRadioWidth;
-
Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_2_RADIO_TEXT );
radioButton.SetName( FREQUENCY_2_RADIO_ID );
- radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioButton.SetPosition( DP(radioX), DP(radioY) );
+
radioButton.SetSelected( true );
radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );
// Radio 3
{
- radioX += frequencyRadioWidth;
-
Toolkit::RadioButton radioButton = Toolkit::RadioButton::New( FREQUENCY_3_RADIO_TEXT );
radioButton.SetName( FREQUENCY_3_RADIO_ID );
- radioButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- radioButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- radioButton.SetPosition( DP(radioX), DP(radioY) );
radioButton.StateChangedSignal().Connect( this, &LoggingController::FrequencyRadioSelect );
}
// Vsync group
- yPos += groupHeight + MARGIN_SIZE;
-
- Actor vsyncGroupBackground = Toolkit::CreateSolidColorActor( BACKGROUND_COLOUR );
- vsyncGroupBackground.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- vsyncGroupBackground.SetParentOrigin( ParentOrigin::TOP_LEFT );
- vsyncGroupBackground.SetPosition( DP(MARGIN_SIZE), DP(yPos) );
- vsyncGroupBackground.SetSize( stageSize.width - 2 * DP(MARGIN_SIZE), DP(LOGGER_GROUP_HEIGHT) );
- mContentLayer.Add( vsyncGroupBackground );
+ Toolkit::TableView vsyncGroupBackground = Toolkit::TableView::New( 1, 1 );
+ vsyncGroupBackground.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ vsyncGroupBackground.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+ vsyncGroupBackground.SetBackgroundColor( BACKGROUND_COLOUR );
+ vsyncGroupBackground.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) );
+ vsyncGroupBackground.SetFitHeight( 0 );
- buttonXDP = DP(MARGIN_SIZE);
- buttonWidthDP = vsyncGroupBackground.GetTargetSize().width - DP(MARGIN_SIZE) * 2;
+ contentTable.Add( vsyncGroupBackground );
{
Toolkit::PushButton button = Toolkit::PushButton::New();
button.SetName( VSYNC_BUTTON_ID );
button.SetLabel( VSYNC_BUTTON_TEXT );
- button.SetParentOrigin( ParentOrigin::CENTER_LEFT );
- button.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
- button.SetPosition( buttonXDP, 0 );
- button.SetSize( buttonWidthDP, DP(BUTTON_HEIGHT) );
+ button.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ button.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
return true;
}
+ bool OnTouchEvent( Actor actor, const TouchEvent& event )
+ {
+ if( 1u == event.GetPointCount() )
+ {
+ const TouchPoint::State state = event.GetPoint(0u).state;
+
+ // Clamp to integer values; this is to reduce flicking due to pixel misalignment
+ const float localPoint = static_cast<float>( static_cast<int>( event.GetPoint( 0 ).local.y ) );
+
+ if( TouchPoint::Down == state )
+ {
+ mLastPoint = localPoint;
+ mAnimation = Animation::New( 0.25f );
+ }
+ else if( TouchPoint::Motion == state )
+ {
+ if( mAnimation )
+ {
+ mAnimation.AnimateBy( Property(actor, Actor::Property::POSITION), Vector3( 0.f, localPoint - mLastPoint, 0.f ), AlphaFunctions::Linear );
+ mAnimation.Play();
+ mLastPoint = localPoint;
+ }
+ }
+ }
+
+ return true;
+ }
+
private:
struct LoggerState
Toolkit::ToolBar mToolBar; ///< The View's Toolbar.
Layer mContentLayer; ///< Content layer
+ Animation mAnimation;
+ float mLastPoint;
+
typedef std::vector< std::string > Strings;
Strings mPerformanceLoggerNames;
Actor CreateVectorComponentControl( const std::string& label, const Vector3& size, bool(PathController::*callback)(Slider,float) )
{
TextLabel text = TextLabel::New(label);
- text.SetResizePolicy( USE_NATURAL_SIZE, WIDTH );
- text.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ text.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::WIDTH );
+ text.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
text.SetColor( Vector4(0.0f,0.0f,0.0f,1.0f));
Slider slider = Slider::New();
Image dial = ResourceImage::New( TEST_DIAL_FILENAME );
mDialActor = ImageActor::New( dial );
- mDialActor.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+ mDialActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mDialActor.SetPositionInheritanceMode(USE_PARENT_POSITION);
mDialActor.SetScale(scale);
Layer dialLayer = Layer::New();
mImageActor = ImageActor::New(image);
mImageActor.SetParentOrigin(ParentOrigin::CENTER);
mImageActor.SetAnchorPoint(AnchorPoint::CENTER);
- mImageActor.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+ mImageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
// Create the stencil
Vector2 imageSize = ResourceImage::GetImageSize(imageName);
{
Actor page = Actor::New();
page.SetRelayoutEnabled( true );
- page.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
page.SetParentOrigin( ParentOrigin::CENTER );
page.SetAnchorPoint( AnchorPoint::CENTER );
{
page.RemoveConstraints();
page.SetRelayoutEnabled( true );
- page.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ page.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
switch( mEffectMode )
{
mShadowView.SetParentOrigin(ParentOrigin::CENTER);
mShadowView.SetAnchorPoint(AnchorPoint::CENTER);
mShadowView.SetRelayoutEnabled( true );
- mShadowView.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ mShadowView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mShadowView.SetPointLightFieldOfView( Math::PI / 2.0f);
mContents.Add(mShadowView);
TextLabel text = TextLabel::New( "Light" );
text.SetProperty( TextLabel::Property::POINT_SIZE, 20.0f );
- text.SetResizePolicy( USE_NATURAL_SIZE, WIDTH );
- text.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ text.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
text.SetColor( Color::BLUE );
mCastingLight.Add(text);
mImageActor2 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_2) );
mImageActor3 = ImageActor::New( ResourceImage::New(SCENE_IMAGE_3) );
- mImageActor1.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
- mImageActor2.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
- mImageActor3.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+ mImageActor1.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ mImageActor2.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+ mImageActor3.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
mImageActor2.SetParentOrigin(ParentOrigin::CENTER);
mItemView = Toolkit::ItemView::New( *this );
mItemView.SetParentOrigin( ParentOrigin::CENTER );
mItemView.SetAnchorPoint( AnchorPoint::CENTER );
- mItemView.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ mItemView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Use a grid layout for tests
Toolkit::GridLayoutPtr gridLayout = Toolkit::GridLayout::New();
mMenu.HideTail();
mMenu.OutsideTouchedSignal().Connect( this, &SizeNegotiationController::HideMenu );
mMenu.SetSize( popupWidth, 0.0f );
- mMenu.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+ mMenu.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
Toolkit::TableView tableView = Toolkit::TableView::New( 0, 0 );
- tableView.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- tableView.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ tableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ tableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mMenu.Add( tableView );
for( unsigned int i = 0; i < MENU_ITEMS_COUNT; ++i )
text.SetProperty( TextLabel::Property::MULTI_LINE, true );
text.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
mPopup.Add( text );
mPopup = CreatePopup();
ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
- image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- image.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
+ image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
image.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
mPopup.Add( image );
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
- image.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.Add( image );
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
- image.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- image.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
+ image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ image.SetSizeScalePolicy( SizeScalePolicy::FIT_WITH_ASPECT_RATIO );
mPopup.Add( image );
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
- image.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- image.SetSizeScalePolicy( FILL_WITH_ASPECT_RATIO );
+ image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+ image.SetSizeScalePolicy( SizeScalePolicy::FILL_WITH_ASPECT_RATIO );
mPopup.Add( image );
Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT );
text.SetName( "POPUP_CONTENT_TEXT" );
- text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
text.SetProperty( TextLabel::Property::MULTI_LINE, true );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
mPopup.Add( text );
Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT );
text.SetName( "POPUP_CONTENT_TEXT" );
- text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
text.SetProperty( TextLabel::Property::MULTI_LINE, true );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
text.SetPadding( Padding( 10.0f, 10.0f, 20.0f, 0.0f ) );
mPopup.Add( text );
// Content
Toolkit::TableView content = Toolkit::TableView::New( 2, 2 );
content.SetName( "COMPLEX_TABLEVIEW" );
- content.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- content.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ content.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ content.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
content.SetFitHeight( 0 );
content.SetFitHeight( 1 );
content.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
// Text
{
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Do you really want to quit?" );
- text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
text.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
content.AddChild( text, Toolkit::TableView::CellPosition( 0, 0 ) );
}
{
ImageActor image = ImageActor::New( ResourceImage::New( IMAGE1 ) );
image.SetName( "COMPLEX_IMAGE" );
- image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- image.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
+ image.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ image.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
content.AddChild( image, Toolkit::TableView::CellPosition( 0, 1 ) );
}
// Text 2
{
Toolkit::TableView root = Toolkit::TableView::New( 1, 2 );
- root.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- root.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ root.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ root.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
root.SetFitHeight( 0 );
root.SetFitWidth( 0 );
root.SetPadding( Padding( 0.0f, 0.0f, 0.0f, 20.0f ) );
else if( button.GetName() == TABLEVIEW_BUTTON_EMPTY_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
Toolkit::TableView table = Toolkit::TableView::New( 0, 0 );
- table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.Add( table );
else if( button.GetName() == TABLEVIEW_BUTTON_1CELL_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
Toolkit::TableView table = Toolkit::TableView::New( 0, 0 );
table.SetName( "TABLEVIEW_BUTTON_1CELL_ID" );
- table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.Add( backing );
mPopup.Add( table );
else if( button.GetName() == TABLEVIEW_BUTTON_3CELL_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
Toolkit::TableView table = Toolkit::TableView::New( 0, 0 );
- table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.Add( backing );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.Add( backing );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.Add( backing );
}
else if( button.GetName() == TABLEVIEW_BUTTON_3X3CELL_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
Toolkit::TableView table = Toolkit::TableView::New( 3, 3 );
- table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
// Column 0
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 0 ) );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 0 ) );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 0 ) );
}
// Column 1
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 1 ) );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 1 ) );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 0.0f, 1.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 1 ) );
}
// Column 2
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 2 ) );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.5f, 0.5f, 0.5f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 2 ) );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.5f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 2 ) );
}
else if( button.GetName() == TABLEVIEW_BUTTON_FIXED1_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
- table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.SetFixedHeight( 0, 50.0f );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
backing.Add( text );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetParentOrigin( ParentOrigin::CENTER );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetParentOrigin( ParentOrigin::CENTER );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
else if( button.GetName() == TABLEVIEW_BUTTON_FIXED2_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
- table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.SetFixedHeight( 0, 50.0f );
table.SetFixedHeight( 2, 50.0f );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
else if( button.GetName() == TABLEVIEW_BUTTON_FIT1_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
- table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.SetFitHeight( 0 );
table.SetFitHeight( 2 );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
backing.SetSize( 0.0f, 100.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
backing.SetSize( 0.0f, 100.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
else if( button.GetName() == TABLEVIEW_BUTTON_FIT2_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
- table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
table.SetFitHeight( 1 );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
backing.SetSize( 0.0f, 200.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL1_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
- mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+ mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
- table.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- table.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ table.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
table.SetFitHeight( 0 );
table.SetFitHeight( 1 );
table.SetFitHeight( 2 );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
backing.SetSize( 0.0f, 100.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
backing.SetSize( 0.0f, 200.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
backing.SetSize( 0.0f, 300.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL2_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
- mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+ mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
- table.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- table.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ table.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
table.SetFitHeight( 0 );
table.SetFitHeight( 1 );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- backing.SetResizePolicy( FIXED, HEIGHT );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ backing.SetResizePolicy( ResizePolicy::FIXED, Dimension::HEIGHT );
backing.SetSize( 0.0f, 100.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
backing.SetSize( 0.0f, 200.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL3_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
+ mPopup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
- mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+ mPopup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
- table.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- table.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ table.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ table.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
table.SetFixedHeight( 0, 20.0f );
table.SetFitHeight( 1 );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
}
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
- backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+ backing.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
backing.SetSize( 0.0f, 200.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
text.SetParentOrigin( ParentOrigin::CENTER );
- text.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+ text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
text.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
text.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
Toolkit::PushButton popupButton = Toolkit::PushButton::New();
popupButton.SetName( buttonDataArray[ itemId ].name );
popupButton.SetLabel( buttonDataArray[ itemId ].text );
- popupButton.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+ popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
popupButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
popupButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
mContainer = Control::New();
mContainer.SetName( "Container" );
mContainer.SetParentOrigin( ParentOrigin::CENTER );
- mContainer.SetResizePolicy( FIXED, ALL_DIMENSIONS );
mContainer.SetSize( Vector2(stageSize.width*0.6f, stageSize.width*0.6f) );
mContainer.SetBackgroundImage( ResourceImage::New( BACKGROUND_IMAGE ) );
mContainer.GetChildAt(0).SetZ(-1.0f);
TextField field = TextField::New();
field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- field.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- field.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
+ field.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ field.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
mContainer.Add( field );
stage.KeyEventSignal().Connect(this, &EmojiExample::OnKeyEvent);
mTableView = Toolkit::TableView::New( NUMBER_OF_EMOJIS, 1 );
- mTableView.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- mTableView.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ mTableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
mTableView.TouchedSignal().Connect( this, &EmojiExample::OnTouchEvent );
stage.KeyEventSignal().Connect(this, &TextLabelMultiLanguageExample::OnKeyEvent);
mTableView = Toolkit::TableView::New( NUMBER_OF_LANGUAGES, 1 );
- mTableView.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- mTableView.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+ mTableView.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ mTableView.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
mTableView.SetParentOrigin( ParentOrigin::TOP_LEFT );
mTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
mTableView.TouchedSignal().Connect( this, &TextLabelMultiLanguageExample::OnTouchEvent );
mContainer = Control::New();
mContainer.SetName( "Container" );
mContainer.SetParentOrigin( ParentOrigin::CENTER );
- mContainer.SetResizePolicy( FIXED, ALL_DIMENSIONS );
mLayoutSize = Vector2(stageSize.width*0.6f, stageSize.width*0.6f);
mContainer.SetSize( mLayoutSize );
mContainer.SetBackgroundImage( ResourceImage::New( BACKGROUND_IMAGE ) );
mGrabCorner.SetName( "GrabCorner" );
mGrabCorner.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT );
mGrabCorner.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
- mGrabCorner.SetResizePolicy( FIXED, ALL_DIMENSIONS );
mGrabCorner.SetSize( Vector2(stageSize.width*0.1f, stageSize.width*0.1f) );
mGrabCorner.SetZ(1.0f);
mContainer.Add( mGrabCorner );
mLabel = TextLabel::New( "A Quick Brown Fox Jumps Over The Lazy Dog" );
mLabel.SetName( "TextLabel" );
mLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mLabel.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- mLabel.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
+ mLabel.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+ mLabel.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
mLabel.SetProperty( TextLabel::Property::MULTI_LINE, true );
mLabel.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 1.0f, 1.0f ) );
mLabel.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK );
#define DALI_DEMO_STR_TITLE_ANIMATED_SHAPES dgettext(DALI_DEMO_STR_TITLE_ANIMATED_SHAPES)
#define DALI_DEMO_STR_TITLE_PATH_ANIMATION dgettext(DALI_DEMO_STR_TITLE_PATH_ANIMATION)
#define DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE dgettext(DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE)
+#define DALI_DEMO_STR_TITLE_BUTTONS dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_BUTTONS")
+#define DALI_DEMO_STR_TITLE_LOGGING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_LOGGING")
#else // !INTERNATIONALIZATION_ENABLED
#define DALI_DEMO_STR_TITLE_ANIMATED_SHAPES "Animated Shapes"
#define DALI_DEMO_STR_TITLE_PATH_ANIMATION "Animated Path"
#define DALI_DEMO_STR_TITLE_NEGOTIATE_SIZE "Negotiate Size"
+#define DALI_DEMO_STR_TITLE_BUTTONS "Buttons"
+#define DALI_DEMO_STR_TITLE_LOGGING "Logging"
#endif
toolBarLayer.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
toolBarLayer.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
toolBarLayer.SetSize( 0.0f, style.mToolBarHeight );
- toolBarLayer.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::WIDTH );
+ toolBarLayer.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::WIDTH );
// Raise tool bar layer to the top.
toolBarLayer.RaiseToTop();
Dali::Image image = Dali::ResourceImage::New( toolbarImagePath );
Dali::ImageActor toolBarBackground = Dali::ImageActor::New( image );
toolBarBackground.SetName( "TOOLBAR_BACKGROUND" );
- toolBarBackground.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::ALL_DIMENSIONS );
+ toolBarBackground.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
toolBar = Dali::Toolkit::ToolBar::New();
toolBar.SetName( "TOOLBAR" );
toolBar.SetBackground( toolBarBackground );
toolBar.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
toolBar.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
- toolBar.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::ALL_DIMENSIONS );
+ toolBar.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
toolBarBackground.SetSortModifier(1.0f);
// Add the tool bar to the too bar layer.
label.SetProperty( Dali::Toolkit::TextLabel::Property::TEXT, title );
label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
- label.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::HEIGHT );
+ label.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::HEIGHT );
label.SetColor( DEFAULT_TEXT_STYLE_COLOR );
// Add title to the tool bar.
// Create default View.
view = Dali::Toolkit::View::New();
- view.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::ALL_DIMENSIONS );
+ view.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
// Add the view to the stage before setting the background.
stage.Add( view );
Dali::Layer contentLayer = Dali::Layer::New();
contentLayer.SetAnchorPoint( Dali::AnchorPoint::CENTER );
contentLayer.SetParentOrigin( Dali::ParentOrigin::CENTER );
- contentLayer.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::ALL_DIMENSIONS );
+ contentLayer.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::ALL_DIMENSIONS );
view.AddContentLayer( contentLayer );
contentLayer.LowerBelow( toolBarLayer );
label.SetDrawMode( Dali::DrawMode::OVERLAY );
label.SetProperty( Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
label.SetProperty( Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
- label.SetResizePolicy( Dali::FILL_TO_PARENT, Dali::HEIGHT );
+ label.SetResizePolicy( Dali::ResizePolicy::FILL_TO_PARENT, Dali::Dimension::HEIGHT );
label.SetColor( DEFAULT_TEXT_STYLE_COLOR );
return label;