X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Ffocus-integration%2Ffocus-integration.cpp;h=6f9dad57b8a58c95b6831d86b6ff0b03daf043ff;hb=e3080a83ec85e14ec8cbf82831fd73b152c6e86a;hp=c439e17c49e8cc60300724c11bf663b6e8bf23a2;hpb=437340fcbd1432fae7c7d9af926e41631ad5a407;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/focus-integration/focus-integration.cpp b/examples/focus-integration/focus-integration.cpp index c439e17..6f9dad5 100644 --- a/examples/focus-integration/focus-integration.cpp +++ b/examples/focus-integration/focus-integration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 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. @@ -53,7 +53,8 @@ public: void Create( Application& application ) { - mStage = Stage::GetCurrent(); + mWindow = application.GetWindow(); + Vector2 windowSize = mWindow.GetSize(); mContentLayer = DemoHelper::CreateView( application, mView, mToolBar, @@ -78,7 +79,7 @@ public: // Create label to display which control's KeyEvent callback is called mEventLabel = TextLabel::New("Controls don't get KeyEvent yet"); - mEventLabel.SetProperty( Actor::Property::SIZE, Vector2( mStage.GetSize().width, mStage.GetSize().height*0.1f ) ); + mEventLabel.SetProperty( Actor::Property::SIZE, Vector2( windowSize.width, windowSize.height*0.1f ) ); mEventLabel.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH); mEventLabel.SetProperty( TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" ); mEventLabel.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); @@ -86,7 +87,7 @@ public: contentTable.Add( mEventLabel ); mContainer = TableView::New( 4, 3 ); - mContainer.SetProperty( Actor::Property::SIZE, Vector2( mStage.GetSize().width, mStage.GetSize().height*0.4f ) ); + mContainer.SetProperty( Actor::Property::SIZE, Vector2( windowSize.width, windowSize.height*0.4f ) ); mContainer.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH); mContainer.SetBackgroundColor( BACKGROUND_COLOUR ); mContainer.SetCellPadding( Size( MARGIN_SIZE, MARGIN_SIZE ) ); @@ -144,7 +145,7 @@ public: KeyboardFocusManager::Get().PreFocusChangeSignal().Connect( this, &FocusIntegrationExample::OnPreFocusChange ); // Respond to key events - mStage.KeyEventSignal().Connect( this, &FocusIntegrationExample::OnKeyEvent ); + mWindow.KeyEventSignal().Connect( this, &FocusIntegrationExample::OnKeyEvent ); } // Callback for KeyboardFocusManager @@ -174,7 +175,7 @@ private: */ void OnKeyEvent(const KeyEvent& event) { - if(event.state == KeyEvent::Down) + if(event.GetState() == KeyEvent::DOWN) { if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) ) { @@ -186,7 +187,7 @@ private: private: Application& mApplication; - Stage mStage; + Window mWindow; TableView mContainer; TextLabel mEventLabel; Toolkit::Control mView; ///< The View instance.