fixed bug (Dictionary B/S, copy&paste bug, add OEM_1 keycode for Clipboard)
authorChulheon <ch.jeong47@samsung.com>
Fri, 29 Mar 2013 07:19:13 +0000 (16:19 +0900)
committerChulheon <ch.jeong47@samsung.com>
Fri, 29 Mar 2013 07:19:13 +0000 (16:19 +0900)
Change-Id: I859959264fbd929ffec474a57ea018357e57d96e

src/ui/FUi_InputConnectionImpl.cpp
src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/inc/FUiCtrl_EditPresenter.h

index f07dc44..e77823a 100644 (file)
@@ -1240,50 +1240,51 @@ _InputConnectionImpl::OnKeyPressed(const _Control& source, const _KeyInfo& keyIn
                        String commitText(pEvent->compose);
                        wchar_t commitChar= '\0';
                        commitText.GetCharAt(0, commitChar);
-
+                       IInputConnectionEventListener* pListener = GetInputConnectionListener();
+                       IInputConnectionEventListenerF* pListenerF = GetInputConnectionListenerF();
                        if (Character::IsAlphaNumeric(commitChar))
                        {
-                               if (__pListener)
+                               if (pListener)
                                {
-                                       __pListener->OnInputConnectionTextCommitted( *pInputConnection, commitText);
+                                       pListener->OnInputConnectionTextCommitted( *pInputConnection, commitText);
                                }
-                               if (__pListenerF)
+                               if (pListenerF)
                                {
-                                       __pListenerF->OnInputConnectionTextCommitted( *pInputConnection, commitText);
+                                       pListenerF->OnInputConnectionTextCommitted( *pInputConnection, commitText);
                                }
                        }
                        if (commitText == L" " || commitText == L"\t")
                        {
-                               if (__pListener)
+                               if (pListener)
                                {
-                                       __pListener->OnInputConnectionTextCommitted( *pInputConnection, commitText);
+                                       pListener->OnInputConnectionTextCommitted( *pInputConnection, commitText);
                                }
-                               if (__pListenerF)
+                               if (pListenerF)
                                {
-                                       __pListenerF->OnInputConnectionTextCommitted( *pInputConnection, commitText);
+                                       pListenerF->OnInputConnectionTextCommitted( *pInputConnection, commitText);
                                }
                        }
                        if (commitText == L"\n" || commitText == L"\r")
                        {
-                               if (__pListener)
+                               if (pListener)
                                {
-                                       __pListener->OnInputConnectionTextCommitted( *pInputConnection, commitText);
+                                       pListener->OnInputConnectionTextCommitted( *pInputConnection, commitText);
                                }
-                               if (__pListenerF)
+                               if (pListenerF)
                                {
-                                       __pListenerF->OnInputConnectionTextCommitted( *pInputConnection, commitText);
+                                       pListenerF->OnInputConnectionTextCommitted( *pInputConnection, commitText);
                                }
                        }
                        if ( (commitChar >= 0x21 && commitChar <= 0x2F) || (commitChar >= 0x3A && commitChar <= 0x40) ||
-                                (commitChar >= 0x5B && commitChar <= 0x60) || (commitChar >= 0x7B && commitChar<= 0x7E) )
+                        (commitChar >= 0x5B && commitChar <= 0x60) || (commitChar >= 0x7B && commitChar<= 0x7E) )
                        {
-                               if (__pListener)
+                               if (pListener)
                                {
-                                       __pListener->OnInputConnectionTextCommitted( *pInputConnection, commitText);
+                                       pListener->OnInputConnectionTextCommitted( *pInputConnection, commitText);
                                }
-                               if (__pListenerF)
+                               if (pListenerF)
                                {
-                                       __pListenerF->OnInputConnectionTextCommitted( *pInputConnection, commitText);
+                                       pListenerF->OnInputConnectionTextCommitted( *pInputConnection, commitText);
                                }
                        }
 
