2 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 * @file text-label-example.cpp
20 * @brief Basic usage of TextLabel control
24 #include <dali-toolkit/dali-toolkit.h>
25 #include <dali/public-api/text-abstraction/text-abstraction.h>
28 using namespace Dali::Toolkit;
31 * @brief The main class of the demo.
33 class TextLabelExample : public ConnectionTracker
37 TextLabelExample( Application& application )
38 : mApplication( application )
40 // Connect to the Application's Init signal
41 mApplication.InitSignal().Connect( this, &TextLabelExample::Create );
46 // Nothing to do here.
50 * One-time setup in response to Application InitSignal.
52 void Create( Application& application )
54 Stage stage = Stage::GetCurrent();
56 TextLabel label = TextLabel::New();
57 label.SetParentOrigin( ParentOrigin::CENTER );
60 label.SetProperty( TextLabel::PROPERTY_MULTI_LINE, true );
62 label.SetProperty( TextLabel::PROPERTY_TEXT, "A Quick Brown Fox Jumps Over The Lazy Dog" );
65 //Property::Value labelText = label.GetProperty( TextLabel::PROPERTY_TEXT );
66 //std::cout << "Got text from label: " << labelText.Get< std::string >() << std::endl;
71 Application& mApplication;
74 void RunTest( Application& application )
76 TextLabelExample test( application );
78 application.MainLoop();
81 /** Entry point for Linux & Tizen applications */
82 int main( int argc, char **argv )
84 Application application = Application::New( &argc, &argv );
86 RunTest( application );