mMenu.SetAnchorPoint( AnchorPoint::TOP_LEFT );
mMenu.HideTail();
mMenu.OutsideTouchedSignal().Connect( this, &SizeNegotiationController::HideMenu );
- mMenu.SetPreferredSize( Vector2( popupWidth, 0.0f ) );
+ mMenu.SetSize( popupWidth, 0.0f );
mMenu.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
Toolkit::TableView tableView = Toolkit::TableView::New( 0, 0 );
popup.SetName( "POPUP" );
popup.SetParentOrigin( ParentOrigin::CENTER );
popup.SetAnchorPoint( AnchorPoint::CENTER );
- popup.SetPreferredSize( Vector2( POPUP_WIDTH_DP, 0.0f ) );
+ popup.SetSize( POPUP_WIDTH_DP, 0.0f );
popup.HideTail();
popup.OutsideTouchedSignal().Connect( this, &SizeNegotiationController::OnPopupOutsideTouched );
{
mPopup = CreatePopup();
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_TITLE_ID )
mPopup = CreatePopup();
mPopup.SetTitle( "Popup!" );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_BUTTONS_1_ID )
mPopup.AddButton( okayButton );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_BUTTONS_2_ID )
mPopup.AddButton( okayButton );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_TITLE_BUTTONS_ID )
mPopup.AddButton( okayButton );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_CONTENT_TEXT_ID )
mPopup.Add( text );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_ID )
ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- image.SetDimensionDependency( HEIGHT, WIDTH );
+ image.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
image.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
mPopup.Add( image );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
mPopup.Add( image );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
mPopup.Add( image );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
mPopup.Add( image );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_ID )
Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT );
text.SetName( "POPUP_CONTENT_TEXT" );
text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- text.SetDimensionDependency( HEIGHT, WIDTH );
+ text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
text.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
mPopup.Add( text );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_BUTTONS_ID )
Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT );
text.SetName( "POPUP_CONTENT_TEXT" );
text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- text.SetDimensionDependency( HEIGHT, WIDTH );
+ text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
text.SetPadding( Padding( 10.0f, 10.0f, 20.0f, 0.0f ) );
mPopup.Add( text );
mPopup.AddButton( okayButton );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == POPUP_BUTTON_COMPLEX_ID )
{
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Do you really want to quit?" );
text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- text.SetDimensionDependency( HEIGHT, WIDTH );
+ text.SetResizePolicy( DIMENSION_DEPENDENCY, 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.SetDimensionDependency( HEIGHT, WIDTH );
+ image.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
content.AddChild( image, Toolkit::TableView::CellPosition( 0, 1 ) );
}
Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New();
checkBox.SetBackgroundImage( unchecked );
checkBox.SetSelectedImage( checked );
- checkBox.SetPreferredSize( Vector2( 48, 48 ) );
- checkBox.SetResizePolicy( FIXED, ALL_DIMENSIONS );
+ checkBox.SetSize( 48, 48 );
root.AddChild( checkBox, Toolkit::TableView::CellPosition( 0, 0 ) );
root.AddChild( text, Toolkit::TableView::CellPosition( 0, 1 ) );
- content.AddChild( root, Toolkit::TableView::CellPosition( 1, 0, 0, 2 ) ); // Column span 2
+ content.AddChild( root, Toolkit::TableView::CellPosition( 1, 0 ) );
}
mPopup.Add( content );
mPopup.AddButton( okayButton );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_EMPTY_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_1CELL_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_3CELL_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_3X3CELL_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_FIXED1_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_FIXED2_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_FIT1_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- backing.SetResizePolicy( FIXED, HEIGHT );
- backing.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+ backing.SetSize( 0.0f, 100.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- backing.SetResizePolicy( FIXED, HEIGHT );
- backing.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+ backing.SetSize( 0.0f, 100.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_FIT2_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, 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.SetFitHeight( 1 );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- backing.SetResizePolicy( FIXED, HEIGHT );
- backing.SetPreferredSize( Vector2( 0.0f, 200.0f ) );
+ backing.SetSize( 0.0f, 200.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL1_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- backing.SetResizePolicy( FIXED, HEIGHT );
- backing.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+ backing.SetSize( 0.0f, 100.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- backing.SetResizePolicy( FIXED, HEIGHT );
- backing.SetPreferredSize( Vector2( 0.0f, 200.0f ) );
+ backing.SetSize( 0.0f, 200.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- backing.SetResizePolicy( FIXED, HEIGHT );
- backing.SetPreferredSize( Vector2( 0.0f, 300.0f ) );
+ backing.SetSize( 0.0f, 300.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL2_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
backing.SetResizePolicy( FIXED, HEIGHT );
- backing.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+ backing.SetSize( 0.0f, 100.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- backing.SetResizePolicy( FIXED, HEIGHT );
- backing.SetPreferredSize( Vector2( 0.0f, 200.0f ) );
+ backing.SetSize( 0.0f, 200.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL3_ID )
{
mPopup = CreatePopup();
- mPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+ mPopup.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, WIDTH );
mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
{
Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
backing.SetResizePolicy( FILL_TO_PARENT, WIDTH );
- backing.SetResizePolicy( FIXED, HEIGHT );
- backing.SetPreferredSize( Vector2( 0.0f, 200.0f ) );
+ backing.SetSize( 0.0f, 200.0f );
Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
text.SetAnchorPoint( AnchorPoint::CENTER );
mPopup.Add( table );
- // The popup is not yet on the stage so needs to be flaged as dirty
- mPopup.MarkDirtyForRelayout();
-
mPopup.Show();
}
else if( button.GetName() == OKAY_BUTTON_ID || button.GetName() == CANCEL_BUTTON_ID )