2 * Copyright (c) 2017 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 #include <dali-toolkit/internal/controls/text-controls/text-label-impl.h>
22 #include <dali/public-api/object/type-registry-helper.h>
23 #include <dali/integration-api/debug.h>
26 #include <dali-toolkit/public-api/text/rendering-backend.h>
27 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
28 #include <dali-toolkit/internal/text/property-string-parser.h>
29 #include <dali-toolkit/internal/text/rendering/text-backend.h>
30 #include <dali-toolkit/internal/text/text-effects-style.h>
31 #include <dali-toolkit/internal/text/text-font-style.h>
32 #include <dali-toolkit/internal/text/text-view.h>
33 #include <dali-toolkit/internal/text/text-definitions.h>
34 #include <dali-toolkit/internal/styling/style-manager-impl.h>
36 using namespace Dali::Toolkit::Text;
49 const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
55 #if defined ( DEBUG_ENABLED )
56 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT_CONTROLS");
59 const Scripting::StringEnum HORIZONTAL_ALIGNMENT_STRING_TABLE[] =
61 { "BEGIN", Toolkit::Text::Layout::HORIZONTAL_ALIGN_BEGIN },
62 { "CENTER", Toolkit::Text::Layout::HORIZONTAL_ALIGN_CENTER },
63 { "END", Toolkit::Text::Layout::HORIZONTAL_ALIGN_END },
65 const unsigned int HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT = sizeof( HORIZONTAL_ALIGNMENT_STRING_TABLE ) / sizeof( HORIZONTAL_ALIGNMENT_STRING_TABLE[0] );
67 const Scripting::StringEnum VERTICAL_ALIGNMENT_STRING_TABLE[] =
69 { "TOP", Toolkit::Text::Layout::VERTICAL_ALIGN_TOP },
70 { "CENTER", Toolkit::Text::Layout::VERTICAL_ALIGN_CENTER },
71 { "BOTTOM", Toolkit::Text::Layout::VERTICAL_ALIGN_BOTTOM },
73 const unsigned int VERTICAL_ALIGNMENT_STRING_TABLE_COUNT = sizeof( VERTICAL_ALIGNMENT_STRING_TABLE ) / sizeof( VERTICAL_ALIGNMENT_STRING_TABLE[0] );
78 return Toolkit::TextLabel::New();
81 // Setup properties, signals and actions using the type-registry.
82 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextLabel, Toolkit::Control, Create );
84 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "renderingBackend", INTEGER, RENDERING_BACKEND )
85 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text", STRING, TEXT )
86 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontFamily", STRING, FONT_FAMILY )
87 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle", MAP, FONT_STYLE )
88 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pointSize", FLOAT, POINT_SIZE )
89 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "multiLine", BOOLEAN, MULTI_LINE )
90 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "horizontalAlignment", STRING, HORIZONTAL_ALIGNMENT )
91 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "verticalAlignment", STRING, VERTICAL_ALIGNMENT )
92 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "textColor", VECTOR4, TEXT_COLOR )
93 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowOffset", VECTOR2, SHADOW_OFFSET )
94 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowColor", VECTOR4, SHADOW_COLOR )
95 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineEnabled", BOOLEAN, UNDERLINE_ENABLED )
96 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineColor", VECTOR4, UNDERLINE_COLOR )
97 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineHeight", FLOAT, UNDERLINE_HEIGHT )
98 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableMarkup", BOOLEAN, ENABLE_MARKUP )
99 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableAutoScroll", BOOLEAN, ENABLE_AUTO_SCROLL )
100 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollSpeed", INTEGER, AUTO_SCROLL_SPEED )
101 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopCount", INTEGER, AUTO_SCROLL_LOOP_COUNT )
102 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollGap", FLOAT, AUTO_SCROLL_GAP )
103 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineSpacing", FLOAT, LINE_SPACING )
104 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline", MAP, UNDERLINE )
105 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow", MAP, SHADOW )
106 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "emboss", MAP, EMBOSS )
107 DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "outline", MAP, OUTLINE )
109 DALI_TYPE_REGISTRATION_END()
113 Toolkit::TextLabel TextLabel::New()
115 // Create the implementation, temporarily owned by this handle on stack
116 IntrusivePtr< TextLabel > impl = new TextLabel();
118 // Pass ownership to CustomActor handle
119 Toolkit::TextLabel handle( *impl );
121 // Second-phase init of the implementation
122 // This can only be done after the CustomActor connection has been made...
128 void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
130 Toolkit::TextLabel label = Toolkit::TextLabel::DownCast( Dali::BaseHandle( object ) );
134 TextLabel& impl( GetImpl( label ) );
137 case Toolkit::TextLabel::Property::RENDERING_BACKEND:
139 int backend = value.Get< int >();
141 #ifndef ENABLE_VECTOR_BASED_TEXT_RENDERING
142 if( Text::RENDERING_VECTOR_BASED == backend )
144 backend = TextAbstraction::BITMAP_GLYPH; // Fallback to bitmap-based rendering
147 if( impl.mRenderingBackend != backend )
149 impl.mRenderingBackend = backend;
150 impl.mRenderer.Reset();
152 if( impl.mController )
154 // When using the vector-based rendering, the size of the GLyphs are different
155 TextAbstraction::GlyphType glyphType = (Text::RENDERING_VECTOR_BASED == impl.mRenderingBackend) ? TextAbstraction::VECTOR_GLYPH : TextAbstraction::BITMAP_GLYPH;
156 impl.mController->SetGlyphType( glyphType );
161 case Toolkit::TextLabel::Property::TEXT:
163 if( impl.mController )
165 impl.mController->SetText( value.Get< std::string >() );
169 case Toolkit::TextLabel::Property::FONT_FAMILY:
171 if( impl.mController )
173 const std::string& fontFamily = value.Get< std::string >();
175 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::SetProperty Property::FONT_FAMILY newFont(%s)\n", fontFamily.c_str() );
176 impl.mController->SetDefaultFontFamily( fontFamily );
180 case Toolkit::TextLabel::Property::FONT_STYLE:
182 SetFontStyleProperty( impl.mController, value, Text::FontStyle::DEFAULT );
185 case Toolkit::TextLabel::Property::POINT_SIZE:
187 if( impl.mController )
189 const float pointSize = value.Get< float >();
191 if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) )
193 impl.mController->SetDefaultPointSize( pointSize );
198 case Toolkit::TextLabel::Property::MULTI_LINE:
200 if( impl.mController )
202 impl.mController->SetMultiLineEnabled( value.Get< bool >() );
206 case Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT:
208 if( impl.mController )
210 Layout::HorizontalAlignment alignment( Layout::HORIZONTAL_ALIGN_BEGIN );
211 if( Scripting::GetEnumeration< Toolkit::Text::Layout::HorizontalAlignment >( value.Get< std::string >().c_str(),
212 HORIZONTAL_ALIGNMENT_STRING_TABLE,
213 HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT,
216 impl.mController->SetHorizontalAlignment( alignment );
221 case Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT:
223 if( impl.mController )
225 Layout::VerticalAlignment alignment( Layout::VERTICAL_ALIGN_BOTTOM );
226 if( Scripting::GetEnumeration< Toolkit::Text::Layout::VerticalAlignment >( value.Get< std::string >().c_str(),
227 VERTICAL_ALIGNMENT_STRING_TABLE,
228 VERTICAL_ALIGNMENT_STRING_TABLE_COUNT,
231 impl.mController->SetVerticalAlignment( alignment );
237 case Toolkit::TextLabel::Property::TEXT_COLOR:
239 if( impl.mController )
241 const Vector4& textColor = value.Get< Vector4 >();
242 if( impl.mController->GetDefaultColor() != textColor )
244 impl.mController->SetDefaultColor( textColor );
245 impl.mRenderer.Reset();
251 case Toolkit::TextLabel::Property::SHADOW_OFFSET:
253 if( impl.mController )
255 const Vector2& shadowOffset = value.Get< Vector2 >();
256 if ( impl.mController->GetShadowOffset() != shadowOffset )
258 impl.mController->SetShadowOffset( shadowOffset );
259 impl.mRenderer.Reset();
264 case Toolkit::TextLabel::Property::SHADOW_COLOR:
266 if( impl.mController )
268 const Vector4& shadowColor = value.Get< Vector4 >();
269 if ( impl.mController->GetShadowColor() != shadowColor )
271 impl.mController->SetShadowColor( shadowColor );
272 impl.mRenderer.Reset();
277 case Toolkit::TextLabel::Property::UNDERLINE_COLOR:
279 if( impl.mController )
281 const Vector4& color = value.Get< Vector4 >();
282 if ( impl.mController->GetUnderlineColor() != color )
284 impl.mController->SetUnderlineColor( color );
285 impl.mRenderer.Reset();
290 case Toolkit::TextLabel::Property::UNDERLINE_ENABLED:
292 if( impl.mController )
294 const bool enabled = value.Get< bool >();
295 if ( impl.mController->IsUnderlineEnabled() != enabled )
297 impl.mController->SetUnderlineEnabled( enabled );
298 impl.mRenderer.Reset();
304 case Toolkit::TextLabel::Property::UNDERLINE_HEIGHT:
306 if( impl.mController )
308 float height = value.Get< float >();
309 if( fabsf( impl.mController->GetUnderlineHeight() - height ) > Math::MACHINE_EPSILON_1000 )
311 impl.mController->SetUnderlineHeight( height );
312 impl.mRenderer.Reset();
317 case Toolkit::TextLabel::Property::ENABLE_MARKUP:
319 if( impl.mController )
321 const bool enableMarkup = value.Get<bool>();
322 impl.mController->SetMarkupProcessorEnabled( enableMarkup );
326 case Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL:
328 if( impl.mController )
330 const bool enableAutoScroll = value.Get<bool>();
331 // If request to auto scroll is the same as current state then do nothing.
332 if ( enableAutoScroll != impl.mController->IsAutoScrollEnabled() )
334 // If request is disable (false) and auto scrolling is enabled then need to stop it
335 if ( enableAutoScroll == false )
337 if( impl.mTextScroller )
339 impl.mTextScroller->SetLoopCount( 0 ); // Causes the current animation to finish playing (0)
342 // If request is enable (true) then start autoscroll as not already running
345 impl.mController->SetTextElideEnabled( false );
346 impl.mController->SetAutoScrollEnabled( enableAutoScroll );
352 case Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED:
354 if( !impl.mTextScroller )
356 impl.mTextScroller = Text::TextScroller::New( impl );
358 impl.mTextScroller->SetSpeed( value.Get<int>() );
361 case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT:
363 if( !impl.mTextScroller )
365 impl.mTextScroller = Text::TextScroller::New( impl );
367 impl.mTextScroller->SetLoopCount( value.Get<int>() );
370 case Toolkit::TextLabel::Property::AUTO_SCROLL_GAP:
372 if( !impl.mTextScroller )
374 impl.mTextScroller = Text::TextScroller::New( impl );
376 impl.mTextScroller->SetGap( value.Get<float>() );
379 case Toolkit::TextLabel::Property::LINE_SPACING:
381 if( impl.mController )
383 const float lineSpacing = value.Get<float>();
384 impl.mController->SetDefaultLineSpacing( lineSpacing );
385 impl.mRenderer.Reset();
389 case Toolkit::TextLabel::Property::UNDERLINE:
391 const bool update = SetUnderlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
394 impl.mRenderer.Reset();
398 case Toolkit::TextLabel::Property::SHADOW:
400 const bool update = SetShadowProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
403 impl.mRenderer.Reset();
407 case Toolkit::TextLabel::Property::EMBOSS:
409 const bool update = SetEmbossProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
412 impl.mRenderer.Reset();
416 case Toolkit::TextLabel::Property::OUTLINE:
418 const bool update = SetOutlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
421 impl.mRenderer.Reset();
429 Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index index )
431 Property::Value value;
433 Toolkit::TextLabel label = Toolkit::TextLabel::DownCast( Dali::BaseHandle( object ) );
437 TextLabel& impl( GetImpl( label ) );
440 case Toolkit::TextLabel::Property::RENDERING_BACKEND:
442 value = impl.mRenderingBackend;
445 case Toolkit::TextLabel::Property::TEXT:
447 if( impl.mController )
450 impl.mController->GetText( text );
455 case Toolkit::TextLabel::Property::FONT_FAMILY:
457 if( impl.mController )
459 value = impl.mController->GetDefaultFontFamily();
463 case Toolkit::TextLabel::Property::FONT_STYLE:
465 GetFontStyleProperty( impl.mController, value, Text::FontStyle::DEFAULT );
468 case Toolkit::TextLabel::Property::POINT_SIZE:
470 if( impl.mController )
472 value = impl.mController->GetDefaultPointSize();
476 case Toolkit::TextLabel::Property::MULTI_LINE:
478 if( impl.mController )
480 value = impl.mController->IsMultiLineEnabled();
484 case Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT:
486 if( impl.mController )
488 const char* name = Scripting::GetEnumerationName< Toolkit::Text::Layout::HorizontalAlignment >( impl.mController->GetHorizontalAlignment(),
489 HORIZONTAL_ALIGNMENT_STRING_TABLE,
490 HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT );
493 value = std::string( name );
498 case Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT:
500 if( impl.mController )
502 const char* name = Scripting::GetEnumerationName< Toolkit::Text::Layout::VerticalAlignment >( impl.mController->GetVerticalAlignment(),
503 VERTICAL_ALIGNMENT_STRING_TABLE,
504 VERTICAL_ALIGNMENT_STRING_TABLE_COUNT );
507 value = std::string( name );
512 case Toolkit::TextLabel::Property::TEXT_COLOR:
514 if ( impl.mController )
516 value = impl.mController->GetDefaultColor();
520 case Toolkit::TextLabel::Property::SHADOW_OFFSET:
522 if ( impl.mController )
524 value = impl.mController->GetShadowOffset();
528 case Toolkit::TextLabel::Property::SHADOW_COLOR:
530 if ( impl.mController )
532 value = impl.mController->GetShadowColor();
536 case Toolkit::TextLabel::Property::UNDERLINE_COLOR:
538 if ( impl.mController )
540 value = impl.mController->GetUnderlineColor();
544 case Toolkit::TextLabel::Property::UNDERLINE_ENABLED:
546 if ( impl.mController )
548 value = impl.mController->IsUnderlineEnabled();
552 case Toolkit::TextLabel::Property::UNDERLINE_HEIGHT:
554 if ( impl.mController )
556 value = impl.mController->GetUnderlineHeight();
560 case Toolkit::TextLabel::Property::ENABLE_MARKUP:
562 if( impl.mController )
564 value = impl.mController->IsMarkupProcessorEnabled();
568 case Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL:
570 if( impl.mController )
572 value = impl.mController->IsAutoScrollEnabled();
576 case Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED:
578 TextLabel& impl( GetImpl( label ) );
579 if ( impl.mTextScroller )
581 value = impl.mTextScroller->GetSpeed();
585 case Toolkit::TextLabel::Property::AUTO_SCROLL_LOOP_COUNT:
587 if( impl.mController )
589 TextLabel& impl( GetImpl( label ) );
590 if ( impl.mTextScroller )
592 value = impl.mTextScroller->GetLoopCount();
597 case Toolkit::TextLabel::Property::AUTO_SCROLL_GAP:
599 TextLabel& impl( GetImpl( label ) );
600 if ( impl.mTextScroller )
602 value = impl.mTextScroller->GetGap();
606 case Toolkit::TextLabel::Property::LINE_SPACING:
608 if( impl.mController )
610 value = impl.mController->GetDefaultLineSpacing();
614 case Toolkit::TextLabel::Property::UNDERLINE:
616 GetUnderlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
619 case Toolkit::TextLabel::Property::SHADOW:
621 GetShadowProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
624 case Toolkit::TextLabel::Property::EMBOSS:
626 GetEmbossProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
629 case Toolkit::TextLabel::Property::OUTLINE:
631 GetOutlineProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
640 void TextLabel::OnInitialize()
644 mController = Text::Controller::New( this );
646 // When using the vector-based rendering, the size of the GLyphs are different
647 TextAbstraction::GlyphType glyphType = (Text::RENDERING_VECTOR_BASED == mRenderingBackend) ? TextAbstraction::VECTOR_GLYPH : TextAbstraction::BITMAP_GLYPH;
648 mController->SetGlyphType( glyphType );
650 // Use height-for-width negotiation by default
651 self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
652 self.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
654 // Enable the text ellipsis.
655 mController->SetTextElideEnabled( true ); // If false then text larger than control will overflow
657 Layout::Engine& engine = mController->GetLayoutEngine();
658 engine.SetCursorWidth( 0u ); // Do not layout space for the cursor.
660 self.OnStageSignal().Connect( this, &TextLabel::OnStageConnect );
663 void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
665 DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextLabel::OnStyleChange\n");
669 case StyleChange::DEFAULT_FONT_CHANGE:
671 // Property system did not set the font so should update it.
672 const std::string& newFont = GetImpl( styleManager ).GetDefaultFontFamily();
673 DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnStyleChange StyleChange::DEFAULT_FONT_CHANGE newFont(%s)\n", newFont.c_str() );
674 mController->UpdateAfterFontChange( newFont );
678 case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
680 GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
684 case StyleChange::THEME_CHANGE:
686 // Nothing to do, let control base class handle this
691 // Up call to Control
692 Control::OnStyleChange( styleManager, change );
695 Vector3 TextLabel::GetNaturalSize()
697 return mController->GetNaturalSize();
700 float TextLabel::GetHeightForWidth( float width )
702 return mController->GetHeightForWidth( width );
705 void TextLabel::OnRelayout( const Vector2& size, RelayoutContainer& container )
707 DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::OnRelayout\n" );
709 const Text::Controller::UpdateTextType updateTextType = mController->Relayout( size );
711 if( ( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) ) ||
716 mRenderer = Text::Backend::Get().NewRenderer( mRenderingBackend );
722 void TextLabel::RequestTextRelayout()
727 void TextLabel::RenderText()
729 DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::RenderText IsAutoScrollEnabled[%s] [%p]\n", ( mController->IsAutoScrollEnabled())?"true":"false", this );
732 Actor renderableActor;
734 float alignmentOffset = 0.f;
737 renderableActor = mRenderer->Render( mController->GetView(),
739 DepthIndex::CONTENT );
742 if( renderableActor != mRenderableActor )
744 UnparentAndReset( mRenderableActor );
746 if( renderableActor )
748 const Vector2& scrollOffset = mController->GetTextModel()->GetScrollPosition();
749 renderableActor.SetPosition( scrollOffset.x + alignmentOffset, scrollOffset.y );
751 self.Add( renderableActor );
753 mRenderableActor = renderableActor;
755 if ( mController->IsAutoScrollEnabled() )
757 SetUpAutoScrolling();
762 void TextLabel::SetUpAutoScrolling()
764 const Size& controlSize = mController->GetView().GetControlSize();
765 const Size offScreenSize = GetNaturalSize().GetVectorXY(); // As relayout of text may not be done at this point natural size is used to get size. Single line scrolling only.
766 const float alignmentOffset = mController->GetAutoScrollLineAlignment();
767 const Text::CharacterDirection direction = mController->GetAutoScrollDirection();
769 DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetUpAutoScrolling alignmentOffset[%f] offScreenSize[%f,%f] controlSize[%f,%f]\n",
770 alignmentOffset, offScreenSize.x,offScreenSize.y , controlSize.x,controlSize.y );
772 if ( !mTextScroller )
774 DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::SetUpAutoScrolling Creating default TextScoller\n" );
776 // If speed, loopCount or gap not set via property system then will need to create a TextScroller with defaults
777 mTextScroller = Text::TextScroller::New( *this );
779 mTextScroller->SetParameters( mRenderableActor, controlSize, offScreenSize, direction, alignmentOffset );
782 self.Add( mTextScroller->GetScrollingText() );
783 self.Add( mTextScroller->GetSourceCamera() );
786 void TextLabel::OnStageConnect( Dali::Actor actor )
788 if ( mHasBeenStaged )
794 mHasBeenStaged = true;
798 void TextLabel::ScrollingFinished()
800 // Pure Virtual from TextScroller Interface
801 DALI_LOG_INFO( gLogFilter, Debug::General, "TextLabel::ScrollingFinished\n");
802 mController->SetAutoScrollEnabled( false );
803 mController->SetTextElideEnabled( true );
804 RequestTextRelayout();
807 TextLabel::TextLabel()
808 : Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
809 mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
810 mHasBeenStaged( false )
814 TextLabel::~TextLabel()
818 } // namespace Internal
820 } // namespace Toolkit