X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=base%2Fdali-toolkit%2Finternal%2Fcontrols%2Ftext-input%2Ftext-input-impl.cpp;h=7600969536fff9b61d7b7fb02eb8e098be27f86a;hp=44c5aaf115d69e40e5b4ea339903cf5a805243a7;hb=714066000e082a6a1e5053d79c2e0c9cb5e163dd;hpb=d160a0e0ef708245ecbf94e6e34d7bd9f0cad0c7 diff --git a/base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp b/base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp index 44c5aaf..7600969 100644 --- a/base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp +++ b/base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp @@ -281,9 +281,9 @@ Dali::Toolkit::TextInput TextInput::New() TextInputPtr textInput(new TextInput()); // Pass ownership to CustomActor via derived handle Dali::Toolkit::TextInput handle(*textInput); + handle.SetName( "TextInput"); textInput->Initialize(); - return handle; } @@ -1152,6 +1152,7 @@ void TextInput::CreateActiveLayer() { Actor self = Self(); mActiveLayer = Layer::New(); + mActiveLayer.SetName ( "ActiveLayerActor" ); mActiveLayer.SetAnchorPoint( AnchorPoint::CENTER); mActiveLayer.SetParentOrigin( ParentOrigin::CENTER); @@ -1541,6 +1542,12 @@ void TextInput::OnLongPress(Dali::Actor actor, Dali::LongPressGesture longPress) { DALI_LOG_INFO( gLogFilter, Debug::General, "OnLongPress\n" ); + // Ignore longpress if in selection mode already + if( mHighlightMeshActor ) + { + return; + } + if(longPress.state == Dali::Gesture::Started) { // Start edit mode on long press @@ -2076,6 +2083,7 @@ void TextInput::SetUpTouchEvents() void TextInput::CreateTextViewActor() { mDisplayedTextView = Toolkit::TextView::New(); + mDisplayedTextView.SetName( "TextView "); mDisplayedTextView.SetMarkupProcessingEnabled( mMarkUpEnabled ); mDisplayedTextView.SetParentOrigin(ParentOrigin::TOP_LEFT); mDisplayedTextView.SetAnchorPoint(AnchorPoint::TOP_LEFT); @@ -2635,6 +2643,8 @@ void TextInput::DeleteHighlightedText( bool inheritStyle ) RemoveHighlight(); + EmitTextModified(); + if( inheritStyle ) { const TextStyle oldInputStyle( mInputStyle ); @@ -3493,7 +3503,7 @@ TextInput::HighlightInfo TextInput::CalculateHighlightInfo() // TODO: TextView should have a table of visual rows, and each character a reference to the row // that it resides on. That way this enumeration is not necessary. Vector2 min, max; - if(lastIt->mIsNewLineChar) + if(lastIt->mIsNewParagraphChar) { // If the last character is a new line, then to get the row rect, we need to scan from the character before the new line. lastIt = std::max( mTextLayoutInfo.mCharacterLayoutInfoTable.begin(), lastIt - 1 ); @@ -3540,7 +3550,7 @@ TextInput::HighlightInfo TextInput::CalculateHighlightInfo() { // finished selection. Vector2 min, max; - if(lastIt->mIsNewLineChar) + if(lastIt->mIsNewParagraphChar) { lastIt = std::max( mTextLayoutInfo.mCharacterLayoutInfoTable.begin(), lastIt - 1 ); } @@ -3906,7 +3916,7 @@ bool TextInput::ReturnClosestIndex(const Vector2& source, std::size_t& closestIn if( fabsf( closestYdifference - currentYdifference ) < CHARACTER_THRESHOLD ) { // ignore new line character. - if( !info.mIsNewLineChar ) + if( !info.mIsNewParagraphChar ) { matchedCharacters.push_back( info ); numberOfMatchedCharacters++; @@ -3920,7 +3930,7 @@ bool TextInput::ReturnClosestIndex(const Vector2& source, std::size_t& closestIn // and check if user is touching below previous line. const Toolkit::TextView::CharacterLayoutInfo& lastInfo( mTextLayoutInfo.mCharacterLayoutInfoTable[mTextLayoutInfo.mCharacterLayoutInfoTable.size() - 1] ); - if( ( lastInfo.mIsVisible ) && ( lastInfo.mIsNewLineChar ) && ( sourceScrollOffset.y > lastInfo.mPosition.y ) ) + if( ( lastInfo.mIsVisible ) && ( lastInfo.mIsNewParagraphChar ) && ( sourceScrollOffset.y > lastInfo.mPosition.y ) ) { closestIndex = mTextLayoutInfo.mCharacterLayoutInfoTable.size(); } @@ -4178,7 +4188,7 @@ Vector3 TextInput::GetActualPositionFromCharacterPosition(std::size_t characterP } Toolkit::TextView::CharacterLayoutInfo info = mTextLayoutInfo.mCharacterLayoutInfoTable[ visualCharacterPosition ]; - if( ( visualCharacterPosition > 0 ) && info.mIsNewLineChar && !IsScrollEnabled() ) + if( ( visualCharacterPosition > 0 ) && info.mIsNewParagraphChar && !IsScrollEnabled() ) { // Prevents the cursor to exceed the boundary if the last visible character is a 'new line character' and the scroll is not enabled. const Vector3& size = GetControlSize(); @@ -4190,7 +4200,7 @@ Vector3 TextInput::GetActualPositionFromCharacterPosition(std::size_t characterP info = mTextLayoutInfo.mCharacterLayoutInfoTable[ visualCharacterPosition ]; } - if(!info.mIsNewLineChar) + if(!info.mIsNewParagraphChar) { cursorPosition = PositionCursorAfterWordWrap( characterPosition ); // Get position of cursor/handles taking in account auto word wrap. } @@ -4390,7 +4400,7 @@ std::size_t TextInput::GetRowStartFromCharacterPosition(std::size_t logicalPosit { logicalPosition--; std::size_t visualPosition = GetVisualPosition(logicalPosition); - if(mTextLayoutInfo.mCharacterLayoutInfoTable[visualPosition].mIsNewLineChar) + if(mTextLayoutInfo.mCharacterLayoutInfoTable[visualPosition].mIsNewParagraphChar) { logicalPosition++; break; @@ -4460,7 +4470,7 @@ Size TextInput::GetRowRectFromCharacterPosition(std::size_t characterPosition, V --it; if( (it->mPosition.y < referenceLine) || - (it->mIsNewLineChar) || + (it->mIsNewParagraphChar) || (!it->mIsVisible) ) { break; @@ -4477,7 +4487,7 @@ Size TextInput::GetRowRectFromCharacterPosition(std::size_t characterPosition, V while(it != end) { if( (it->mPosition.y > referenceLine) || - (it->mIsNewLineChar) || + (it->mIsNewParagraphChar) || (!it->mIsVisible) ) { break; @@ -4802,6 +4812,7 @@ void TextInput::PasteText( const Text& text ) if( update ) { CursorUpdate(); + EmitTextModified(); } if( insertedStringLength < text.GetLength() )