Updated demos to use DALi clang-format
[platform/core/uifw/dali-demo.git] / examples / size-negotiation / size-negotiation-example.cpp
index 130f83b..0dc96e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-#include "shared/view.h"
-#include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/popup/popup.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
+#include <dali/dali.h>
+#include "shared/view.h"
 
 using namespace Dali;
 
-// Define this so that it is interchangeable
-// "DP" stands for Device independent Pixels
-#define DP(x) DemoHelper::ScalePointSize(x)
+using Dali::Toolkit::TextLabel;
 
 struct ButtonItem
 {
@@ -31,119 +32,72 @@ struct ButtonItem
   const char* text;
 };
 
-
 namespace
 {
-
-const char* const BACKGROUND_IMAGE = DALI_IMAGE_DIR "background-gradient.jpg";
-const char* const TOOLBAR_IMAGE = DALI_IMAGE_DIR "top-bar.png";
-
-const char* const TOOLBAR_TITLE = "Size Negotiation";
-const int TOOLBAR_HEIGHT = 62;
-
-const char* MENU_ICON_IMAGE = DALI_IMAGE_DIR "icon-cluster-none.png";
-
-const char* const PUSHBUTTON_BUTTON_IMAGE = DALI_IMAGE_DIR "button-up.9.png";
-const char* const PUSHBUTTON_PRESS_IMAGE = DALI_IMAGE_DIR "button-down.9.png";
-
-const char* const POPUPS_MENU_ID = "POPUPS_MENU";
-const char* const TABLEVIEW_MENU_ID = "TABLEVIEW_MENU";
-
-const char* const POPUP_BUTTON_EMPTY_ID = "POPUP_BUTTON_EMPTY";
-const char* const POPUP_BUTTON_TITLE_ID = "POPUP_BUTTON_TITLE";
-const char* const POPUP_BUTTON_BUTTONS_1_ID = "POPUP_BUTTON_BUTTONS_1";
-const char* const POPUP_BUTTON_BUTTONS_2_ID = "POPUP_BUTTON_BUTTONS_2";
-const char* const POPUP_BUTTON_TITLE_BUTTONS_ID = "POPUP_BUTTON_TITLE_BUTTONS";
-const char* const POPUP_BUTTON_CONTENT_TEXT_ID = "POPUP_BUTTON_CONTENT_TEXT";
-const char* const POPUP_BUTTON_CONTENT_IMAGE_ID = "POPUP_BUTTON_CONTENT_IMAGE";
+const char* const BACKGROUND_IMAGE = DEMO_IMAGE_DIR "background-gradient.jpg";
+const char* const TOOLBAR_IMAGE    = DEMO_IMAGE_DIR "top-bar.png";
+const char* const IMAGE            = DEMO_IMAGE_DIR "background-magnifier.jpg";
+
+const char* const TOOLBAR_TITLE = "Negotiate Size";
+
+// This example contains size negotiation tests for TableView and Popup.
+const char* const TABLEVIEW_BUTTON_1CELL_ID           = "TABLEVIEW_BUTTON_1CELL";
+const char* const TABLEVIEW_BUTTON_3CELL_ID           = "TABLEVIEW_BUTTON_3CELL";
+const char* const TABLEVIEW_BUTTON_3X3CELL_ID         = "TABLEVIEW_BUTTON_3X3CELL";
+const char* const TABLEVIEW_BUTTON_FIXED1_ID          = "TABLEVIEW_BUTTON_FIXED1";
+const char* const TABLEVIEW_BUTTON_FIXED2_ID          = "TABLEVIEW_BUTTON_FIXED2";
+const char* const TABLEVIEW_BUTTON_FIT1_ID            = "TABLEVIEW_BUTTON_FIT1";
+const char* const TABLEVIEW_BUTTON_FIT2_ID            = "TABLEVIEW_BUTTON_FIT2";
+const char* const TABLEVIEW_BUTTON_NATURAL1_ID        = "TABLEVIEW_BUTTON_NATURAL1";
+const char* const TABLEVIEW_BUTTON_NATURAL2_ID        = "TABLEVIEW_BUTTON_NATURAL2";
+const char* const TABLEVIEW_BUTTON_NATURAL3_ID        = "TABLEVIEW_BUTTON_NATURAL3";
 const char* const POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID = "POPUP_BUTTON_CONTENT_IMAGE_SCALE";
-const char* const POPUP_BUTTON_CONTENT_IMAGE_FIT_ID = "POPUP_BUTTON_CONTENT_IMAGE_FIT";
-const char* const POPUP_BUTTON_CONTENT_IMAGE_FILL_ID = "POPUP_BUTTON_CONTENT_IMAGE_FILL";
-const char* const POPUP_BUTTON_TITLE_CONTENT_TEXT_ID = "POPUP_BUTTON_TITLE_CONTENT_TEXT";
-const char* const POPUP_BUTTON_TITLE_CONTENT_TEXT_BUTTONS_ID = "POPUP_BUTTON_TITLE_CONTENT_TEXT_BUTTONS";
-const char* const POPUP_BUTTON_COMPLEX_ID = "POPUP_BUTTON_COMPLEX";
-
-const char* const TABLEVIEW_BUTTON_EMPTY_ID = "TABLEVIEW_BUTTON_EMPTY";
-const char* const TABLEVIEW_BUTTON_1CELL_ID = "TABLEVIEW_BUTTON_1CELL";
-const char* const TABLEVIEW_BUTTON_3CELL_ID = "TABLEVIEW_BUTTON_3CELL";
-const char* const TABLEVIEW_BUTTON_3X3CELL_ID = "TABLEVIEW_BUTTON_3X3CELL";
-const char* const TABLEVIEW_BUTTON_FIXED1_ID = "TABLEVIEW_BUTTON_FIXED1";
-const char* const TABLEVIEW_BUTTON_FIXED2_ID = "TABLEVIEW_BUTTON_FIXED2";
-const char* const TABLEVIEW_BUTTON_FIT1_ID = "TABLEVIEW_BUTTON_FIT1";
-const char* const TABLEVIEW_BUTTON_FIT2_ID = "TABLEVIEW_BUTTON_FIT2";
-const char* const TABLEVIEW_BUTTON_NATURAL1_ID = "TABLEVIEW_BUTTON_NATURAL1";
-const char* const TABLEVIEW_BUTTON_NATURAL2_ID = "TABLEVIEW_BUTTON_NATURAL2";
-const char* const TABLEVIEW_BUTTON_NATURAL3_ID = "TABLEVIEW_BUTTON_NATURAL3";
-
-const char* const OKAY_BUTTON_ID = "OKAY_BUTTON";
-const char* const CANCEL_BUTTON_ID = "CANCEL_BUTTON";
-
-const char* const CONTENT_TEXT = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
-const char* const IMAGE1 = DALI_IMAGE_DIR "gallery-medium-5.jpg";
-const char* const IMAGE2 = DALI_IMAGE_DIR "background-magnifier.jpg";
-const char* const CHECKBOX_UNCHECKED_IMAGE = DALI_IMAGE_DIR "checkbox-unselected.png";
-const char* const CHECKBOX_CHECKED_IMAGE = DALI_IMAGE_DIR "checkbox-selected.png";
-
-const ButtonItem MENU_ITEMS[] = {
-    { POPUPS_MENU_ID,        "Popups" },
-    { TABLEVIEW_MENU_ID,     "TableView" }
-};
-
-const unsigned int MENU_ITEMS_COUNT = sizeof( MENU_ITEMS ) / sizeof( MENU_ITEMS[0] );
-
-const ButtonItem POPUP_BUTTON_ITEMS[] = {
-    { POPUP_BUTTON_COMPLEX_ID,                    "Complex" },
-    { POPUP_BUTTON_EMPTY_ID,                      "Empty" },
-    { POPUP_BUTTON_TITLE_ID,                      "Title" },
-    { POPUP_BUTTON_BUTTONS_1_ID,                  "1 Button" },
-    { POPUP_BUTTON_BUTTONS_2_ID,                  "2 Buttons" },
-    { POPUP_BUTTON_TITLE_BUTTONS_ID,              "Title & Buttons" },
-    { POPUP_BUTTON_CONTENT_TEXT_ID,               "Text" },
-    { POPUP_BUTTON_CONTENT_IMAGE_ID,              "Image" },
-    { POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID,        "Image Scale" },
-    { POPUP_BUTTON_CONTENT_IMAGE_FIT_ID,          "Image Fit" },
-    { POPUP_BUTTON_CONTENT_IMAGE_FILL_ID,         "Image Fill" },
-    { POPUP_BUTTON_TITLE_CONTENT_TEXT_ID,         "Title Text" },
-    { POPUP_BUTTON_TITLE_CONTENT_TEXT_BUTTONS_ID, "Title, text, buttons" }
-
-};
-
-const int POPUP_BUTTON_ITEMS_COUNT = sizeof( POPUP_BUTTON_ITEMS ) / sizeof( POPUP_BUTTON_ITEMS[0] );
+const char* const POPUP_BUTTON_CONTENT_IMAGE_FIT_ID   = "POPUP_BUTTON_CONTENT_IMAGE_FIT";
+const char* const POPUP_BUTTON_CONTENT_IMAGE_FILL_ID  = "POPUP_BUTTON_CONTENT_IMAGE_FILL";
 
 const ButtonItem TABLEVIEW_BUTTON_ITEMS[] = {
-    { TABLEVIEW_BUTTON_EMPTY_ID,                    "Empty" },
-    { TABLEVIEW_BUTTON_1CELL_ID,                    "1 Cell" },
-    { TABLEVIEW_BUTTON_3CELL_ID,                    "3 Cell" },
-    { TABLEVIEW_BUTTON_3X3CELL_ID,                  "3x3 Cells" },
-    { TABLEVIEW_BUTTON_FIXED1_ID,                   "Fixed 1" },
-    { TABLEVIEW_BUTTON_FIXED2_ID,                   "Fixed 2" },
-    { TABLEVIEW_BUTTON_FIT1_ID,                     "Fit Top Bottom" },
-    { TABLEVIEW_BUTTON_FIT2_ID,                     "Fit Middle" },
-    { TABLEVIEW_BUTTON_NATURAL1_ID,                 "Natural 1" },
-    { TABLEVIEW_BUTTON_NATURAL2_ID,                 "Natural 2" },
-    { TABLEVIEW_BUTTON_NATURAL3_ID,                 "Natural 3" },
+  {TABLEVIEW_BUTTON_1CELL_ID, "1 Cell"},
+  {TABLEVIEW_BUTTON_3CELL_ID, "3 Cell"},
+  {TABLEVIEW_BUTTON_3X3CELL_ID, "3x3 Cells"},
+  {TABLEVIEW_BUTTON_FIXED1_ID, "Fixed 1"},
+  {TABLEVIEW_BUTTON_FIXED2_ID, "Fixed 2"},
+  {TABLEVIEW_BUTTON_FIT1_ID, "Fit Top Bottom"},
+  {TABLEVIEW_BUTTON_FIT2_ID, "Fit Middle"},
+  {TABLEVIEW_BUTTON_NATURAL1_ID, "Natural 1"},
+  {TABLEVIEW_BUTTON_NATURAL2_ID, "Natural 2"},
+  {TABLEVIEW_BUTTON_NATURAL3_ID, "Natural 3"},
+  {POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID, "Image Scale"},
+  {POPUP_BUTTON_CONTENT_IMAGE_FIT_ID, "Image Fit"},
+  {POPUP_BUTTON_CONTENT_IMAGE_FILL_ID, "Image Fill"},
 };
 
-const unsigned int TABLEVIEW_BUTTON_ITEMS_COUNT = sizeof( TABLEVIEW_BUTTON_ITEMS ) / sizeof( TABLEVIEW_BUTTON_ITEMS[0] );
+const unsigned int TABLEVIEW_BUTTON_ITEMS_COUNT = sizeof(TABLEVIEW_BUTTON_ITEMS) / sizeof(TABLEVIEW_BUTTON_ITEMS[0]);
 
-}  // namespace
+Actor CreateSolidColor(Vector4 color)
+{
+  Toolkit::Control control = Toolkit::Control::New();
 
+  Property::Map map;
+  map[Toolkit::Visual::Property::TYPE]           = Toolkit::Visual::COLOR;
+  map[Toolkit::ColorVisual::Property::MIX_COLOR] = color;
+  control.SetProperty(Toolkit::Control::Property::BACKGROUND, map);
 
+  return control;
+}
+
+} // anonymous namespace
 
 /**
  * This example shows the usage of size negotiation.
  */
