Removed redundant RunTest methods from all examples
[platform/core/uifw/dali-demo.git] / examples / size-negotiation / size-negotiation-example.cpp
index ba6becd..4856360 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -19,6 +19,7 @@
 #include <dali/dali.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/popup/popup.h>
+#include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
 
 using namespace Dali;
 
@@ -112,7 +113,7 @@ public:
     // The Init signal is received once (only) during the Application lifetime
     Stage stage = Stage::GetCurrent();
 
-    // Respond to key events
+    // Respond to key events if not handled
     stage.KeyEventSignal().Connect(this, &SizeNegotiationController::OnKeyEvent);
 
     // Creates a default view with a default tool bar.
@@ -795,7 +796,7 @@ public: // From ItemFactory
   {
     Toolkit::PushButton popupButton = Toolkit::PushButton::New();
     popupButton.SetName( TABLEVIEW_BUTTON_ITEMS[ itemId ].name );
-    popupButton.SetLabelText( TABLEVIEW_BUTTON_ITEMS[ itemId ].text );
+    popupButton.SetProperty( Toolkit::Button::Property::LABEL, TABLEVIEW_BUTTON_ITEMS[ itemId ].text );
     popupButton.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 
     popupButton.ClickedSignal().Connect( this, &SizeNegotiationController::OnButtonClicked );
@@ -818,19 +819,10 @@ private:
 
 };
 
-void RunTest( Application& application )
-{
-  SizeNegotiationController test( application );
-
-  application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
 int DALI_EXPORT_API main( int argc, char **argv )
 {
   Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
-  RunTest( application );
-
+  SizeNegotiationController test( application );
+  application.MainLoop();
   return 0;
 }