X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fsimple-bitmap-font-text-label%2Fsimple-text-label-example.cpp;h=a7f6ff0f66de9a28fc1859bb5d8ff5606487953f;hb=4f818cd12c9bf2773d44e5cfdc2fc0a344abf7f5;hp=04ad1fb8fa3198f4628e5af3502ef508a99fd3b6;hpb=be83fef014e0a705b499dbba21da1f996a40241e;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/simple-bitmap-font-text-label/simple-text-label-example.cpp b/examples/simple-bitmap-font-text-label/simple-text-label-example.cpp index 04ad1fb..a7f6ff0 100644 --- a/examples/simple-bitmap-font-text-label/simple-text-label-example.cpp +++ b/examples/simple-bitmap-font-text-label/simple-text-label-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. @@ -54,9 +54,9 @@ public: */ void Create( Application& application ) { - Stage stage = Stage::GetCurrent(); + Window window = application.GetWindow(); - stage.KeyEventSignal().Connect(this, &SimpleTextLabelExample::OnKeyEvent); + window.KeyEventSignal().Connect(this, &SimpleTextLabelExample::OnKeyEvent); TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get(); @@ -106,10 +106,10 @@ public: fontClient.GetFontId( bitmapColorFont ); TextLabel label01 = TextLabel::New(); - label01.SetAnchorPoint( AnchorPoint::CENTER ); - label01.SetParentOrigin( ParentOrigin::CENTER ); - label01.SetSize( 400.f, 50.f ); - label01.SetPosition( 0.f, -100.f ); + label01.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + label01.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + label01.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 50.f ) ); + label01.SetProperty( Actor::Property::POSITION, Vector2( 0.f, -100.f )); label01.SetProperty( TextLabel::Property::MULTI_LINE, true ); label01.SetProperty( TextLabel::Property::ENABLE_MARKUP, true ); @@ -119,14 +119,14 @@ public: label01.SetBackgroundColor( Color::BLACK ); - stage.Add( label01 ); + window.Add( label01 ); TextLabel label02 = TextLabel::New(); - label02.SetAnchorPoint( AnchorPoint::CENTER ); - label02.SetParentOrigin( ParentOrigin::CENTER ); - label02.SetSize( 400.f, 50.f ); - label02.SetPosition( 0.f, -50.f ); + label02.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + label02.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + label02.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 50.f ) ); + label02.SetProperty( Actor::Property::POSITION, Vector2( 0.f, -50.f )); label02.SetProperty( TextLabel::Property::MULTI_LINE, true ); label02.SetProperty( TextLabel::Property::TEXT, "0123456789:" ); @@ -135,13 +135,13 @@ public: label02.SetBackgroundColor( Color::BLACK ); - stage.Add( label02 ); + window.Add( label02 ); TextLabel label03 = TextLabel::New(); - label03.SetAnchorPoint( AnchorPoint::CENTER ); - label03.SetParentOrigin( ParentOrigin::CENTER ); - label03.SetSize( 400.f, 50.f ); - label03.SetPosition( 0.f, 0.f ); + label03.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + label03.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + label03.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 50.f ) ); + label03.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); label03.SetProperty( TextLabel::Property::MULTI_LINE, true ); label03.SetProperty( TextLabel::Property::TEXT, "0123456789:" ); @@ -149,13 +149,13 @@ public: label03.SetBackgroundColor( Color::WHITE ); - stage.Add( label03 ); + window.Add( label03 ); TextLabel label04 = TextLabel::New(); - label04.SetAnchorPoint( AnchorPoint::CENTER ); - label04.SetParentOrigin( ParentOrigin::CENTER ); - label04.SetSize( 400.f, 50.f ); - label04.SetPosition( 0.f, 50.f ); + label04.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + label04.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + label04.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 50.f ) ); + label04.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 50.f )); label04.SetProperty( TextLabel::Property::MULTI_LINE, true ); label04.SetProperty( TextLabel::Property::TEXT, "0123456789:" ); @@ -164,7 +164,7 @@ public: label04.SetBackgroundColor( Color::BLACK ); - stage.Add( label04 ); + window.Add( label04 ); } /** @@ -172,7 +172,7 @@ public: */ 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 ) ) { @@ -194,7 +194,7 @@ void RunTest( Application& application ) } /** Entry point for Linux & Tizen applications */ -int main( int argc, char **argv ) +int DALI_EXPORT_API main( int argc, char **argv ) { Application application = Application::New( &argc, &argv );