-class SizeNegotiationController: public ConnectionTracker, public Toolkit::ItemFactory
+class SizeNegotiationController : public ConnectionTracker, public Toolkit::ItemFactory
 {
 public:
-
-  SizeNegotiationController( Application& application )
-    : mApplication( application ),
-      mMenuShown( false ),
-      mDemoState( POPUP )
+  SizeNegotiationController(Application& application)
+  : mApplication(application)
   {
     // Connect to the Application's Init signal
-    mApplication.InitSignal().Connect( this, &SizeNegotiationController::Create );
+    mApplication.InitSignal().Connect(this, &SizeNegotiationController::Create);
   }
 
   ~SizeNegotiationController()
@@ -151,1073 +105,665 @@ public:
     // Nothing to do here
   }
 
-  void Create( Application& application )
+  void Create(Application& application)
   {
     // The Init signal is received once (only) during the Application lifetime
+    Window window = application.GetWindow();
 
-    Stage stage = Stage::GetCurrent();
-
-    // Respond to key events
-    stage.KeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent);
+    // Respond to key events if not handled
+    window.KeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent);
 
     // Creates a default view with a default tool bar.
-    // The view is added to the stage.
-    mContentLayer = DemoHelper::CreateView( application,
-                                            mView,
-                                            mToolBar,
-                                            BACKGROUND_IMAGE,
-                                            TOOLBAR_IMAGE,
-                                            std::string("") );
-
-    mTitleActor = Dali::Toolkit::TextView::New();
-    mTitleActor.SetName( "CUSTOM_TOOLBAR_TITLE" );
-
-    SetTitle();
+    // The view is added to the window.
+    mContentLayer = DemoHelper::CreateView(application,
+                                           mView,
+                                           mToolBar,
+                                           BACKGROUND_IMAGE,
+                                           TOOLBAR_IMAGE,
+                                           std::string(""));
 
