X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-editor-impl.cpp;h=7576bc1942aea6f334f1d61b768acb93681908b7;hp=adfd0ae4b766a8f12fec5f18e70518af7dabdf5f;hb=a57d543cd372560a9065a31b32184a6a02d49e77;hpb=7ab8f56aba96efd1851b57a23b9b0b704dec052c diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index adfd0ae..7576bc1 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -1291,10 +1292,10 @@ void TextEditor::OnInitialize() mController->SetLayoutDirection( layoutDirection ); // Forward input events to controller - EnableGestureDetection( static_cast( Gesture::Tap | Gesture::Pan | Gesture::LongPress ) ); + EnableGestureDetection( static_cast( GestureType::TAP | GestureType::PAN | GestureType::LONG_PRESS ) ); GetTapGestureDetector().SetMaximumTapsRequired( 2 ); - self.TouchSignal().Connect( this, &TextEditor::OnTouched ); + self.TouchedSignal().Connect( this, &TextEditor::OnTouched ); // Set BoundingBox to stage size if not already set. Rect boundingBox; @@ -1400,7 +1401,15 @@ void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container ) Vector2 contentSize( size.x - ( padding.start + padding.end ), size.y - ( padding.top + padding.bottom ) ); // Support Right-To-Left of padding - Dali::LayoutDirection::Type layoutDirection = static_cast( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); + Dali::LayoutDirection::Type layoutDirection; + if( mController->IsMatchSystemLanguageDirection() ) + { + layoutDirection = static_cast( DevelWindow::Get( self ).GetRootLayer().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); + } + else + { + layoutDirection = static_cast( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); + } if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection ) { std::swap( padding.start, padding.end ); @@ -1567,14 +1576,15 @@ void TextEditor::OnTap( const TapGesture& gesture ) // Deliver the tap before the focus event to controller; this allows us to detect when focus is gained due to tap-gestures Extents padding; padding = Self().GetProperty( Toolkit::Control::Property::PADDING ); - mController->TapEvent( gesture.numberOfTaps, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top ); + const Vector2& localPoint = gesture.GetLocalPoint(); + mController->TapEvent( gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top ); SetKeyInputFocus(); } void TextEditor::OnPan( const PanGesture& gesture ) { - mController->PanEvent( gesture.state, gesture.displacement ); + mController->PanEvent( gesture.GetState(), gesture.GetDisplacement() ); } void TextEditor::OnLongPress( const LongPressGesture& gesture ) @@ -1585,7 +1595,8 @@ void TextEditor::OnLongPress( const LongPressGesture& gesture ) } Extents padding; padding = Self().GetProperty( Toolkit::Control::Property::PADDING ); - mController->LongPressEvent( gesture.state, gesture.localPoint.x - padding.start, gesture.localPoint.y - padding.top ); + const Vector2& localPoint = gesture.GetLocalPoint(); + mController->LongPressEvent( gesture.GetState(), localPoint.x - padding.start, localPoint.y - padding.top ); SetKeyInputFocus(); } @@ -1719,8 +1730,8 @@ void TextEditor::UpdateScrollBar() CustomActor self = Self(); if( !mScrollBar ) { - mScrollBar = Toolkit::ScrollBar::New( Toolkit::ScrollBar::Vertical ); - mScrollBar.SetIndicatorHeightPolicy( Toolkit::ScrollBar::Variable ); + mScrollBar = Toolkit::ScrollBar::New( Toolkit::ScrollBar::VERTICAL ); + mScrollBar.SetIndicatorHeightPolicy( Toolkit::ScrollBar::VARIABLE ); mScrollBar.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); mScrollBar.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT ); mScrollBar.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );