Merge remote-tracking branch 'origin/tizen' into new_text
[platform/core/uifw/dali-demo.git] / examples / size-negotiation / size-negotiation-example.cpp
index 130f83b..c9a5026 100644 (file)
@@ -21,6 +21,8 @@
 
 using namespace Dali;
 
+using Dali::Toolkit::TextLabel;
+
 // Define this so that it is interchangeable
 // "DP" stands for Device independent Pixels
 #define DP(x) DemoHelper::ScalePointSize(x)
@@ -155,6 +157,8 @@ public:
   {
     // The Init signal is received once (only) during the Application lifetime
 
+    DemoHelper::RequestThemeChange();
+
     Stage stage = Stage::GetCurrent();
 
     // Respond to key events
@@ -169,8 +173,7 @@ public:
                                             TOOLBAR_IMAGE,
                                             std::string("") );
 
-    mTitleActor = Dali::Toolkit::TextView::New();
-    mTitleActor.SetName( "CUSTOM_TOOLBAR_TITLE" );
+    mTitleActor = DemoHelper::CreateToolBarLabel( "CUSTOM_TOOLBAR_TITLE" );
 
     SetTitle();
 
@@ -231,8 +234,7 @@ public:
       }
     }
 
-    mTitleActor.SetText( std::string( TOOLBAR_TITLE ) + ": " + subTitle );
-    mTitleActor.SetStyleToCurrentText( DemoHelper::GetDefaultTextStyle() );
+    mTitleActor.SetProperty( Toolkit::TextLabel::Property::TEXT, std::string( std::string( TOOLBAR_TITLE ) + ": " + subTitle ) );
   }
 
   bool OnMenu( Toolkit::Button button )
@@ -251,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 );
@@ -327,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 );
@@ -341,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 )
@@ -351,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 )
@@ -370,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 )
@@ -399,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 )
@@ -429,30 +419,22 @@ 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 )
     {
       mPopup = CreatePopup();
 
-      Toolkit::TextView text = Toolkit::TextView::New();
+      TextLabel text = TextLabel::New( CONTENT_TEXT );
       text.SetName( "POPUP_CONTENT_TEXT" );
-      text.SetText( CONTENT_TEXT );
-      text.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
-      text.SetWidthExceedPolicy( Toolkit::TextView::Split );
-      text.SetLineJustification( Toolkit::TextView::Center );
-      text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      text.SetDimensionDependency( HEIGHT, WIDTH );
+      text.SetProperty( TextLabel::Property::MULTI_LINE, true );
+      text.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+      text.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+      text.SetResizePolicy( FILL_TO_PARENT, Dali::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_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 )
@@ -532,21 +499,14 @@ public:
       mPopup = CreatePopup();
       mPopup.SetTitle( "Popup!" );
 
-      Toolkit::TextView text = Toolkit::TextView::New();
+      Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT );
       text.SetName( "POPUP_CONTENT_TEXT" );
-      text.SetText( CONTENT_TEXT );
-      text.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
-      text.SetWidthExceedPolicy( Toolkit::TextView::Split );
-      text.SetLineJustification( Toolkit::TextView::Center );
       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 )
@@ -554,14 +514,10 @@ public:
       mPopup = CreatePopup();
       mPopup.SetTitle( "Popup!" );
 
-      Toolkit::TextView text = Toolkit::TextView::New();
+      Toolkit::TextLabel text = Toolkit::TextLabel::New( CONTENT_TEXT );
       text.SetName( "POPUP_CONTENT_TEXT" );
-      text.SetText( CONTENT_TEXT );
-      text.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
-      text.SetWidthExceedPolicy( Toolkit::TextView::Split );
-      text.SetLineJustification( Toolkit::TextView::Left );
       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 );
@@ -586,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 )
@@ -607,13 +560,9 @@ public:
 
       // Text
       {
-        Toolkit::TextView text = Toolkit::TextView::New();
-        text.SetText( "Do you really want to quit?" );
-        text.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
-        text.SetWidthExceedPolicy( Toolkit::TextView::Split );
-        text.SetLineJustification( Toolkit::TextView::Left );
+        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 ) );
       }
@@ -623,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 ) );
       }
@@ -642,20 +591,17 @@ 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 ) );
 
-        Toolkit::TextView text = Toolkit::TextView::New();
-        text.SetText( "Don't show again" );
-        text.SetLineJustification( Toolkit::TextView::Left );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Don't show again" );
         Actor textActor = text;
         textActor.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 10.0f ) );
 
         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 );
@@ -681,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 ) );
 
 
@@ -699,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 ) );
 
 
@@ -722,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 ) );
 
 
@@ -756,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 ) );
 
 
@@ -825,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 ) );
 
 
@@ -845,7 +771,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-        TextActor text = TextActor::New( "Fixed" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -854,7 +780,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-        TextActor text = TextActor::New( "Fill" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -863,7 +789,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-        TextActor text = TextActor::New( "Fill" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -872,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 ) );
 
 
@@ -893,7 +815,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-        TextActor text = TextActor::New( "Fixed" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -902,7 +824,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-        TextActor text = TextActor::New( "Fill" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -911,7 +833,7 @@ public:
       {
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-        TextActor text = TextActor::New( "Fixed" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -920,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 ) );
 
 
@@ -941,10 +859,9 @@ 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 );
 
-        TextActor text = TextActor::New( "Fit" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -955,7 +872,7 @@ public:
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
-        TextActor text = TextActor::New( "Fill" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -965,10 +882,9 @@ 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 );
 
-        TextActor text = TextActor::New( "Fit" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -978,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 );
@@ -999,7 +910,7 @@ public:
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
-        TextActor text = TextActor::New( "Fill" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -1009,10 +920,9 @@ 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 );
 
-        TextActor text = TextActor::New( "Fit" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -1023,7 +933,7 @@ public:
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
-        TextActor text = TextActor::New( "Fill" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fill" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -1033,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 );
 
@@ -1056,10 +962,9 @@ 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 );
 
-        TextActor text = TextActor::New( "Fit" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -1069,10 +974,9 @@ 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 );
 
-        TextActor text = TextActor::New( "Fit" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -1082,10 +986,9 @@ 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 );
 
-        TextActor text = TextActor::New( "Fit" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -1095,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 );
 
@@ -1118,9 +1017,9 @@ 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 );
 
-        TextActor text = TextActor::New( "Fit" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -1130,10 +1029,9 @@ 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 );
 
-        TextActor text = TextActor::New( "Fit" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -1143,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 );
 
@@ -1166,7 +1060,7 @@ public:
         Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
         backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
-        TextActor text = TextActor::New( "Fixed" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fixed" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -1176,10 +1070,9 @@ 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 );
 
-        TextActor text = TextActor::New( "Fit" );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New( "Fit" );
         text.SetAnchorPoint( AnchorPoint::CENTER );
         text.SetParentOrigin( ParentOrigin::CENTER );
         backing.Add( text );
@@ -1189,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 )
@@ -1315,7 +1205,7 @@ private:
   Toolkit::ToolBar  mToolBar;                ///< The View's Toolbar.
   Layer             mContentLayer;           ///< Content layer
 
-  Toolkit::TextView mTitleActor;             ///< Title text
+  Toolkit::TextLabel mTitleActor;             ///< Title text
 
   Toolkit::Popup    mMenu;                   ///< The navigation menu
   bool              mMenuShown;              ///< If the navigation menu is currently being displayed or not