-    // Create menu button
-    Toolkit::PushButton viewButton = Toolkit::PushButton::New();
-    viewButton.SetBackgroundImage( ResourceImage::New( MENU_ICON_IMAGE ) );
-    viewButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnMenu );
-    mToolBar.AddControl( viewButton, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalLeft, DemoHelper::DEFAULT_MODE_SWITCH_PADDING  );
+    mTitleActor = DemoHelper::CreateToolBarLabel("CUSTOM_TOOLBAR_TITLE");
+    mTitleActor.SetProperty(Toolkit::TextLabel::Property::TEXT, TOOLBAR_TITLE);
 
     // Add title to the tool bar.
-    const float padding( DemoHelper::DEFAULT_VIEW_STYLE.mToolBarPadding );
-    mToolBar.AddControl( mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HorizontalCenter, Toolkit::Alignment::Padding( padding, padding, padding, padding ) );
+    const float padding(DemoHelper::DEFAULT_VIEW_STYLE.mToolBarPadding);
+    mToolBar.AddControl(mTitleActor, DemoHelper::DEFAULT_VIEW_STYLE.mToolBarTitlePercentage, Toolkit::Alignment::HORIZONTAL_CENTER, Toolkit::Alignment::Padding(padding, padding, padding, padding));
 
-    mItemView = Toolkit::ItemView::New( *this );
-    mItemView.SetParentOrigin( ParentOrigin::CENTER );
-    mItemView.SetAnchorPoint( AnchorPoint::CENTER );
-    mItemView.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+    mItemView = Toolkit::ItemView::New(*this);
+    mItemView.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+    mItemView.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+    mItemView.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
 
     // Use a grid layout for tests
-    Toolkit::GridLayoutPtr gridLayout = Toolkit::GridLayout::New();
-    gridLayout->SetNumberOfColumns( 2 );
-    gridLayout->SetTopMargin( DP(TOOLBAR_HEIGHT) + DP(20.0f) );
-    gridLayout->SetBottomMargin( DP(100.0f) );
-    gridLayout->SetRowSpacing( DP(20.0f) );
-    mItemView.AddLayout( *gridLayout );
-
-    Vector2 stageSize = stage.GetSize();
-    float layoutWidth = Toolkit::IsHorizontal( gridLayout->GetOrientation() ) ? stageSize.height : stageSize.width;
-    float gridItemSize = ( layoutWidth / gridLayout->GetNumberOfColumns() ) * 0.5f;
-    gridLayout->SetScrollSpeedFactor( gridLayout->GetNumberOfColumns() / gridItemSize * 0.5f );
-
-    mItemView.ActivateLayout( 0, Vector3(stageSize.x, stageSize.y, stageSize.x), 0.0f );
-
-    mContentLayer.Add( mItemView );
-  }
-
-  void SetTitle()
-  {
-    std::string subTitle = "";
-
-    switch( mDemoState )
-    {
-      case POPUP:
-      {
-        subTitle = "Popups";
-        break;
-      }
-
-      case TABLEVIEW:
-      {
-        subTitle = "TableView";
-        break;
-      }
+    Vector2                windowSize = window.GetSize();
+    Toolkit::ItemLayoutPtr gridLayout = Toolkit::DefaultItemLayout::New(Toolkit::DefaultItemLayout::LIST);
+    Vector3                itemSize;
+    gridLayout->GetItemSize(0, Vector3(windowSize), itemSize);
+    itemSize.height = windowSize.y / 10;
+    gridLayout->SetItemSize(itemSize);
+    mItemView.AddLayout(*gridLayout);
 
-      default:
-      {
-        break;
-      }
-    }
+    mItemView.ActivateLayout(0, Vector3(windowSize.x, windowSize.y, windowSize.x), 0.0f);
 
-    mTitleActor.SetText( std::string( TOOLBAR_TITLE ) + ": " + subTitle );
-    mTitleActor.SetStyleToCurrentText( DemoHelper::GetDefaultTextStyle() );
+    mContentLayer.Add(mItemView);
   }
 
