X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=docs%2Fcontent%2Fexample-code%2Fproperties.cpp;h=61be376150f711d2a35f102a11f457f247353491;hb=e4a3c7b18f3a6168ec3967d4881663f7ed54f8d5;hp=08d764f46c6235f2a0d0cd5bec89d0b46f05b473;hpb=146486a8c7410a2f2a20a6d670145fe855672b96;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/docs/content/example-code/properties.cpp b/docs/content/example-code/properties.cpp index 08d764f..61be376 100644 --- a/docs/content/example-code/properties.cpp +++ b/docs/content/example-code/properties.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 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. @@ -56,8 +56,8 @@ public: // C++ EXAMPLE void Create( Application& application ) { - // Get the stage handle - Stage stage = Stage::GetCurrent(); + // Get the window handle + Window window = application.GetWindow(); mImageView = ImageView::New(); @@ -72,22 +72,22 @@ public: imageMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 100; mImageView.SetProperty( ImageView::Property::IMAGE, imageMap ); - // Add the image view to the stage - stage.Add( mImageView ); + // Add the image view to the window + window.Add( mImageView ); // Register a custom float property on mImageView and use it to store the number of times we are tapped mTagPropertyIndex = mImageView.RegisterProperty( TAG_PROPERTY_NAME, 0, Property::READ_WRITE /* Event-side only, i.e. not animatable */ ); // Connect to the touch-event - mImageView.TouchSignal().Connect( this, &PropertyController::OnTouched ); + mImageView.TouchedSignal().Connect( this, &PropertyController::OnTouched ); // Create text label mTagText = Toolkit::TextLabel::New( "0" ); - mTagText.SetParentOrigin( ParentOrigin::BOTTOM_CENTER ); - mTagText.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER ); + mTagText.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER ); + mTagText.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER ); mTagText.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE ); mTagText.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" ); - stage.Add( mTagText ); + window.Add( mTagText ); } /** @@ -95,7 +95,7 @@ public: * param[in] touch The touch-event * return Set to true if the signal was consumed correctly */ - bool OnTouched( Actor actor, const TouchData& touch ) + bool OnTouched( Actor actor, const TouchEvent& touch ) { int touchedCount = 0; @@ -113,7 +113,7 @@ public: valueText << touchedCount; mTagText.SetProperty( TextLabel::Property::TEXT, valueText.str() ); - return true; // Consumed + return true; // Consumed meaning any gestures will be cancelled } // C++ EXAMPLE END