X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fvisual-fitting-mode%2Fvisual-fitting-mode-example.cpp;h=b9ca324ab996ad7f50426989353d73575b28d268;hb=c70446e9b125ae8bb236b4cbc3fd3f8b548459cd;hp=7873d32ef6633529aa072a2d70f1019086c3da4c;hpb=888de069f8cb0dd95e90994474c488cfd8f5bbb0;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/visual-fitting-mode/visual-fitting-mode-example.cpp b/examples/visual-fitting-mode/visual-fitting-mode-example.cpp index 7873d32..b9ca324 100644 --- a/examples/visual-fitting-mode/visual-fitting-mode-example.cpp +++ b/examples/visual-fitting-mode/visual-fitting-mode-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 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. @@ -116,13 +116,13 @@ private: */ void Create( Application& application ) { - // Get a handle to the stage - Stage stage = Stage::GetCurrent(); - stage.SetBackgroundColor( Color::WHITE ); + // Get a handle to the window + Window window = application.GetWindow(); + window.SetBackgroundColor( Color::WHITE ); // Text Label filling the entire screen, with a background - mTextLabel = DevelHandle::New< TextLabel >( TEXT_LABEL_PROPERTIES ); - stage.Add( mTextLabel ); + mTextLabel = Handle::New< TextLabel >( TEXT_LABEL_PROPERTIES ); + window.Add( mTextLabel ); // We want to change the padding when tapping mTapDetector = TapGestureDetector::New(); @@ -131,11 +131,11 @@ private: // Create an ImageView with the default behaviour, i.e. image fills to control size mFillImage = ImageView::New( IMAGE_NAME ); - DevelHandle::SetProperties( mFillImage, FILL_IMAGE_PROPERTIES ); - stage.Add( mFillImage ); + mFillImage.SetProperties( FILL_IMAGE_PROPERTIES ); + window.Add( mFillImage ); // Create an ImageView that Keeps the aspect ratio while fitting within the given size - mFitKeepAspectRatioImage = DevelHandle::New< ImageView >( FIT_KEEP_ASPECT_RATIO_IMAGE_BASIC_PROPERTIES ); + mFitKeepAspectRatioImage = Handle::New< ImageView >( FIT_KEEP_ASPECT_RATIO_IMAGE_BASIC_PROPERTIES ); mFitKeepAspectRatioImage.SetProperty( ImageView::Property::IMAGE, Property::Map { @@ -143,22 +143,22 @@ private: { ImageVisual::Property::URL, IMAGE_NAME }, { DevelVisual::Property::VISUAL_FITTING_MODE, DevelVisual::FIT_KEEP_ASPECT_RATIO } } ); - stage.Add( mFitKeepAspectRatioImage ); + window.Add( mFitKeepAspectRatioImage ); // Create an overlay label for fill image Actor fillLabel = TextLabel::New( FILL_LABEL ); - DevelHandle::SetProperties( fillLabel, FILL_IMAGE_PROPERTIES ); - DevelHandle::SetProperties( fillLabel, OVERLAY_LABEL_PROPERTIES ); - stage.Add( fillLabel ); + fillLabel.SetProperties( FILL_IMAGE_PROPERTIES ); + fillLabel.SetProperties( OVERLAY_LABEL_PROPERTIES ); + window.Add( fillLabel ); // Create an overlay label for the Fit/Keep Aspect image Actor fitLabel = TextLabel::New( FIT_KEEP_ASPECT_LABEL ); - DevelHandle::SetProperties( fitLabel, FIT_KEEP_ASPECT_RATIO_IMAGE_BASIC_PROPERTIES ); - DevelHandle::SetProperties( fitLabel, OVERLAY_LABEL_PROPERTIES ); - stage.Add( fitLabel ); + fitLabel.SetProperties( FIT_KEEP_ASPECT_RATIO_IMAGE_BASIC_PROPERTIES ); + fitLabel.SetProperties( OVERLAY_LABEL_PROPERTIES ); + window.Add( fitLabel ); // Respond to key events, exit if ESC/Back, change the padding if anything else - stage.KeyEventSignal().Connect( this, &VisualFittingModeController::OnKeyEvent ); + window.KeyEventSignal().Connect( this, &VisualFittingModeController::OnKeyEvent ); // Set the initial padding ChangePadding(); @@ -197,7 +197,7 @@ private: */ 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 ) ) {