-  bool OnMenu( Toolkit::Button button )
+  void ShowPopup(Toolkit::Popup popup)
   {
-    ShowMenu();
-    return true;
+    mApplication.GetWindow().Add(popup);
+    popup.SetDisplayState(Toolkit::Popup::SHOWN);
   }
 
-  void ShowMenu()
+  void OnPopupOutsideTouched()
   {
-    Stage stage = Stage::GetCurrent();
-    const float popupWidth = stage.GetSize().x * 0.5f;
-
-    mMenu = Toolkit::Popup::New();
-    mMenu.SetParentOrigin( ParentOrigin::TOP_LEFT );
-    mMenu.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    mMenu.HideTail();
-    mMenu.OutsideTouchedSignal().Connect( this, &SizeNegotiationController::HideMenu );
-    mMenu.SetPreferredSize( Vector2( popupWidth, 0.0f ) );
-    mMenu.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
-
-    Toolkit::TableView tableView = Toolkit::TableView::New( 0, 0 );
-    tableView.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-    tableView.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
-    mMenu.Add( tableView );
-
-    for( unsigned int i = 0; i < MENU_ITEMS_COUNT; ++i )
+    if(mPopup)
     {
-      Toolkit::PushButton menuButton = Toolkit::PushButton::New();
-      menuButton.SetName( MENU_ITEMS[ i ].name );
-      menuButton.SetLabel( MENU_ITEMS[ i ].text );
-      menuButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnMenuSelect );
-
-      tableView.Add( menuButton );
-      tableView.SetFitHeight( i );
+      mPopup.SetDisplayState(Toolkit::Popup::HIDDEN);
     }
-
-    // Show the menu
-    mMenu.Show();
-    mMenuShown = true;
   }
 
-  void HideMenu()
+  void PopupHidden()
   {
-    if( mMenu )
+    if(mPopup)
     {
-      mMenu.Hide();
-      mMenu.Reset();
+      mPopup.Unparent();
+      mPopup.Reset();
     }
-
-    mMenuShown = false;
-  }
-
-  bool OnMenuSelect( Toolkit::Button button )
-  {
-    bool refresh = false;
-
-    if( button.GetName() == POPUPS_MENU_ID )
-    {
-      if( mDemoState != POPUP )
-      {
-        refresh = true;
-        mDemoState = POPUP;
-      }
-    }
-    else if( button.GetName() == TABLEVIEW_MENU_ID )
-    {
-      if( mDemoState != TABLEVIEW )
-      {
-        refresh = true;
-        mDemoState = TABLEVIEW;
-      }
-    }
-
-    if( refresh )
-    {
-      SetTitle();
-
-      mItemView.Refresh();
-    }
-
-    HideMenu();
-    return true;
   }
 
   Toolkit::Popup CreatePopup()
   {
-    Stage stage = Stage::GetCurrent();
-    const float POPUP_WIDTH_DP = stage.GetSize().width * 0.75f;
+    Window      window         = mApplication.GetWindow();
+    const float POPUP_WIDTH_DP = window.GetSize().GetWidth() * 0.75f;
 
     Toolkit::Popup popup = Toolkit::Popup::New();
-    popup.SetName( "POPUP" );
-    popup.SetParentOrigin( ParentOrigin::CENTER );
-    popup.SetAnchorPoint( AnchorPoint::CENTER );
-    popup.SetPreferredSize( Vector2( POPUP_WIDTH_DP, 0.0f ) );
-    popup.HideTail();
+    popup.SetProperty(Dali::Actor::Property::NAME, "popup");
+    popup.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+    popup.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+    popup.SetProperty(Actor::Property::SIZE, Vector2(POPUP_WIDTH_DP, 0.0f));
+    popup.SetProperty(Toolkit::Popup::Property::TAIL_VISIBILITY, false);
 
-    popup.OutsideTouchedSignal().Connect( this, &SizeNegotiationController::OnPopupOutsideTouched );
+    popup.OutsideTouchedSignal().Connect(this, &SizeNegotiationController::OnPopupOutsideTouched);
+    popup.HiddenSignal().Connect(this, &SizeNegotiationController::PopupHidden);
 
     return popup;
   }
 
-  bool OnButtonClicked( Toolkit::Button button )
+  bool OnButtonClicked(Toolkit::Button button)
   {
-    if( button.GetName() == POPUP_BUTTON_EMPTY_ID )
-    {
-      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 = CreatePopup();
-
-      Toolkit::PushButton okayButton = Toolkit::PushButton::New();
-      okayButton.SetName( OKAY_BUTTON_ID );
-      okayButton.SetLabel( "OK!" );
-      okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
-      okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
-      okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
-      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 = CreatePopup();
-
-      Toolkit::PushButton cancelButton = Toolkit::PushButton::New();
-      cancelButton.SetName( CANCEL_BUTTON_ID );
-      cancelButton.SetLabel( "Cancel" );
-      cancelButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
-      cancelButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
-      cancelButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
-      mPopup.AddButton( cancelButton );
-
-      Toolkit::PushButton okayButton = Toolkit::PushButton::New();
-      okayButton.SetName( OKAY_BUTTON_ID );
-      okayButton.SetLabel( "OK!" );
-      okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
-      okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
-      okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
-      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 = CreatePopup();
-      mPopup.SetTitle( "Popup!" );
-
-      Toolkit::PushButton cancelButton = Toolkit::PushButton::New();
-      cancelButton.SetName( CANCEL_BUTTON_ID );
-      cancelButton.SetLabel( "Cancel" );
-      cancelButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
-      cancelButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
-      cancelButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
-      mPopup.AddButton( cancelButton );
-
-      Toolkit::PushButton okayButton = Toolkit::PushButton::New();
-      okayButton.SetName( OKAY_BUTTON_ID );
-      okayButton.SetLabel( "OK!" );
-      okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
-      okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
-      okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
-      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();
-      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.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 )
-    {
-      mPopup = CreatePopup();
-
-      ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
-      image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      image.SetDimensionDependency( HEIGHT, WIDTH );
-      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.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
-
-      ImageActor image = ImageActor::New( ResourceImage::New( IMAGE2 ) );
-      image.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-
-      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.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 );
-
-      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.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 );
-
-      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 )
+    if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == TABLEVIEW_BUTTON_1CELL_ID)
     {
       mPopup = CreatePopup();
-      mPopup.SetTitle( "Popup!" );
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 0.5f, 1.0f));
 