index d0bedd0..3d8a153 100755 (executable)
@@ -805,7 +805,42 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
 
                if (cursorPos != -1)
                {
-                       if (editVisibleArea.y <= absCursorRect.y) // DownSide
+                       if (pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE)
+                       {
+                               if (point.x - __touchPressedPoint.x >= 0.0f) // RightSide
+                               {
+                                       if (__handlerCursorPos == pEditPresenter->GetTextLength())
+                                       {
+                                               cursorPos = __handlerCursorPos;
+                                       }
+                                       else
+                                       {
+                                               cursorPos = __handlerCursorPos + 1;
+
+                                               if (__leftHandler && (cursorPos == pEditPresenter->GetTextLength()))
+                                               {
+                                                       cursorPos = __handlerCursorPos;
+                                               }
+                                       }
+                               }
+                               else //LeftSide
+                               {
+                                       if (__handlerCursorPos != 0)
+                                       {
+                                               cursorPos = __handlerCursorPos - 1;
+
+                                               if (__leftHandler)
+                                               {
+                                                       pTextObject->SetFirstDisplayLineIndexFromTextIndex(cursorPos);
+                                               }
+                                       }
+                               }
+                               if (point.y < 0.0f || (point.y > GetBoundsF().height))
+                               {
+                                       return true;
+                               }
+                       }
+                       else if (editVisibleArea.y <= absCursorRect.y) // DownSide
                        {
                                if (curCursorLine < totalLine - 1)
                                {
@@ -1236,7 +1271,6 @@ _EditCopyPasteManager::CreateCopyPastePopup(void)
        FloatRectangle keypadBounds(0.0f, 0.0f, 0.0f, 0.0f);
        FloatRectangle formClientBounds(0.0f, 0.0f, 0.0f, 0.0f);
        FloatRectangle panelAbsoulteBounds(0.0f, 0.0f, 0.0f, 0.0f);
-       bool keypadExist = false;
        bool commandButtonExist = false;
        FloatRectangle cursorRect = GetCursorBoundsF(true);
 
@@ -1287,16 +1321,15 @@ _EditCopyPasteManager::CreateCopyPastePopup(void)
                panelAbsoulteBounds = pPanel->GetAbsoluteBoundsF();
        }
        __pEdit->GetKeypadBounds(keypadBounds);
-       FloatDimension screenSize(0.0f, 0.0f);
-       screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-       if (keypadBounds.y != screenSize.height)
-       {
-               keypadExist = true;
-       }
 
        // Edit Show Area
        {
                editShowAreaAbsRect = editAbsRect;
+               FloatRectangle textObjectBounds = pEditPresenter->GetTextBoundsF();
+               editShowAreaAbsRect.x += textObjectBounds.x;
+               editShowAreaAbsRect.y += textObjectBounds.y;
+               editShowAreaAbsRect.width = textObjectBounds.width;
+               editShowAreaAbsRect.height = textObjectBounds.height;
 
                if (commandButtonExist)
                {
@@ -1579,7 +1612,6 @@ _EditCopyPasteManager::PrintLog(const Point& point)
        bool hasParentForm = false;
        bool hasCommandButton = false;
        Rectangle cursorRect = GetCursorBounds(true);
-       int indicatorHeight = 0;
 
        editAbsRect = __pEdit->GetAbsoluteBounds();
        _EditPresenter* pEditPresenter = __pEdit->GetPresenter();
@@ -1605,20 +1637,8 @@ _EditCopyPasteManager::PrintLog(const Point& point)
        }
        __pEdit->GetKeypadBounds(keypadBounds);
 
-    if (pForm && pForm->IsIndicatorVisible())
-    {
-            indicatorHeight = pForm->GetIndicatorBounds().height;
-    }
-
        {
                editShowAreaAbsRect = editAbsRect;
-               if (indicatorHeight)
-               {
-                       if (editShowAreaAbsRect.y < indicatorHeight)
-                       {
-                               editShowAreaAbsRect.y = indicatorHeight;
-                       }
-               }
 
                if (hasCommandButton)
                {
@@ -1663,7 +1683,6 @@ _EditCopyPasteManager::PrintLog(const FloatPoint& point)
        bool hasParentForm = false;
        bool hasCommandButton = false;
        FloatRectangle cursorRect = GetCursorBoundsF(true);
-       float indicatorHeight = 0;
 
        editAbsRect = __pEdit->GetAbsoluteBoundsF();
        _EditPresenter* pEditPresenter = __pEdit->GetPresenter();
@@ -1689,20 +1708,8 @@ _EditCopyPasteManager::PrintLog(const FloatPoint& point)
        }
        __pEdit->GetKeypadBounds(keypadBounds);
 
-    if (pForm && pForm->IsIndicatorVisible())
-    {
-            indicatorHeight = pForm->GetIndicatorBoundsF().height;
-    }
-
        {
                editShowAreaAbsRect = editAbsRect;
-               if (indicatorHeight)
-               {
-                       if (editShowAreaAbsRect.y < indicatorHeight)
-                       {
-                               editShowAreaAbsRect.y = indicatorHeight;
-                       }
-               }
 
                if (hasCommandButton)
                {
@@ -1792,6 +1799,11 @@ _EditCopyPasteManager::CheckHandleBounds(const Point& point)
        Rectangle panelAbsoulteBounds(0, 0, 0, 0);
        Rectangle editAbsBounds = __pEdit->GetAbsoluteBounds();
        _EditPresenter* pEditPresenter = __pEdit->GetPresenter();
+       Rectangle textObjectBounds = pEditPresenter->GetTextBounds();
+       editAbsBounds.x += textObjectBounds.x;
+       editAbsBounds.y += textObjectBounds.y;
+       editAbsBounds.width = textObjectBounds.width;
+       editAbsBounds.height = textObjectBounds.height;
        _Toolbar* pCommandButton = pEditPresenter->GetKeypadCommandButton();
        if (pCommandButton)
        {
@@ -1848,6 +1860,11 @@ _EditCopyPasteManager::CheckHandleBounds(const FloatPoint& point)
        FloatRectangle panelAbsoulteBounds(0.0f, 0.0f, 0.0f, 0.0f);
        FloatRectangle editAbsBounds = __pEdit->GetAbsoluteBoundsF();
        _EditPresenter* pEditPresenter = __pEdit->GetPresenter();
+       FloatRectangle textObjectBounds = pEditPresenter->GetTextBoundsF();
+       editAbsBounds.x += textObjectBounds.x;
+       editAbsBounds.y += textObjectBounds.y;
+       editAbsBounds.width = textObjectBounds.width;
+       editAbsBounds.height = textObjectBounds.height;
        _Toolbar* pCommandButton = pEditPresenter->GetKeypadCommandButton();
        if (pCommandButton)
        {
index e67bd57..cee2698 100755 (executable)
@@ -1235,6 +1235,7 @@ _EditPresenter::Initialize(const _Control& control)
        __pInputConnection->Initialize(*__pEdit, *this, *this);
 
        __pTextObject->SetBounds(__textObjectBounds);
+       __pTextObject->HideRearSpace(TEXT_OBJECT_SPACE_HIDE_TYPE_NONE);
 
        __maximumFlexibleHeight = GetMaxLineCount() * __pFont->GetMaxHeight() + __verticalMargin;
 
@@ -3597,6 +3598,12 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
 
                return true;
        }
+       else if (_KEY_OEM_1 == keyCode)
+       {
+               __pClipboard->ShowPopup(CLIPBOARD_DATA_TYPE_TEXT, *__pEdit);
+               __isClipboardExist = true;
+               return true;
+       }
 
        return false;
 }
index fe5dd6f..30e8a12 100644 (file)
@@ -323,6 +323,8 @@ public:
        bool IsBounded(void) const;
        void SetControlInitialBounds(Tizen::Graphics::FloatRectangle initBounds);
        bool IsUpdateInitialBounds(void);
+       virtual Tizen::Graphics::Rectangle GetTextBounds(void) const;
+       virtual Tizen::Graphics::FloatRectangle GetTextBoundsF(void) const;
 
 protected:
        void StopTitleSlidingTimer(void);
@@ -335,8 +337,6 @@ protected:
        result CalculateCursorBounds(const Tizen::Graphics::Rectangle& textBounds, Tizen::Graphics::Rectangle& cursorBounds, int curPos = -1);
        result CalculateCursorBounds(const Tizen::Graphics::FloatRectangle& textBounds, Tizen::Graphics::FloatRectangle& cursorBounds, int curPos = -1);
        Tizen::Ui::Animations::_VisualElement* GetCursorVisualElement(void) const;
-       virtual Tizen::Graphics::Rectangle GetTextBounds(void) const;
-       virtual Tizen::Graphics::FloatRectangle GetTextBoundsF(void) const;
        result DrawBackground(Tizen::Graphics::Canvas& canvas, bool drawTitleText = true);
        result InitializeCursor(void);
        result DrawText(Tizen::Graphics::Canvas& canvas);