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=44c5aaf115d69e40e5b4ea339903cf5a805243a7;hp=fe7964cc8689dc49b82fbb623b7dea960e9c8378;hb=6137113ec3ddc10607465f305098ed1dd4b45dcd;hpb=12752c1994ba2e28c37160ae0c83c18ae25f2378 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 fe7964c..44c5aaf 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 @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -51,9 +52,6 @@ const char* DEFAULT_SELECTION_HANDLE_ONE( DALI_IMAGE_DIR "text-input-selection-h const char* DEFAULT_SELECTION_HANDLE_TWO( DALI_IMAGE_DIR "text-input-selection-handle-right.png" ); const char* DEFAULT_SELECTION_HANDLE_ONE_PRESSED( DALI_IMAGE_DIR "text-input-selection-handle-left-press.png" ); const char* DEFAULT_SELECTION_HANDLE_TWO_PRESSED( DALI_IMAGE_DIR "text-input-selection-handle-right-press.png" ); -const char* DEFAULT_CURSOR( DALI_IMAGE_DIR "cursor.png" ); - -const Vector4 DEFAULT_CURSOR_IMAGE_9_BORDER( 2.0f, 2.0f, 2.0f, 2.0f ); const std::size_t CURSOR_BLINK_INTERVAL = 500; ///< Cursor blink interval const float CHARACTER_THRESHOLD( 2.5f ); ///< the threshold of a line. @@ -66,8 +64,9 @@ const Vector3 DEFAULT_HANDLE_ONE_OFFSET(0.0f, -5.0f, 0.0f); ///< const Vector3 DEFAULT_HANDLE_TWO_OFFSET(0.0f, -5.0f, 0.0f); ///< Handle Two's Offset const float TOP_HANDLE_TOP_OFFSET( 34.0f); ///< Offset between top handle and cutCopyPaste pop-up const float BOTTOM_HANDLE_BOTTOM_OFFSET(34.0f); ///< Offset between bottom handle and cutCopyPaste pop-up -const float CURSOR_THICKNESS(6.0f); +const float CURSOR_THICKNESS(4.0f); const Degree CURSOR_ANGLE_OFFSET(2.0f); ///< Offset from the angle of italic angle. +const Vector4 DEFAULT_CURSOR_COLOR(1.0f, 1.0f, 1.0f, 1.0f); const std::string NEWLINE( "\n" ); @@ -211,8 +210,9 @@ const Property::Index TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY = const Property::Index TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+11; const Property::Index TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+12; const Property::Index TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+13; - const Property::Index TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+14; +const Property::Index TextInput::CURSOR_COLOR_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+15; + namespace Internal { @@ -251,6 +251,8 @@ PropertyRegistration property12( typeRegistration, "select-button-position-prior PropertyRegistration property13( typeRegistration, "select-all-button-position-priority", Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty ); PropertyRegistration property14( typeRegistration, "clipboard-button-position-priority", Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty ); PropertyRegistration property15( typeRegistration, "popup-offset-from-text", Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty ); +PropertyRegistration property16( typeRegistration, "cursor-color", Toolkit::TextInput::CURSOR_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty ); + // [TextInput::HighlightInfo] ///////////////////////////////////////////////// @@ -312,7 +314,7 @@ TextInput::TextInput() mTouchStartTime( 0 ), mTextLayoutInfo(), mCurrentCopySelecton(), - mPopUpPanel(), + mPopupPanel(), mScrollTimer(), mScrollDisplacement(), mCurrentHandlePosition(), @@ -794,9 +796,6 @@ void TextInput::SetBoundingRectangle( const Rect& boundingRectangle ) originY + boundingRectangle.height ); mBoundingRectangleWorldCoordinates = boundary; - - // Set Boundary for Popup so it keeps the Pop-up within the area also. - mPopUpPanel.SetPopupBoundary( boundingRectangle ); } const Rect TextInput::GetBoundingRectangle() const @@ -1170,9 +1169,8 @@ void TextInput::OnInitialize() // Create 2 cursors (standard LTR and RTL cursor for when text can be added at // different positions depending on language) - Image mCursorImage = Image::New( DEFAULT_CURSOR ); - mCursor = CreateCursor( mCursorImage, DEFAULT_CURSOR_IMAGE_9_BORDER ); - mCursorRTL = CreateCursor( mCursorImage, DEFAULT_CURSOR_IMAGE_9_BORDER ); + mCursor = CreateCursor(DEFAULT_CURSOR_COLOR); + mCursorRTL = CreateCursor(DEFAULT_CURSOR_COLOR); Actor self = Self(); self.Add( mCursor ); @@ -1197,6 +1195,8 @@ void TextInput::OnControlSizeSet(const Vector3& targetSize) void TextInput::OnRelaidOut( Vector2 size, ActorSizeContainer& container ) { Relayout( mDisplayedTextView, size, container ); + Relayout( mPopupPanel.GetRootActor(), size, container ); + GetTextLayoutInfo(); DrawCursor(); @@ -1279,7 +1279,7 @@ void TextInput::OnHandlePan(Actor actor, PanGesture gesture) { mActualGrabHandlePosition = MoveGrabHandle( gesture.displacement ); SetCursorVisibility( true ); - SetUpPopUpSelection(); + SetUpPopupSelection(); ShowPopup(); } if (actor == mHandleOneGrabArea) @@ -1423,9 +1423,9 @@ void TextInput::OnTextTap(Dali::Actor actor, Dali::TapGesture tap) if( mGrabArea == actor ) { - if( mPopUpPanel.GetState() == TextInputPopup::StateHidden || mPopUpPanel.GetState() == TextInputPopup::StateHiding ) + if( mPopupPanel.GetState() == TextInputPopup::StateHidden || mPopupPanel.GetState() == TextInputPopup::StateHiding ) { - SetUpPopUpSelection(); + SetUpPopupSelection(); ShowPopup(); } @@ -1614,7 +1614,7 @@ void TextInput::OnClipboardTextSelected( ClipboardEventNotifier& notifier ) bool TextInput::OnPopupButtonPressed( Toolkit::Button button ) { - mPopUpPanel.PressedSignal().Disconnect( this, &TextInput::OnPopupButtonPressed ); + mPopupPanel.PressedSignal().Disconnect( this, &TextInput::OnPopupButtonPressed ); const std::string& name = button.GetName(); @@ -1951,11 +1951,7 @@ void TextInput::ScrollTextViewToMakeCursorVisible( const Vector3& cursorPosition scrollOffset.x += cursorPosition.x; } - if( cursorPosition.y - cursorSize.height < 0.f ) - { - scrollOffset.y += ( cursorPosition.y - cursorSize.height ); - } - else if( cursorPosition.y > controlSize.height ) + if( cursorPosition.y - cursorSize.height < 0.f || cursorPosition.y > controlSize.height ) { scrollOffset.y += cursorPosition.y; } @@ -2267,7 +2263,7 @@ ImfManager::ImfCallbackData TextInput::ImfEventReceived( Dali::ImfManager& imfMa } else { - if( std::abs( imfEvent.cursorOffset ) < mCursorPosition ) + if( static_cast(std::abs( imfEvent.cursorOffset )) < mCursorPosition ) { toDelete = mCursorPosition + imfEvent.cursorOffset; } @@ -2824,21 +2820,10 @@ std::size_t TextInput::InsertAt( const Text& newText, const std::size_t insertio return insertedStringLength; } -ImageActor TextInput::CreateCursor( Image cursorImage, const Vector4& border ) +ImageActor TextInput::CreateCursor( const Vector4& color) { ImageActor cursor; - - if ( cursorImage ) - { - cursor = ImageActor::New( cursorImage ); - } - else - { - cursor = ImageActor::New( Image::New( DEFAULT_CURSOR ) ); - } - - cursor.SetStyle(ImageActor::STYLE_NINE_PATCH); - cursor.SetNinePatchBorder( border ); + cursor = CreateSolidColorActor(color); cursor.SetParentOrigin(ParentOrigin::TOP_LEFT); cursor.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER); @@ -3704,65 +3689,102 @@ void TextInput::UpdateHighlight() void TextInput::ClearPopup() { - mPopUpPanel.Clear(); + mPopupPanel.Clear(); } void TextInput::AddPopupOptions() { - mPopUpPanel.AddPopupOptions(); + mPopupPanel.AddPopupOptions(); } -void TextInput::SetPopupPosition(const Vector3& position) +void TextInput::SetPopupPosition( const Vector3& position, const Vector2& alternativePosition ) { - mPopUpPanel.Self().SetPosition( position ); - mPopUpPanel.SetTailPosition( position ); + const Vector3& visiblePopUpSize = mPopupPanel.GetVisibileSize(); + + Vector3 clampedPosition ( position ); + Vector3 tailOffsetPosition ( position ); + + float xOffSet( 0.0f ); + + Actor self = Self(); + const Vector3 textViewTopLeftWorldPosition = self.GetCurrentWorldPosition() - self.GetCurrentSize()*0.5f; + + const float popUpLeft = textViewTopLeftWorldPosition.x + position.x - visiblePopUpSize.width*0.5f; + const float popUpTop = textViewTopLeftWorldPosition.y + position.y - visiblePopUpSize.height; + + // Clamp to left or right or of boundary + if( popUpLeft < mBoundingRectangleWorldCoordinates.x ) + { + xOffSet = mBoundingRectangleWorldCoordinates.x - popUpLeft ; + } + else if ( popUpLeft + visiblePopUpSize.width > mBoundingRectangleWorldCoordinates.z ) + { + xOffSet = mBoundingRectangleWorldCoordinates.z - ( popUpLeft + visiblePopUpSize.width ); + } + + clampedPosition.x = position.x + xOffSet; + tailOffsetPosition.x = -xOffSet; + + // Check if top left of PopUp outside of top bounding rectangle, if so then flip to lower position. + bool flipTail( false ); + + if ( popUpTop < mBoundingRectangleWorldCoordinates.y ) + { + clampedPosition.y = alternativePosition.y + visiblePopUpSize.height; + flipTail = true; + } + + mPopupPanel.GetRootActor().SetPosition( clampedPosition ); + mPopupPanel.SetTailPosition( tailOffsetPosition, flipTail ); } void TextInput::HidePopup(bool animate, bool signalFinished ) { - if ( ( mPopUpPanel.GetState() == TextInputPopup::StateShowing ) || ( mPopUpPanel.GetState() == TextInputPopup::StateShown ) ) + if ( ( mPopupPanel.GetState() == TextInputPopup::StateShowing ) || ( mPopupPanel.GetState() == TextInputPopup::StateShown ) ) { - mPopUpPanel.Hide( animate ); + mPopupPanel.Hide( animate ); if( animate && signalFinished ) { - mPopUpPanel.HideFinishedSignal().Connect( this, &TextInput::OnPopupHideFinished ); + mPopupPanel.HideFinishedSignal().Connect( this, &TextInput::OnPopupHideFinished ); } } } -void TextInput::ShowPopup(bool animate) +void TextInput::ShowPopup( bool animate ) { Vector3 position; + Vector2 alternativePopupPosition; if(mHighlightMeshActor && mState == StateEdit) { Vector3 topHandle; + Vector3 bottomHandle; // referring to the bottom most point of the handle or the bottom line of selection. Size rowSize; // When text is selected, show popup above top handle (and text), or below bottom handle. // topHandle: referring to the top most point of the handle or the top line of selection. if ( mSelectionHandleTwoActualPosition.y > mSelectionHandleOneActualPosition.y ) { topHandle = mSelectionHandleOneActualPosition; + bottomHandle = mSelectionHandleTwoActualPosition; rowSize= GetRowRectFromCharacterPosition( mSelectionHandleOnePosition ); } else { topHandle = mSelectionHandleTwoActualPosition; + bottomHandle = mSelectionHandleOneActualPosition; rowSize = GetRowRectFromCharacterPosition( mSelectionHandleTwoPosition ); } topHandle.y += -mPopupOffsetFromText.y - rowSize.height; position = Vector3(topHandle.x, topHandle.y, 0.0f); - // bottomHandle: referring to the bottom most point of the handle or the bottom line of selection. - Vector3 bottomHandle; - bottomHandle.y = std::max ( mSelectionHandleTwoActualPosition.y , mSelectionHandleOneActualPosition.y ); - bottomHandle.y += GetSelectionHandleSize().y + mPopupOffsetFromText.w; - mPopUpPanel.SetAlternativeOffset(Vector2( mBoundingRectangleWorldCoordinates.x, bottomHandle.y - topHandle.y)); - - float xPosition = ( fabsf( topHandle.x - bottomHandle.x ) )*0.5f + std::min( topHandle.x , bottomHandle.x ); + float xPosition = ( fabsf( topHandle.x - bottomHandle.x ) )*0.5f + std::min( mSelectionHandleOneActualPosition.x , mSelectionHandleTwoActualPosition.x ); position.x = xPosition; + + // Alternative position if no upper space + bottomHandle.y += GetSelectionHandleSize().y + mPopupOffsetFromText.w; + alternativePopupPosition = Vector2 ( position.x, bottomHandle.y ); } else { @@ -3771,81 +3793,73 @@ void TextInput::ShowPopup(bool animate) const Size rowSize = GetRowRectFromCharacterPosition( mCursorPosition ); position.y -= ( mPopupOffsetFromText.y + rowSize.height ); // if can't be positioned above, then position below row. - Vector2 alternativePopUpPosition( mBoundingRectangleWorldCoordinates.x, position.y ); // default if no grab handle + alternativePopupPosition = Vector2( position.x, position.y ); // default if no grab handle if ( mGrabHandle ) { // If grab handle enabled then position pop-up below the grab handle. - alternativePopUpPosition.y = rowSize.height + mGrabHandle.GetCurrentSize().height + mPopupOffsetFromText.w +50.0f; + alternativePopupPosition.y = rowSize.height + mGrabHandle.GetCurrentSize().height + mPopupOffsetFromText.w +50.0f; } - mPopUpPanel.SetAlternativeOffset( alternativePopUpPosition ); } - // reposition popup above the desired cursor posiiton. - Vector3 textViewSize = mDisplayedTextView.GetCurrentSize(); - textViewSize.z = 0.0f; - // World position = world position of local position i.e. top-left corner of TextView - Vector3 worldPosition = mDisplayedTextView.GetCurrentWorldPosition() - ( textViewSize * 0.5f ) + position; - - SetPopupPosition( worldPosition ); + SetPopupPosition( position, alternativePopupPosition ); // Show popup - mPopUpPanel.Show(animate); + mPopupPanel.Show( Self(), animate ); StartMonitoringStageForTouch(); - mPopUpPanel.PressedSignal().Connect( this, &TextInput::OnPopupButtonPressed ); + mPopupPanel.PressedSignal().Connect( this, &TextInput::OnPopupButtonPressed ); } void TextInput::ShowPopupCutCopyPaste() { ClearPopup(); - mPopUpPanel.CreateOrderedListOfOptions(); // todo Move this so only run when order has changed + mPopupPanel.CreateOrderedListOfOptions(); // todo Move this so only run when order has changed // Check the selected text is whole text or not. if( IsTextSelected() && ( mStyledText.size() != GetSelectedText().size() ) ) { - mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsSelectAll, true ); + mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsSelectAll, true ); } if ( !mStyledText.empty() ) { - - mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsCopy, true ); - mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsCut, true ); + mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsCopy, true ); + mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsCut, true ); } if( mClipboard && mClipboard.NumberOfItems() ) { - mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsPaste, true ); - mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsClipboard, true ); + mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsPaste, true ); + mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsClipboard, true ); } AddPopupOptions(); - mPopUpPanel.Hide(false); + mPopupPanel.Hide(false); ShowPopup(); } -void TextInput::SetUpPopUpSelection() +void TextInput::SetUpPopupSelection() { ClearPopup(); - mPopUpPanel.CreateOrderedListOfOptions(); // todo Move this so only run when order has changed + mPopupPanel.CreateOrderedListOfOptions(); // todo Move this so only run when order has changed // If no text exists then don't offer to select if ( !mStyledText.empty() ) { - mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsSelectAll, true ); - mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsSelect, true ); - mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsCut, true ); + mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsSelectAll, true ); + mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsSelect, true ); + mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsCut, true ); } // if clipboard has valid contents then offer paste option if( mClipboard && mClipboard.NumberOfItems() ) { - mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsPaste, true ); - mPopUpPanel.TogglePopUpButtonOnOff( TextInputPopup::ButtonsClipboard, true ); + mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsPaste, true ); + mPopupPanel.TogglePopupButtonOnOff( TextInputPopup::ButtonsClipboard, true ); } AddPopupOptions(); - mPopUpPanel.Hide(false); + mPopupPanel.Hide(false); } bool TextInput::ReturnClosestIndex(const Vector2& source, std::size_t& closestIndex ) @@ -4489,7 +4503,7 @@ Size TextInput::GetRowRectFromCharacterPosition(std::size_t characterPosition, V bool TextInput::WasTouchedCheck( const Actor& touchedActor ) const { - Actor popUpPanel = mPopUpPanel.GetRootActor(); + Actor popUpPanel = mPopupPanel.GetRootActor(); if ( ( touchedActor == Self() ) || ( touchedActor == popUpPanel ) ) { @@ -4530,7 +4544,7 @@ void TextInput::OnStageTouched(const TouchEvent& event) bool popUpShown( false ); - if ( ( mPopUpPanel.GetState() == TextInputPopup::StateShowing ) || ( mPopUpPanel.GetState() == TextInputPopup::StateShown ) ) + if ( ( mPopupPanel.GetState() == TextInputPopup::StateShowing ) || ( mPopupPanel.GetState() == TextInputPopup::StateShown ) ) { popUpShown = true; } @@ -4665,7 +4679,7 @@ void TextInput::KeyboardStatusChanged(bool keyboardShown) ShowGrabHandleAndSetVisibility( false ); // If the keyboard is not now being shown, then hide the popup panel - mPopUpPanel.Hide( true ); + mPopupPanel.Hide( true ); } } @@ -4723,7 +4737,6 @@ void TextInput::CreateHighlight() mHighlightMeshActor = MeshActor::New( mHighlightMesh ); mHighlightMeshActor.SetName( "HighlightMeshActor" ); - mHighlightMeshActor.SetInheritShaderEffect( false ); mHighlightMeshActor.SetParentOrigin( ParentOrigin::TOP_LEFT ); mHighlightMeshActor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); mHighlightMeshActor.SetPosition( 0.0f, 0.0f, DISPLAYED_HIGHLIGHT_Z_OFFSET ); @@ -5179,67 +5192,67 @@ void TextInput::SetProperty( BaseObject* object, Property::Index propertyIndex, } case Toolkit::TextInput::CUT_AND_PASTE_COLOR_PROPERTY: { - textInputImpl.mPopUpPanel.SetCutPastePopUpColor( value.Get< Vector4 >() ); + textInputImpl.mPopupPanel.SetCutPastePopupColor( value.Get< Vector4 >() ); break; } case Toolkit::TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY: { - textInputImpl.mPopUpPanel.SetCutPastePopUpPressedColor( value.Get< Vector4 >() ); + textInputImpl.mPopupPanel.SetCutPastePopupPressedColor( value.Get< Vector4 >() ); break; } case Toolkit::TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY: { - textInputImpl.mPopUpPanel.SetCutPastePopUpBorderColor( value.Get< Vector4 >() ); + textInputImpl.mPopupPanel.SetCutPastePopupBorderColor( value.Get< Vector4 >() ); break; } case Toolkit::TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY: { - textInputImpl.mPopUpPanel.SetCutPastePopUpIconColor( value.Get< Vector4 >() ); + textInputImpl.mPopupPanel.SetCutPastePopupIconColor( value.Get< Vector4 >() ); break; } case Toolkit::TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY: { - textInputImpl.mPopUpPanel.SetCutPastePopUpIconPressedColor( value.Get< Vector4 >() ); + textInputImpl.mPopupPanel.SetCutPastePopupIconPressedColor( value.Get< Vector4 >() ); break; } case Toolkit::TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY: { - textInputImpl.mPopUpPanel.SetCutPastePopUpTextColor( value.Get< Vector4 >() ); + textInputImpl.mPopupPanel.SetCutPastePopupTextColor( value.Get< Vector4 >() ); break; } case Toolkit::TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY: { - textInputImpl.mPopUpPanel.SetCutPastePopUpTextPressedColor( value.Get< Vector4 >() ); + textInputImpl.mPopupPanel.SetCutPastePopupTextPressedColor( value.Get< Vector4 >() ); break; } case Toolkit::TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY: { - textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCut, value.Get() ); + textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCut, value.Get() ); break; } case Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY: { - textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCopy, value.Get() ); + textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCopy, value.Get() ); break; } case Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY: { - textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsPaste, value.Get() ); + textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsPaste, value.Get() ); break; } case Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY: { - textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelect, value.Get() ); + textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelect, value.Get() ); break; } case Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY: { - textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll, value.Get() ); + textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll, value.Get() ); break; } case Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY: { - textInputImpl.mPopUpPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsClipboard, value.Get() ); + textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsClipboard, value.Get() ); break; } case Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY: @@ -5247,6 +5260,10 @@ void TextInput::SetProperty( BaseObject* object, Property::Index propertyIndex, textInputImpl.SetOffsetFromText( value.Get< Vector4 >() ); break; } + case Toolkit::TextInput::CURSOR_COLOR_PROPERTY: + { + textInputImpl.mCursor.SetColor( value.Get< Vector4 >() ); + } } } } @@ -5270,67 +5287,67 @@ Property::Value TextInput::GetProperty( BaseObject* object, Property::Index prop } case Toolkit::TextInput::CUT_AND_PASTE_COLOR_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetCutPastePopUpColor(); + value = textInputImpl.mPopupPanel.GetCutPastePopupColor(); break; } case Toolkit::TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetCutPastePopUpPressedColor(); + value = textInputImpl.mPopupPanel.GetCutPastePopupPressedColor(); break; } case Toolkit::TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY : { - value = textInputImpl.mPopUpPanel.GetCutPastePopUpBorderColor(); + value = textInputImpl.mPopupPanel.GetCutPastePopupBorderColor(); break; } case Toolkit::TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetCutPastePopUpIconColor(); + value = textInputImpl.mPopupPanel.GetCutPastePopupIconColor(); break; } case Toolkit::TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetCutPastePopUpIconPressedColor(); + value = textInputImpl.mPopupPanel.GetCutPastePopupIconPressedColor(); break; } case Toolkit::TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetCutPastePopUpTextColor(); + value = textInputImpl.mPopupPanel.GetCutPastePopupTextColor(); break; } case Toolkit::TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetCutPastePopUpTextPressedColor(); + value = textInputImpl.mPopupPanel.GetCutPastePopupTextPressedColor(); break; } case Toolkit::TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCut ); + value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCut ); break; } case Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCopy ); + value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCopy ); break; } case Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsPaste ); + value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsPaste ); break; } case Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelect ); + value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelect ); break; } case Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll ); + value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll ); break; } case Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY: { - value = textInputImpl.mPopUpPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsClipboard ); + value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsClipboard ); break; } case Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY: @@ -5338,6 +5355,10 @@ Property::Value TextInput::GetProperty( BaseObject* object, Property::Index prop value = textInputImpl.GetOffsetFromText(); break; } + case Toolkit::TextInput::CURSOR_COLOR_PROPERTY: + { + value = textInputImpl.mCursor.GetCurrentColor(); + } } } return value;