-      Toolkit::TextView text = Toolkit::TextView::New();
-      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.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 20.0f ) );
+      Toolkit::TableView table = Toolkit::TableView::New(0, 0);
+      table.SetProperty(Dali::Actor::Property::NAME, "TABLEVIEW_BUTTON_1CELL_ID");
+      table.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
 
-      mPopup.Add( text );
+      Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+      backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      table.Add(backing);
 
-      // The popup is not yet on the stage so needs to be flaged as dirty
-      mPopup.MarkDirtyForRelayout();
+      mPopup.Add(table);
 
-      mPopup.Show();
+      ShowPopup(mPopup);
     }
-    else if( button.GetName() == POPUP_BUTTON_TITLE_CONTENT_TEXT_BUTTONS_ID )
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == TABLEVIEW_BUTTON_3CELL_ID)
     {
       mPopup = CreatePopup();
-      mPopup.SetTitle( "Popup!" );
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 0.5f, 1.0f));
 
-      Toolkit::TextView text = Toolkit::TextView::New();
-      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.SetPadding( Padding( 10.0f, 10.0f, 20.0f, 0.0f ) );
-
-      mPopup.Add( text );
-
-      Toolkit::PushButton cancelButton = Toolkit::PushButton::New();
-      cancelButton.SetName( CANCEL_BUTTON_ID );
-      cancelButton.SetLabel( "Cancel" );
-      cancelButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
-      cancelButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
-      cancelButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
-      mPopup.AddButton( cancelButton );
-
-      Toolkit::PushButton okayButton = Toolkit::PushButton::New();
-      okayButton.SetName( OKAY_BUTTON_ID );
-      okayButton.SetLabel( "OK!" );
-      okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
-      okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
-      okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
-      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 )
-    {
-      mPopup = CreatePopup();
-      mPopup.SetTitle( "Warning" );
-
-      // 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.SetFitHeight( 0 );
-      content.SetFitHeight( 1 );
-      content.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
-
-      // 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 );
-        text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        text.SetDimensionDependency( HEIGHT, WIDTH );
-
-        content.AddChild( text, Toolkit::TableView::CellPosition( 0, 0 ) );
-      }
-
-      // Image
-      {
-        ImageActor image = ImageActor::New( ResourceImage::New( IMAGE1 ) );
-        image.SetName( "COMPLEX_IMAGE" );
-        image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-        image.SetDimensionDependency( HEIGHT, WIDTH );
-        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.SetFitHeight( 0 );
-        root.SetFitWidth( 0 );
-        root.SetPadding( Padding( 0.0f, 0.0f, 0.0f, 20.0f ) );
-
-        Dali::Image unchecked = Dali::ResourceImage::New( CHECKBOX_UNCHECKED_IMAGE );
-        Dali::Image checked = Dali::ResourceImage::New( CHECKBOX_CHECKED_IMAGE );
-        Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New();
-        checkBox.SetBackgroundImage( unchecked );
-        checkBox.SetSelectedImage( checked );
-        checkBox.SetPreferredSize( Vector2( 48, 48 ) );
-        checkBox.SetResizePolicy( FIXED, ALL_DIMENSIONS );
-
-        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 );
-        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
-      }
-
-      mPopup.Add( content );
-
-      // Buttons
-      Toolkit::PushButton cancelButton = Toolkit::PushButton::New();
-      cancelButton.SetName( CANCEL_BUTTON_ID );
-      cancelButton.SetLabel( "Cancel" );
-      cancelButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
-      cancelButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
-      cancelButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
-      mPopup.AddButton( cancelButton );
-
-      Toolkit::PushButton okayButton = Toolkit::PushButton::New();
-      okayButton.SetName( OKAY_BUTTON_ID );
-      okayButton.SetLabel( "OK!" );
-      okayButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
-      okayButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
-      okayButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
-      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.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
-
-
-      Toolkit::TableView table = Toolkit::TableView::New( 0, 0 );
-      table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-
-      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.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 );
-
-      Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 0.0f, 0.0f, 1.0f ) );
-      backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      table.Add( backing );
-
-      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.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
-
-
-      Toolkit::TableView table = Toolkit::TableView::New( 0, 0 );
-      table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+      Toolkit::TableView table = Toolkit::TableView::New(3, 1);
+      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 );
-        table.Add( backing );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+        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 );
-        table.Add( backing );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 1.0f, 0.0f, 1.0f));
+        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 );
-        table.Add( backing );
+        Actor backing = CreateSolidColor(Vector4(0.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+        table.AddChild(backing, Toolkit::TableView::CellPosition(2, 0));
       }
 
-      mPopup.Add( table );
+      mPopup.SetContent(table);
 
-      // The popup is not yet on the stage so needs to be flaged as dirty
-      mPopup.MarkDirtyForRelayout();
-
-      mPopup.Show();
+      ShowPopup(mPopup);
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_3X3CELL_ID )
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == TABLEVIEW_BUTTON_3X3CELL_ID)
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
-
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 0.5f, 1.0f));
 
