Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-demo.git] / examples / size-negotiation / size-negotiation-example.cpp
index 54f9fa8..c9a5026 100644 (file)
@@ -253,7 +253,7 @@ public:
     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 );
@@ -329,7 +329,7 @@ public:
     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 );
@@ -343,9 +343,6 @@ public:
     {
       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 )
@@ -353,9 +350,6 @@ public:
       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 )
@@ -372,9 +366,6 @@ public:
 
       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 )
@@ -401,9 +392,6 @@ public:
 
       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 )
@@ -431,9 +419,6 @@ public:
 
       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 )
@@ -450,9 +435,6 @@ public:
 
       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 )
@@ -461,22 +443,18 @@ public:
 
       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 ) );
@@ -484,17 +462,13 @@ public:
 
       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 ) );
@@ -503,17 +477,13 @@ public:
 
       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 ) );
@@ -522,9 +492,6 @@ public:
 
       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 )
@@ -535,14 +502,11 @@ public:
       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 )
@@ -553,7 +517,7 @@ public:
       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 );
@@ -578,9 +542,6 @@ public:
 
       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 )
@@ -601,7 +562,7 @@ public:
       {
         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 ) );
       }
@@ -611,7 +572,7 @@ public:
         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 ) );
       }
@@ -630,8 +591,7 @@ public:
         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 ) );
 
@@ -641,7 +601,7 @@ public:
 
         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 );
@@ -667,16 +627,12 @@ public:
 
       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 ) );
 
 
@@ -685,16 +641,12 @@ public:
 
       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 ) );
 
 
@@ -708,16 +660,12 @@ public:
 
       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 ) );
 
 
@@ -742,16 +690,12 @@ public:
 
       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 ) );
 
 
@@ -811,16 +755,12 @@ public:
 
       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 ) );
 
 
@@ -858,16 +798,12 @@ public:
 
       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 ) );
 
 
@@ -906,16 +842,12 @@ public:
 
       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 ) );
 
 
@@ -927,8 +859,7 @@ public:
       {
         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 );
@@ -951,8 +882,7 @@ public:
       {
         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 );
@@ -964,19 +894,14 @@ public:
 
       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 );
@@ -995,8 +920,7 @@ public:
       {
         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 );
@@ -1019,16 +943,12 @@ public:
 
       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 );
 
@@ -1042,8 +962,7 @@ public:
       {
         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 );
@@ -1055,8 +974,7 @@ public:
       {
         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 );
@@ -1068,8 +986,7 @@ public:
       {
         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 );
@@ -1081,16 +998,12 @@ public:
 
       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 );
 
@@ -1104,7 +1017,7 @@ public:
         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 );
@@ -1116,8 +1029,7 @@ public:
       {
         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 );
@@ -1129,16 +1041,12 @@ public:
 
       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 );
 
@@ -1162,8 +1070,7 @@ public:
       {
         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 );
@@ -1175,9 +1082,6 @@ public:
 
       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 )