-      Toolkit::TableView table = Toolkit::TableView::New( 3, 3 );
-      table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+      Toolkit::TableView table = Toolkit::TableView::New(3, 3);
+      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 );
-        table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 0 ) );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+        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 );
-        table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 0 ) );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 1.0f, 0.0f, 1.0f));
+        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 );
-        table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 0 ) );
+        Actor backing = CreateSolidColor(Vector4(0.0f, 1.0f, 0.0f, 1.0f));
+        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 );
-        table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 1 ) );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 1.0f, 1.0f));
+        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 );
-        table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 1 ) );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 1.0f, 1.0f, 1.0f));
+        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 );
-        table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 1 ) );
+        Actor backing = CreateSolidColor(Vector4(0.0f, 0.0f, 1.0f, 1.0f));
+        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 );
-        table.AddChild( backing, Toolkit::TableView::CellPosition( 0, 2 ) );
+        Actor backing = CreateSolidColor(Vector4(0.0f, 0.0f, 0.0f, 1.0f));
+        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 );
-        table.AddChild( backing, Toolkit::TableView::CellPosition( 1, 2 ) );
+        Actor backing = CreateSolidColor(Vector4(0.5f, 0.5f, 0.5f, 1.0f));
+        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 );
-        table.AddChild( backing, Toolkit::TableView::CellPosition( 2, 2 ) );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.5f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+        table.AddChild(backing, Toolkit::TableView::CellPosition(2, 2));
       }
 
-      mPopup.Add( table );
+      mPopup.Add(table);
 
-      // The popup is not yet on the stage so needs to be flaged as dirty
-      mPopup.MarkDirtyForRelayout();
-
-      mPopup.Show();
+      ShowPopup(mPopup);
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_FIXED1_ID )
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == TABLEVIEW_BUTTON_FIXED1_ID)
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
-
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 0.5f, 1.0f));
 
-      Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
-      table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      table.SetFixedHeight( 0, 50.0f );
+      Toolkit::TableView table = Toolkit::TableView::New(3, 1);
+      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 );
-        TextActor text = TextActor::New( "Fixed" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
-        table.Add( backing );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fixed");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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);
+        table.Add(backing);
       }
       {
-        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" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
-        table.Add( backing );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fill");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        text.SetProperty(Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER");
+        text.SetProperty(Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER");
+        backing.Add(text);
+        table.Add(backing);
       }
       {
-        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" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
-        table.Add( backing );
+        Actor backing = CreateSolidColor(Vector4(0.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fill");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        text.SetProperty(Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER");
+        text.SetProperty(Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER");
+        backing.Add(text);
+        table.Add(backing);
       }
 
-      mPopup.Add( table );
-
-      // The popup is not yet on the stage so needs to be flaged as dirty
-      mPopup.MarkDirtyForRelayout();
+      mPopup.Add(table);
 
-      mPopup.Show();
+      ShowPopup(mPopup);
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_FIXED2_ID )
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == TABLEVIEW_BUTTON_FIXED2_ID)
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 0.5f, 1.0f));
 
-
-      Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
-      table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      table.SetFixedHeight( 0, 50.0f );
-      table.SetFixedHeight( 2, 50.0f );
+      Toolkit::TableView table = Toolkit::TableView::New(3, 1);
+      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 );
-        TextActor text = TextActor::New( "Fixed" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
-        table.Add( backing );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fixed");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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);
+        table.Add(backing);
       }
       {
-        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" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
-        table.Add( backing );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fill");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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);
+        table.Add(backing);
       }
       {
-        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" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
-        table.Add( backing );
-      }
+        Actor backing = CreateSolidColor(Vector4(0.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fixed");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-      mPopup.Add( table );
+        backing.Add(text);
+        table.Add(backing);
+      }
 
-      // The popup is not yet on the stage so needs to be flaged as dirty
-      mPopup.MarkDirtyForRelayout();
+      mPopup.Add(table);
 
-      mPopup.Show();
+      ShowPopup(mPopup);
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_FIT1_ID )
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == TABLEVIEW_BUTTON_FIT1_ID)
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
-
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 0.5f, 1.0f));
 
-      Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
-      table.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      table.SetFitHeight( 0 );
-      table.SetFitHeight( 2 );
+      Toolkit::TableView table = Toolkit::TableView::New(3, 1);
+      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( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+        backing.SetProperty(Actor::Property::SIZE, Vector2(0.0f, 100.0f));
 
-        TextActor text = TextActor::New( "Fit" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fit");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        table.Add( backing );
+        backing.Add(text);
+
+        table.Add(backing);
       }
       {
-        Actor backing = Toolkit::CreateSolidColorActor( Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
-        backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fill");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        TextActor text = TextActor::New( "Fill" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        backing.Add(text);
 
-        table.Add( backing );
+        table.Add(backing);
       }
       {
-        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 ) );
+        Actor backing = CreateSolidColor(Vector4(0.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+        backing.SetProperty(Actor::Property::SIZE, Vector2(0.0f, 100.0f));
 
-        TextActor text = TextActor::New( "Fit" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fit");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        table.Add( backing );
-      }
+        backing.Add(text);
 
-      mPopup.Add( table );
+        table.Add(backing);
+      }
 
-      // The popup is not yet on the stage so needs to be flaged as dirty
-      mPopup.MarkDirtyForRelayout();
+      mPopup.Add(table);
 
-      mPopup.Show();
+      ShowPopup(mPopup);
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_FIT2_ID )
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == TABLEVIEW_BUTTON_FIT2_ID)
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 0.5f, 1.0f ) );
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, 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 );
+      Toolkit::TableView table = Toolkit::TableView::New(3, 1);
+      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 );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fill");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        TextActor text = TextActor::New( "Fill" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        backing.Add(text);
 
-        table.Add( backing );
+        table.Add(backing);
       }
       {
-        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 ) );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+        backing.SetProperty(Actor::Property::SIZE, Vector2(0.0f, 200.0f));
 
-        TextActor text = TextActor::New( "Fit" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fit");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        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");
 
-        table.Add( backing );
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        backing.Add(text);
+
+        table.Add(backing);
       }
       {
-        Actor backing = Toolkit::CreateSolidColorActor( Vector4( 0.0f, 1.0f, 0.0f, 1.0f ) );
-        backing.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+        Actor backing = CreateSolidColor(Vector4(0.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
 
-        TextActor text = TextActor::New( "Fill" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fill");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        table.Add( backing );
-      }
+        backing.Add(text);
 
-      mPopup.Add( table );
+        table.Add(backing);
+      }
 
-      // The popup is not yet on the stage so needs to be flaged as dirty
-      mPopup.MarkDirtyForRelayout();
+      mPopup.Add(table);
 
-      mPopup.Show();
+      ShowPopup(mPopup);
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL1_ID )
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == TABLEVIEW_BUTTON_NATURAL1_ID)
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
-      mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
-
-      Toolkit::TableView table = Toolkit::TableView::New( 3, 1 );
-      table.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      table.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
-      table.SetFitHeight( 0 );
-      table.SetFitHeight( 1 );
-      table.SetFitHeight( 2 );
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 1.0f, 1.0f));
+      mPopup.SetResizePolicy(ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT);
+
+      Toolkit::TableView table = Toolkit::TableView::New(3, 1);
+      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( FIXED, HEIGHT );
-        backing.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+        backing.SetProperty(Actor::Property::SIZE, Vector2(0.0f, 100.0f));
+
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fit");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        TextActor text = TextActor::New( "Fit" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        backing.Add(text);
 
-        table.Add( backing );
+        table.Add(backing);
       }
       {
-        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 ) );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+        backing.SetProperty(Actor::Property::SIZE, Vector2(0.0f, 200.0f));
 
-        TextActor text = TextActor::New( "Fit" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fit");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        table.Add( backing );
+        backing.Add(text);
+
+        table.Add(backing);
       }
       {
-        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 ) );
+        Actor backing = CreateSolidColor(Vector4(0.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+        backing.SetProperty(Actor::Property::SIZE, Vector2(0.0f, 300.0f));
 
-        TextActor text = TextActor::New( "Fit" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fit");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        table.Add( backing );
-      }
+        backing.Add(text);
 
-      mPopup.Add( table );
+        table.Add(backing);
+      }
 
-      // The popup is not yet on the stage so needs to be flaged as dirty
-      mPopup.MarkDirtyForRelayout();
+      mPopup.Add(table);
 
-      mPopup.Show();
+      ShowPopup(mPopup);
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL2_ID )
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == TABLEVIEW_BUTTON_NATURAL2_ID)
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
-      mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 1.0f, 1.0f));
+      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.SetFitHeight( 0 );
-      table.SetFitHeight( 1 );
+      Toolkit::TableView table = Toolkit::TableView::New(3, 1);
+      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.SetPreferredSize( Vector2( 0.0f, 100.0f ) );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+        backing.SetResizePolicy(ResizePolicy::FIXED, Dimension::HEIGHT);
+        backing.SetProperty(Actor::Property::SIZE, Vector2(0.0f, 100.0f));
+
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fit");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        TextActor text = TextActor::New( "Fit" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        backing.Add(text);
 
-        table.Add( backing );
+        table.Add(backing);
       }
       {
-        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 ) );
+        Actor backing = CreateSolidColor(Vector4(0.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+        backing.SetProperty(Actor::Property::SIZE, Vector2(0.0f, 200.0f));
 
-        TextActor text = TextActor::New( "Fit" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fit");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        table.Add( backing );
-      }
+        backing.Add(text);
 
-      mPopup.Add( table );
+        table.Add(backing);
+      }
 
-      // The popup is not yet on the stage so needs to be flaged as dirty
-      mPopup.MarkDirtyForRelayout();
+      mPopup.Add(table);
 
-      mPopup.Show();
+      ShowPopup(mPopup);
     }
-    else if( button.GetName() == TABLEVIEW_BUTTON_NATURAL3_ID )
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == TABLEVIEW_BUTTON_NATURAL3_ID)
     {
       mPopup = CreatePopup();
-      mPopup.SetResizePolicy( FILL_TO_PARENT, WIDTH );
-      mPopup.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
-      mPopup.SetSizeModeFactor( Vector3( 0.75f, 1.0f, 1.0f ) );
-      mPopup.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::WIDTH);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 1.0f, 1.0f));
+      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.SetFixedHeight( 0, 20.0f );
-      table.SetFitHeight( 1 );
+      Toolkit::TableView table = Toolkit::TableView::New(3, 1);
+      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 );
+        Actor backing = CreateSolidColor(Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
 
-        TextActor text = TextActor::New( "Fixed" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fixed");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        table.Add( backing );
+        backing.Add(text);
+
+        table.Add(backing);
       }
       {
-        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 ) );
+        Actor backing = CreateSolidColor(Vector4(0.0f, 1.0f, 0.0f, 1.0f));
+        backing.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH);
+        backing.SetProperty(Actor::Property::SIZE, Vector2(0.0f, 200.0f));
+
+        Toolkit::TextLabel text = Toolkit::TextLabel::New("Fit");
+        text.SetProperty(Toolkit::TextLabel::Property::TEXT_COLOR, Color::WHITE);
+        text.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
+        text.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
+        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");
 
-        TextActor text = TextActor::New( "Fit" );
-        text.SetAnchorPoint( AnchorPoint::CENTER );
-        text.SetParentOrigin( ParentOrigin::CENTER );
-        backing.Add( text );
+        backing.Add(text);
 
-        table.Add( backing );
+        table.Add(backing);
       }
+      mPopup.Add(table);
 
-      mPopup.Add( table );
+      ShowPopup(mPopup);
+    }
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == POPUP_BUTTON_CONTENT_IMAGE_SCALE_ID)
+    {
+      mPopup = CreatePopup();
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 0.5f, 1.0f));
 
-      // The popup is not yet on the stage so needs to be flaged as dirty
-      mPopup.MarkDirtyForRelayout();
+      Toolkit::ImageView image = Toolkit::ImageView::New(IMAGE);
+      image.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
 
-      mPopup.Show();
+      mPopup.Add(image);
+
+      ShowPopup(mPopup);
     }
-    else if( button.GetName() == OKAY_BUTTON_ID || button.GetName() == CANCEL_BUTTON_ID )
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == POPUP_BUTTON_CONTENT_IMAGE_FIT_ID)
     {
-      if( mPopup )
-      {
-        mPopup.Hide();
-      }
-    }
+      mPopup = CreatePopup();
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 0.5f, 1.0f));
 
-    return true;
-  }
+      Toolkit::ImageView image = Toolkit::ImageView::New(IMAGE);
+      image.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      image.SetProperty(Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FIT_WITH_ASPECT_RATIO);
 
-  void OnPopupOutsideTouched()
-  {
-    if( mPopup )
+      mPopup.Add(image);
+
+      ShowPopup(mPopup);
+    }
+    else if(button.GetProperty<std::string>(Dali::Actor::Property::NAME) == POPUP_BUTTON_CONTENT_IMAGE_FILL_ID)
     {
-      mPopup.Hide();
+      mPopup = CreatePopup();
+      mPopup.SetResizePolicy(ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      mPopup.SetProperty(Actor::Property::SIZE_MODE_FACTOR, Vector3(0.75f, 0.5f, 1.0f));
+
+      Toolkit::ImageView image = Toolkit::ImageView::New(IMAGE);
+      image.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
+      image.SetProperty(Actor::Property::SIZE_SCALE_POLICY, SizeScalePolicy::FILL_WITH_ASPECT_RATIO);
+
+      mPopup.Add(image);
+
+      ShowPopup(mPopup);
     }
+
+    return true;
   }
 
-  void OnKeyEvent( const KeyEvent& event )
+  void OnKeyEvent(const KeyEvent& event)
   {
-    if( event.state == KeyEvent::Down )
+    if(event.GetState() == KeyEvent::DOWN)
     {
-      if( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+      if(IsKey(event, Dali::DALI_KEY_ESCAPE) || IsKey(event, Dali::DALI_KEY_BACK))
       {
         // Exit application when click back or escape.
         mApplication.Quit();
@@ -1226,7 +772,6 @@ public:
   }
 
 public: // From ItemFactory
-
   /**
    * @brief Return the number of items to display in the item view
    *
@@ -1234,25 +779,7 @@ public: // From ItemFactory
    */
   virtual unsigned int GetNumberOfItems()
   {
-    switch( mDemoState )
-    {
-      case POPUP:
-      {
-        return POPUP_BUTTON_ITEMS_COUNT;
-      }
-
-      case TABLEVIEW:
-      {
-        return TABLEVIEW_BUTTON_ITEMS_COUNT;
-      }
-
-      default:
-      {
-        break;
-      }
-    }
-
-    return 0;
+    return TABLEVIEW_BUTTON_ITEMS_COUNT;
   }
 
   /**
@@ -1263,84 +790,33 @@ public: // From ItemFactory
    */
   virtual Actor NewItem(unsigned int itemId)
   {
-    const ButtonItem* buttonDataArray = NULL;
-    switch( mDemoState )
-    {
-      case POPUP:
-      {
-        buttonDataArray = POPUP_BUTTON_ITEMS;
-        break;
-      }
+    Toolkit::PushButton popupButton = Toolkit::PushButton::New();
+    popupButton.SetProperty(Dali::Actor::Property::NAME, TABLEVIEW_BUTTON_ITEMS[itemId].name);
+    popupButton.SetProperty(Toolkit::Button::Property::LABEL, TABLEVIEW_BUTTON_ITEMS[itemId].text);
+    popupButton.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
 
-      case TABLEVIEW:
-      {
-        buttonDataArray = TABLEVIEW_BUTTON_ITEMS;
-        break;
-      }
+    popupButton.ClickedSignal().Connect(this, &SizeNegotiationController::OnButtonClicked);
 
-      default:
-      {
-        break;
-      }
-    }
-
-    if( buttonDataArray )
-    {
-      Toolkit::PushButton popupButton = Toolkit::PushButton::New();
-      popupButton.SetName( buttonDataArray[ itemId ].name );
-      popupButton.SetLabel( buttonDataArray[ itemId ].text );
-      popupButton.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
-
-      popupButton.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
-      popupButton.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
-
-      popupButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
-
-      return popupButton;
-    }
-
-    return Actor();
+    return popupButton;
   }
 
 private:
+  Application&     mApplication;
+  Toolkit::Control mView;         ///< The View instance.
+  Toolkit::ToolBar mToolBar;      ///< The View's Toolbar.
+  Layer            mContentLayer; ///< Content layer.
 
-  enum DemoState
-  {
-    POPUP,
-    TABLEVIEW
-  };
-
-  Application&      mApplication;
-  Toolkit::View     mView;                   ///< The View instance.
-  Toolkit::ToolBar  mToolBar;                ///< The View's Toolbar.
-  Layer             mContentLayer;           ///< Content layer
-
-  Toolkit::TextView mTitleActor;             ///< Title text
-
-  Toolkit::Popup    mMenu;                   ///< The navigation menu
-  bool              mMenuShown;              ///< If the navigation menu is currently being displayed or not
+  Toolkit::TextLabel mTitleActor; ///< Title text.
+  Toolkit::Popup     mMenu;       ///< The navigation menu.
+  Toolkit::Popup     mPopup;      ///< The current example popup.
 
-  Toolkit::Popup    mPopup;
-
-  Toolkit::ItemView mItemView;               ///< ItemView to hold test images
-
-  DemoState mDemoState;
+  Toolkit::ItemView mItemView; ///< ItemView to hold test images.
 };
 
-void RunTest( Application& application )
+int DALI_EXPORT_API main(int argc, char** argv)
 {
-  SizeNegotiationController test( application );
-
+  Application               application = Application::New(&argc, &argv, DEMO_THEME_PATH);
+  SizeNegotiationController test(application);
   application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
-//
-int main( int argc, char **argv )
-{
-  Application application = Application::New( &argc, &argv );
-
-  RunTest( application );
-
   return 0;
 }