fixed bug(N_SE-44505,N_SE-44386,N_SE-44366,N_SE-44393)
authorChulheon <ch.jeong47@samsung.com>
Wed, 3 Jul 2013 07:17:01 +0000 (16:17 +0900)
committerChulheon <ch.jeong47@samsung.com>
Wed, 3 Jul 2013 07:39:43 +0000 (16:39 +0900)
Change-Id: I40229adb464e283032d0fb40f060ad76e14ec3aa

src/ui/controls/FUiCtrl_EditCopyPasteManager.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/inc/FUi_ResourceEditConfig.h
src/ui/resource/FUi_ResourceEditConfig.cpp

index 46bbaf4..6f5baee 100644 (file)
@@ -1187,7 +1187,6 @@ bool
 _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo)
 {
        int cursorPos = -1;
-       int previousCursorPos = -1;
        FloatRectangle cursorRect(0.0f, 0.0f, 0.0f, 0.0f);
        FloatRectangle absCursorRect(0.0f, 0.0f, 0.0f, 0.0f);
        FloatRectangle rect = GetBoundsF();
@@ -1195,7 +1194,6 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
        FloatPoint touchPoint(0.0f, 0.0f);
        FloatPoint checkPoint(0.0f, 0.0f);
        __isTouchMoving = true;
-       bool cursorChange = false;
 
        _Edit* pEdit = __pCopyPasteManager->GetEdit();
        SysTryReturn(NID_UI_CTRL, pEdit, false, E_INVALID_STATE, "[E_INVALID_STATE] pEdit is null.\n");
@@ -1218,23 +1216,11 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
        absTextObjectBounds.y = absEditBounds.y + textObjectBounds.y;
        absTextObjectBounds.width = textObjectBounds.width;
        absTextObjectBounds.height  = textObjectBounds.height;
-       bool  needToFixYPosition= false;
-
        if (__touchPressedPoint.x == point.x && __touchPressedPoint.y == point.y)
        {
                return true;
        }
 
-       if (!__singleHandler)
-       {
-               previousCursorPos = __pCopyPasteManager->GetCursorPosition();
-       }
-
-       FloatPoint absoluteTouchMovedPoint = FloatPoint(GetBoundsF().x + point.x, GetBoundsF().y + point.y);
-       if (__handlerDirection == HANDLER_DIRECTION_REVERSE_2 || __handlerDirection == HANDLER_DIRECTION_REVERSE_3)
-       {
-               absoluteTouchMovedPoint.y += (GetBoundsF().height + absCursorRect.height);
-       }
        if (__rowIndex == -1 && __columnIndex == -1)
        {
                pEditPresenter->CalculateCursorBounds(pEditPresenter->GetTextBoundsF(), cursorRect,__handlerCursorPos);
@@ -1246,25 +1232,97 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
                pEditPresenter->CalculateAbsoluteCursorBounds(__rowIndex, __columnIndex, absCursorRect);
        }
 
-       if (absTextObjectBounds.height >= (totalHeight - firstDisplayY))
+       FloatPoint absoluteTouchMovedPoint = FloatPoint(GetBoundsF().x + point.x, GetBoundsF().y + point.y);
+       //Calculate handler's position
+       if (__singleHandler)
        {
-               absTextObjectBounds.height = totalHeight - firstDisplayY;
-               absTextObjectBounds.y += absCursorRect.height/2.0f;
-               if (absTextObjectBounds.y > absoluteTouchMovedPoint.y || (absTextObjectBounds.y + absTextObjectBounds.height) < absoluteTouchMovedPoint.y)
+               touchPoint.x = absoluteTouchMovedPoint.x;
+               if (__handlerDirection == HANDLER_DIRECTION_NONE)
+               {
+                       touchPoint.y = absoluteTouchMovedPoint.y - GetBoundsF().height/2.0f;
+               }
+               else // HANDLER_DIRECTION_REVERSE_2
                {
-                       needToFixYPosition = true;
+                       touchPoint.y = absoluteTouchMovedPoint.y + GetBoundsF().height/2.0f;
                }
        }
        else
        {
-               absTextObjectBounds.y += absCursorRect.height/2.0f;
-               if (firstDisplayY == 0.0f && absTextObjectBounds.y > absoluteTouchMovedPoint.y)
+               if (__leftHandler)
+               {
+                       if (__handlerDirection == HANDLER_DIRECTION_NONE)
+                       {
+                               touchPoint.x = absoluteTouchMovedPoint.x + GetBoundsF().width/2.0f;
+                               touchPoint.y = absoluteTouchMovedPoint.y - GetBoundsF().height/2.0f;
+                       }
+                       else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_1)
+                       {
+                               touchPoint.x = absoluteTouchMovedPoint.x - GetBoundsF().width/2.0f;
+                               touchPoint.y = absoluteTouchMovedPoint.y - GetBoundsF().height/2.0f;
+                       }
+                       else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_2)
+                       {
+                               touchPoint.x = absoluteTouchMovedPoint.x + GetBoundsF().width/2.0f;
+                               touchPoint.y = absoluteTouchMovedPoint.y + GetBoundsF().height/2.0f;                    
+                       }
+                       else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_3)
+                       {
+                               touchPoint.x = absoluteTouchMovedPoint.x - GetBoundsF().width/2.0f;
+                               touchPoint.y = absoluteTouchMovedPoint.y + GetBoundsF().height/2.0f;
+                       }
+               }
+               else
+               {
+                       if (__handlerDirection == HANDLER_DIRECTION_NONE)
+                       {
+                               touchPoint.x = absoluteTouchMovedPoint.x - GetBoundsF().width/2.0f;
+                               touchPoint.y = absoluteTouchMovedPoint.y - GetBoundsF().height/2.0f;
+                       }
+                       else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_1)
+                       {
+                               touchPoint.x = absoluteTouchMovedPoint.x + GetBoundsF().width/2.0f;
+                               touchPoint.y = absoluteTouchMovedPoint.y - GetBoundsF().height/2.0f;
+                       }
+                       else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_2)
+                       {
+                               touchPoint.x = absoluteTouchMovedPoint.x - GetBoundsF().width/2.0f;
+                               touchPoint.y = absoluteTouchMovedPoint.y + GetBoundsF().height/2.0f;
+                       }
+                       else if (__handlerDirection == HANDLER_DIRECTION_REVERSE_3)
+                       {
+                               touchPoint.x = absoluteTouchMovedPoint.x + GetBoundsF().width/2.0f;
+                               touchPoint.y = absoluteTouchMovedPoint.y + GetBoundsF().height/2.0f;
+                       }
+               }
+       }
+       if (totalHeight - firstDisplayY < absTextObjectBounds.height)
+       {
+               absTextObjectBounds.height = totalHeight - firstDisplayY - 1.0f; // check TextObject
+       }
+
+       if (totalLine != 1) //single line edit doesn't need to adjust horizontal value.
+       {
+               if (absTextObjectBounds.x > touchPoint.x)
+               {
+                       touchPoint.x = absTextObjectBounds.x;
+               }
+               if (absTextObjectBounds.x + absTextObjectBounds.width <= touchPoint.x) // check FloatRectangle Contains?
+               {
+                       touchPoint.x = absTextObjectBounds.x + absTextObjectBounds.width - 1.0f;
+               }
+       }
+       if (absTextObjectBounds.y > touchPoint.y)
+       {
+               if (totalLine == 1 || firstDisplayY == 0.0f) // whether need to scroll the text or not
                {
-                       needToFixYPosition = true;
+                       touchPoint.y = absTextObjectBounds.y; //not need to scroll the text.
                }
-               else if ((totalHeight - firstDisplayY) == absTextObjectBounds.height && (absTextObjectBounds.y + absTextObjectBounds.height) < absoluteTouchMovedPoint.y)
+       }
+       if (absTextObjectBounds.y + absTextObjectBounds.height < touchPoint.y)
+       {
+               if (totalLine == 1 || (totalHeight - firstDisplayY < textObjectBounds.height) || curCursorLine == (totalLine - 1)) // || pTextObject->IsDisplayedLastLine()) // whether need to scroll the text or not
                {
-                       needToFixYPosition = true;
+                       touchPoint.y = absTextObjectBounds.y + absTextObjectBounds.height - 1.0f; // check TextObject
                }
        }
 
@@ -1282,271 +1340,108 @@ _EditCopyPasteHandler::OnTouchMoved(const _Control& source, const _TouchInfo& to
 
                if (curCursorLine == nextHandlerLine)
                {
-                       if (__leftHandler && absoluteTouchMovedPoint.y > absCursorRect.y)
+                       if (__leftHandler && absoluteTouchMovedPoint.y >= absCursorRect.y + absCursorRect.height)
                        {
-                               needToFixYPosition = true;
+                               touchPoint.y = absCursorRect.y + absCursorRect.height/2.0f;
                        }
-                       else if (!__leftHandler && absoluteTouchMovedPoint.y < absCursorRect.y)
+                       else if (!__leftHandler && absoluteTouchMovedPoint.y <= absCursorRect.y + absCursorRect.height)
                        {
-                               needToFixYPosition = true;
+                               touchPoint.y = absCursorRect.y + absCursorRect.height/2.0f;
                        }
                }
        }
 
-       touchPoint.x = cursorRect.x + (point.x - __touchPressedPoint.x);
-       if (totalLine == 1 || needToFixYPosition)
-       {
-               touchPoint.y = cursorRect.y + cursorRect.height/2;
-       }
-       else
+       touchPoint.x = touchPoint.x - absEditBounds.x - textObjectBounds.x;
+       touchPoint.y = touchPoint.y - absEditBounds.y - textObjectBounds.y;
+
+       if (Math::Abs(touchPoint.y) < 1)
        {
-               touchPoint.y = cursorRect.y + cursorRect.height + (point.y - __touchPressedPoint.y);
+               touchPoint.y = 0.0f;
        }
+
        int rowIndex = -1;
        int columnIndex = -1;
-       bool cursorPosFromTouch = false;
-       cursorPos = pEditPresenter->GetCursorPositionAt(touchPoint, rowIndex, columnIndex, true);
+       cursorPos = pTextObject->GetTextIndexFromPosition(touchPoint.x, touchPoint.y, rowIndex, columnIndex, true);
 
-       if (cursorPos != -1 && __handlerCursorPos != cursorPos)
+       if (__handlerCursorPos == cursorPos)
        {
-               cursorPosFromTouch = true;
-               FloatRectangle cursorBounds(0.0f, 0.0f, 0.0f, 0.0f);
-               if (__rowIndex == -1 && __columnIndex == -1)
-               {
-                       pEdit->CalculateAbsoluteCursorBounds(cursorPos, cursorBounds);
-               }
-               else
-               {
-                       pEditPresenter->CalculateAbsoluteCursorBounds(__rowIndex, __columnIndex, cursorBounds);
-               }
-               cursorChange = true;
-               checkPoint.x = cursorBounds.x;
-
-               if (absoluteTouchMovedPoint.y -__absoluteTouchPressedPoint.y >= 0.0f || totalLine == 1)
-               {
-                       checkPoint.y = cursorBounds.y + cursorBounds.height;
-               }
-               else
-               {
-                       checkPoint.y = cursorBounds.y;
-               }
+               return true;
        }
 
-       if (cursorPos == -1 || (cursorChange && !__pCopyPasteManager->CheckHandleBounds(FloatPoint(checkPoint.x, checkPoint.y))))
+       if (cursorPos == -1)
        {
-               if (cursorPos != -1)
+               //To get cursorPos
+               if (totalLine != 1)
                {
-                       if (totalLine == 1)
+                       if (absoluteTouchMovedPoint.y > (absCursorRect.y + absCursorRect.height))
                        {
-                               pTextObject->SetFirstDisplayLineIndexFromTextIndex(cursorPos);
-                       }
-                       else
-                       {
-                               if (absoluteTouchMovedPoint.y -__absoluteTouchPressedPoint.y >= 0.0f)
-                               {
-                                       if (curCursorLine < totalLine - 1)
-                                       {
-                                               if (!pTextObject->IsDisplayedLastLine())
-                                               {
-                                                       int line = pTextObject->GetFirstDisplayLineIndex();
-                                                       pTextObject->SetFirstDisplayLineIndex(line+1);
-                                               }
-                                               else
-                                               {
-                                                       if (__singleHandler || __pCopyPasteManager->CheckHandlePosition(__leftHandler, cursorPos))
-                                                       {
-                                                               __pCopyPasteManager->SetCursorPosition(cursorPos);
-                                                               pEditPresenter->ScrollPanelToCursorPosition(true);
-                                                       }
-                                                       else
-                                                       {
-                                                               return true;
-                                                       }
-                                               }
-                                       }
-                               }
-                               else
-                               {
-                                       if (curCursorLine !=0)
-                                       {
-                                               if (!pTextObject->IsDisplayedFirstLine())
-                                               {
-                                                       int line = pTextObject->GetFirstDisplayLineIndex();
-                                                       pTextObject->SetFirstDisplayLineIndex(line-1);
-                                               }
-                                               else
-                                               {
-                                                       __pCopyPasteManager->SetCursorPosition(cursorPos);
-                                                       pEditPresenter->ScrollPanelToCursorPosition(true);
-                                               }
-                                       }
-                               }
-                       }
-               }
-               else
-               {
-                       if (totalLine == 1)
-                       {
-                               if (point.x - __touchPressedPoint.x == 0.0f)
-                               {
-                                       return true;
-
-                               }
-                               else if (point.x - __touchPressedPoint.x > 0.0f)
-                               {
-                                       if (__handlerCursorPos == pEditPresenter->GetTextLength())
-                                       {
-                                               cursorPos = __handlerCursorPos;
-                                       }
-                                       else
-                                       {
-                                               cursorPos = __handlerCursorPos + 1;
-
-                                               if (!__singleHandler && __leftHandler && (cursorPos == pEditPresenter->GetTextLength()))
-                                               {
-                                                       cursorPos = __handlerCursorPos;
-                                               }
-                                       }
-                               }
-                               else
+                               if (curCursorLine < totalLine - 1)
                                {
-                                       if (__handlerCursorPos != 0)
+                                       int offset = __handlerCursorPos - pTextObject->GetFirstTextIndexAt(curCursorLine);
+                                       int firstTextIndex = pTextObject->GetFirstTextIndexAt(curCursorLine+1);
+                                       cursorPos = offset + firstTextIndex;
+                                       int textLength = pTextObject->GetTextLengthAt(curCursorLine+1);
+                                       if (offset > textLength)
                                        {
-                                               cursorPos = __handlerCursorPos - 1;
-
-                                               if (!__singleHandler && __leftHandler)
-                                               {
-                                                       pTextObject->SetFirstDisplayLineIndexFromTextIndex(cursorPos);
-                                               }
+                                               cursorPos = firstTextIndex+textLength;
                                        }
                                }
-                               if (point.y < 0.0f || (point.y > GetBoundsF().height))
-                               {
-                                       return true;
-                               }
                        }
                        else
                        {
-                               if (absoluteTouchMovedPoint.y -__absoluteTouchPressedPoint.y >= 0.0f)
+                               if (curCursorLine !=0)
                                {
-                                       if (curCursorLine < totalLine - 1)
+                                       if (__rowIndex == 0)
                                        {
-                                               int offset = __handlerCursorPos - pTextObject->GetFirstTextIndexAt(curCursorLine);
-                                               int firstTextIndex = pTextObject->GetFirstTextIndexAt(curCursorLine+1);
-                                               cursorPos = offset + firstTextIndex;
-                                               int textLength = pTextObject->GetTextLengthAt(curCursorLine+1);
-                                               if (offset > textLength)
-                                               {
-                                                       cursorPos = firstTextIndex+textLength;
-                                               }
-                                               if (!pTextObject->IsDisplayedLastLine())
-                                               {
-                                                       int line = pTextObject->GetFirstDisplayLineIndex();
-                                                       pTextObject->SetFirstDisplayLineIndex(line+1);
-                                                       __pCopyPasteManager->SetCursorPosition(cursorPos);
-                                                       pEditPresenter->ScrollPanelToCursorPosition(true);
-                                               }
-                                               else
-                                               {
-                                                       if (__singleHandler || __pCopyPasteManager->CheckHandlePosition(__leftHandler, cursorPos))
-                                                       {
-                                                               __pCopyPasteManager->SetCursorPosition(cursorPos);
-                                                               pEditPresenter->ScrollPanelToCursorPosition(true);
-                                                       }
-                                                       else
-                                                       {
-                                                               return true;
-                                                       }
-                                               }
+                                               return true;
                                        }
-                               }
-                               else
-                               {
-                                       if (curCursorLine !=0)
+                                       int offset = __handlerCursorPos - pTextObject->GetFirstTextIndexAt(curCursorLine);
+                                       int firstTextIndex = pTextObject->GetFirstTextIndexAt(curCursorLine-1);
+                                       cursorPos = offset + firstTextIndex;
+                                       int textLength = pTextObject->GetTextLengthAt(curCursorLine-1);
+                                       if (offset > textLength)
                                        {
-                                               if (__rowIndex == 0)
-                                               {
-                                                       return true;
-                                               }
-                                               int offset = __handlerCursorPos - pTextObject->GetFirstTextIndexAt(curCursorLine);
-                                               int firstTextIndex = pTextObject->GetFirstTextIndexAt(curCursorLine-1);
-                                               cursorPos = offset + firstTextIndex;
-                                               int textLength = pTextObject->GetTextLengthAt(curCursorLine-1);
-                                               if (offset > textLength)
-                                               {
-                                                       cursorPos = firstTextIndex+textLength;
-                                               }
-                                               if (!pTextObject->IsDisplayedFirstLine())
-                                               {
-                                                       int line = pTextObject->GetFirstDisplayLineIndex();
-                                                       pTextObject->SetFirstDisplayLineIndex(line-1);
-                                                       __pCopyPasteManager->SetCursorPosition(cursorPos);
-                                                       pEditPresenter->ScrollPanelToCursorPosition(true);
-                                               }
-                                               else
-                                               {
-                                                       __pCopyPasteManager->SetCursorPosition(cursorPos);
-                                                       pEditPresenter->ScrollPanelToCursorPosition(true);
-                                               }
+                                               cursorPos = firstTextIndex+textLength;
                                        }
                                }
                        }
                }
+               if (cursorPos == -1)
+               {
+                       return true;
+               }
        }
 
-       if (!__singleHandler && !__pCopyPasteManager->CheckHandlePosition(__leftHandler, cursorPos))
+       if (__handlerCursorPos == cursorPos)
        {
-               __pCopyPasteManager->SetCursorPosition(previousCursorPos);
-               pEditPresenter->SetCursorChangedFlag(!__leftHandler);
-
-               if ((__pCopyPasteManager->GetEdit()->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
-               {
-                       _EditCopyPasteManager::HandlerType nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_MAX;
-                       if (__leftHandler)
-                       {
-                               nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_RIGHT;
-                       }
-                       else
-                       {
-                               nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_LEFT;
-                       }
-                       int nextHandler = __pCopyPasteManager->GetHandlerCursorPosition(nextHandlerType);
-                       if (Math::Abs(nextHandler - __handlerCursorPos) <= 1)
-                       {
-                               pTextObject->SetFirstDisplayLineIndexFromTextIndex(nextHandler);
-                       }
-               }
                return true;
        }
-
-       if (cursorPos == -1 || __handlerCursorPos == cursorPos)
+       if (!__singleHandler)
        {
-               if (!__singleHandler)
+               if (!__pCopyPasteManager->CheckHandlePosition(__leftHandler, cursorPos))
                {
-                       __pCopyPasteManager->SetCursorPosition(previousCursorPos);
-                       pEditPresenter->SetCursorChangedFlag(!__leftHandler);
-               }
-               if (!__singleHandler && (__pCopyPasteManager->GetEdit()->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
-               {
-                       _EditCopyPasteManager::HandlerType nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_MAX;
-                       if (__leftHandler)
-                       {
-                               nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_RIGHT;
-                       }
-                       else
-                       {
-                               nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_LEFT;
-                       }
-                       int nextHandler = __pCopyPasteManager->GetHandlerCursorPosition(nextHandlerType);
-                       if (Math::Abs(nextHandler - __handlerCursorPos) <= 1)
+                       if (totalLine == 1)
                        {
-                               pTextObject->SetFirstDisplayLineIndexFromTextIndex(nextHandler);
+                               _EditCopyPasteManager::HandlerType nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_MAX;
+                               if (__leftHandler)
+                               {
+                                       nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_RIGHT;
+                               }
+                               else
+                               {
+                                       nextHandlerType = _EditCopyPasteManager::HANDLER_TYPE_LEFT;
+                               }
+                               int nextHandler = __pCopyPasteManager->GetHandlerCursorPosition(nextHandlerType);
+                               if (Math::Abs(nextHandler - __handlerCursorPos) <= 1)
+                               {
+                                       pTextObject->SetFirstDisplayLineIndexFromTextIndex(nextHandler);
+                               }
                        }
+                       return true;
                }
-               return true;
        }
 
-       if (cursorPosFromTouch && (rowIndex != -1 && columnIndex != -1))
+       if (rowIndex > -1 && columnIndex > -1)
        {
                __rowIndex = rowIndex;
                __columnIndex =  columnIndex;
@@ -1655,7 +1550,7 @@ _EditCopyPasteHandler::OnBoundsChanging(const FloatRectangle& bounds)
                _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
                SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
-               pEcoreEvas->SetWindowBounds(*GetRootWindow(), _CoordinateSystemUtils::ConvertToInteger(bounds));
+               pEcoreEvas->SetWindowBounds(*GetRootWindow(), bounds);
                result r = GetLastResult();
                SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
        }
@@ -1689,7 +1584,7 @@ _EditCopyPasteHandler::SetWindowBounds(const FloatRectangle& bounds)
        _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
        SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
-       pEcoreEvas->SetWindowBounds(*GetRootWindow(), _CoordinateSystemUtils::ConvertToInteger(bounds));
+       pEcoreEvas->SetWindowBounds(*GetRootWindow(), bounds);
        result r = GetLastResult();
        SysTryReturn(NID_UI, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -1928,12 +1823,17 @@ _EditCopyPasteManager::CreateCopyPastePopup(void)
        {
                editShowAreaAbsRect = editAbsRect;
                FloatRectangle textObjectBounds = __pEditPresenter->GetTextBoundsF();
-               editShowAreaAbsRect.x += textObjectBounds.x;
-               editShowAreaAbsRect.y += textObjectBounds.y;
-               editShowAreaAbsRect.width = textObjectBounds.width;
-               if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
+
+               if (!(__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN))
                {
-                       editShowAreaAbsRect.height = textObjectBounds.height;
+                       editShowAreaAbsRect.x += textObjectBounds.x;
+                       editShowAreaAbsRect.y += textObjectBounds.y;
+                       editShowAreaAbsRect.width = textObjectBounds.width;
+
+                       if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
+                       {
+                               editShowAreaAbsRect.height = textObjectBounds.height;
+                       }
                }
 
                if (commandButtonExist)
@@ -2237,8 +2137,8 @@ _EditCopyPasteManager::CreateHandle(void)
                __pEdit->CalculateAbsoluteCursorBounds(start, startRect);
                __pEdit->CalculateAbsoluteCursorBounds(end, endRect);
 
-               Point leftHandler(startRect.x, startRect.y + startRect.height);
-               Point rightHandler(endRect.x, endRect.y + endRect.height);
+               FloatPoint leftHandler(startRect.x, startRect.y + startRect.height);
+               FloatPoint rightHandler(endRect.x, endRect.y + endRect.height);
 
                __pHandle[HANDLER_TYPE_LEFT] = _EditCopyPasteHandler::CreateInstanceN(leftHandler, start, this, false, true);
                __pHandle[HANDLER_TYPE_RIGHT] = _EditCopyPasteHandler::CreateInstanceN(rightHandler, end, this, false, false);
@@ -2247,7 +2147,7 @@ _EditCopyPasteManager::CreateHandle(void)
        {
                FloatRectangle centerRect;
                __pEdit->CalculateAbsoluteCursorBounds(__pEdit->GetCursorPosition(), centerRect);
-               Point centerHandler(centerRect.x, centerRect.y + centerRect.height);
+               FloatPoint centerHandler(centerRect.x, centerRect.y + centerRect.height);
 
                __pHandle[HANDLER_TYPE_CENTER] = _EditCopyPasteHandler::CreateInstanceN(centerHandler, __pEdit->GetCursorPosition(), this, true, true);
 #if EDIT_COPY_PASTE_MAGNIFIER
@@ -2264,11 +2164,11 @@ _EditCopyPasteManager::Show(void)
                if (__pEdit->GetCursorPosition() != __pHandle[HANDLER_TYPE_CENTER]->GetHandlerCursorPosition())
                {
                        __pHandle[HANDLER_TYPE_CENTER]->SetHandlerCursorPosition(__pEdit->GetCursorPosition());
-//                     __pHandle[HANDLER_TYPE_CENTER]->MoveCopyPasteMagnifier();
                }
                __pHandle[HANDLER_TYPE_CENTER]->AdjustBounds();
                __pHandle[HANDLER_TYPE_CENTER]->CheckReverseStatus();
-               __pEdit->Invalidate();
+               __pHandle[HANDLER_TYPE_CENTER]->Invalidate();
+               __pEditPresenter->DrawText();
        }
 
        if (__pHandle[HANDLER_TYPE_LEFT] && __pHandle[HANDLER_TYPE_RIGHT])
@@ -2278,7 +2178,7 @@ _EditCopyPasteManager::Show(void)
                __pHandle[HANDLER_TYPE_RIGHT]->CheckReverseStatus();
                __pHandle[HANDLER_TYPE_LEFT]->Invalidate();
                __pHandle[HANDLER_TYPE_RIGHT]->Invalidate();
-               __pEdit->Invalidate();
+               __pEditPresenter->DrawText();
        }
 
        if (__pCopyPastePopup)
@@ -2306,13 +2206,17 @@ _EditCopyPasteManager::CheckHandleBounds(const FloatPoint& point)
        FloatRectangle panelAbsoulteBounds(0.0f, 0.0f, 0.0f, 0.0f);
        FloatRectangle editAbsBounds = __pEdit->GetAbsoluteBoundsF();
        FloatRectangle textObjectBounds = __pEditPresenter->GetTextBoundsF();
-       editAbsBounds.x += textObjectBounds.x;
-       editAbsBounds.y += textObjectBounds.y;
-       editAbsBounds.width = textObjectBounds.width;
 
-       if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
+       if (!(__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN))
        {
-               editAbsBounds.height = textObjectBounds.height;
+               editAbsBounds.x += textObjectBounds.x;
+               editAbsBounds.y += textObjectBounds.y;
+               editAbsBounds.width = textObjectBounds.width;
+
+               if (!(__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE))
+               {
+                       editAbsBounds.height = textObjectBounds.height;
+               }
        }
 
        _Toolbar* pCommandButton = __pEditPresenter->GetKeypadCommandButton();
index 422f2de..5d86c09 100755 (executable)
@@ -1023,6 +1023,13 @@ _EditPresenter::OnClipboardPopupClosed(void)
 {
        if (__clipboardConnected)
        {
+               if (__isCopyPasteManagerExist)
+               {
+                       InitializeCopyPasteManager();
+                       __pTextObject->SetBlock(false);
+                       __isTextBlocked = false;
+               }
+
                if (__pClipboard)
                {
                        __pClipboard->HidePopup();
@@ -1198,13 +1205,9 @@ _EditPresenter::Dispose(void)
 
        if (__pScrollBar != null && __pEdit != null)
        {
-               result r = __pEdit->DetachSystemChild(*__pScrollBar);
-
-               if (r == E_SUCCESS)
-               {
-                       delete __pScrollBar;
-                       __pScrollBar = null;
-               }
+               __pEdit->DetachSystemChild(*__pScrollBar);
+               delete __pScrollBar;
+               __pScrollBar = null;
        }
 
        if (__pFlickAnimationTimer)
@@ -2181,7 +2184,18 @@ _EditPresenter::DrawClearIcon(Canvas& canvas)
        Bitmap* pEditReplacedBitmapClear = null;
        Color editClearIconColor;
 
-       if (__isClearIconPressed)
+       if (!__pEdit->IsEnabled())
+       {
+               r = GET_BITMAP_CONFIG_N(EDIT::CLEAR_ICON_DISABLED, BITMAP_PIXEL_FORMAT_ARGB8888, pEditBitmapClear);
+
+               if (pEditBitmapClear == null)
+               {
+                       return E_SYSTEM;
+               }
+
+               GET_COLOR_CONFIG(EDIT::CLEAR_ICON_DISABLED, editClearIconColor);
+       }
+       else if (__isClearIconPressed)
        {
                r = GET_BITMAP_CONFIG_N(EDIT::CLEAR_ICON_PRESSED, BITMAP_PIXEL_FORMAT_ARGB8888, pEditBitmapClear);
 
@@ -8780,11 +8794,31 @@ _EditPresenter::SetClientBounds(void)
        }
        else if (editStyle & EDIT_STYLE_TITLE_TOP)
        {
+               result r = E_SUCCESS;
                float titletHeight = 0.0f;
                float titleTextTopMargin = 0.0f;
                GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_RECT_HEIGHT, orientation, titletHeight);
                GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_TEXT_TOP_MARGIN, orientation, titleTextTopMargin);
 
+               _FontImpl* fontImpl = _FontImpl::GetInstance(*__pFont);
+               SysTryReturnVoidResult(NID_UI_CTRL, fontImpl != null, E_SYSTEM, "[E_SYSTEM] fontImpl is null.");
+
+               float originalSize = fontImpl->GetSizeF();
+               float titleFontSize = 0.0f;
+               GET_SHAPE_CONFIG(EDIT::DEFAULT_TITLE_FONT_SIZE, __pEdit->GetOrientation(), titleFontSize);
+
+               r = fontImpl->SetSize(titleFontSize);
+               SysTryReturnVoidResult(NID_UI_CTRL, !(IsFailed(r)), r, "SetSize is failed.");
+
+               if (titletHeight < fontImpl->GetMaxHeightF())
+               {
+                       titleTextTopMargin -= (fontImpl->GetMaxHeightF()-titletHeight);
+                       titletHeight = fontImpl->GetMaxHeightF();
+               }
+
+               r = fontImpl->SetSize(originalSize);
+               SysTryReturnVoidResult(NID_UI_CTRL, !(IsFailed(r)), r, "SetSize is failed.");
+
                leftBorder = leftMargin;
                rightBorder = rightMargin;
                topBorder = titletHeight + titleTextTopMargin;
@@ -8814,6 +8848,7 @@ _EditPresenter::SetInitialEditFieldBounds(void)
        float titleTextTopMargin = 0.0f;
        float titleTextBottomMargin = 0.0f;
        float clearIconWidth = 0.0f;
+       float titletHeight = 0.0f;
        _ControlOrientation orientation = __pEdit->GetOrientation();
 
        GET_SHAPE_CONFIG(EDIT::FIELD_BOTTOM_MARGIN, orientation, bottomMargin);
@@ -8826,6 +8861,7 @@ _EditPresenter::SetInitialEditFieldBounds(void)
        GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_TEXT_TOP_MARGIN, orientation, titleTextTopMargin);
        GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_TEXT_BOTTOM_MARGIN, orientation, titleTextBottomMargin);
        GET_SHAPE_CONFIG(EDIT::CLEAR_ICON_WIDTH, orientation, clearIconWidth);
+       GET_SHAPE_CONFIG(EDIT::FIELD_TITLE_RECT_HEIGHT, orientation, titletHeight);
 
        if (!(editStyle & EDIT_STYLE_SINGLE_LINE))
        {
@@ -8862,9 +8898,27 @@ _EditPresenter::SetInitialEditFieldBounds(void)
                __textObjectBounds.height = __clientBounds.height - textBottomMargin;
 
                __titleBounds.x = titleTextLeftMargin;
+
+               _FontImpl* fontImpl = _FontImpl::GetInstance(*__pFont);
+               SysTryReturnResult(NID_UI_CTRL, fontImpl != null, E_SYSTEM, "fontImpl is null.");
+
+               float originalSize = fontImpl->GetSizeF();
+               float titleFontSize = 0.0f;
+               GET_SHAPE_CONFIG(EDIT::DEFAULT_TITLE_FONT_SIZE, __pEdit->GetOrientation(), titleFontSize);
+
+               r = fontImpl->SetSize(titleFontSize);
+               SysTryReturnResult(NID_UI_CTRL, !(IsFailed(r)), r, "SetSize is failed.");
+
+               if (titletHeight < fontImpl->GetMaxHeightF())
+               {
+                       titleTextTopMargin -= (fontImpl->GetMaxHeightF()-titletHeight);
+               }
+
+               r = fontImpl->SetSize(originalSize);
+               SysTryReturnResult(NID_UI_CTRL, !(IsFailed(r)), r, "SetSize is failed.");
+
                __titleBounds.y = titleTextTopMargin;
-               __titleBounds.width = bounds.width - __titleBounds.x
-                                                          - titleTextRightMargin;
+               __titleBounds.width = bounds.width - __titleBounds.x - titleTextRightMargin;
                __titleBounds.height = bounds.height - __titleBounds.y - __clientBounds.height
                                                                - bottomMargin;
 
index f917c3c..f83ec1e 100644 (file)
@@ -39,9 +39,10 @@ DECLARE_UI_CONFIG(EDIT);
        DECLARE_COLOR_CONFIG(GUIDE_TEXT_NORMAL, 13)
        DECLARE_COLOR_CONFIG(CLEAR_ICON_NORMAL, 14)
        DECLARE_COLOR_CONFIG(CLEAR_ICON_PRESSED, 15)
-       DECLARE_COLOR_CONFIG(CUT_LINK_TEXT_NORMAL, 16)
-       DECLARE_COLOR_CONFIG(CUT_LINK_BG_NORMAL, 17)
-       DECLARE_COLOR_CONFIG(CURSOR_NORMAL, 18)
+       DECLARE_COLOR_CONFIG(CLEAR_ICON_DISABLED, 16)
+       DECLARE_COLOR_CONFIG(CUT_LINK_TEXT_NORMAL, 17)
+       DECLARE_COLOR_CONFIG(CUT_LINK_BG_NORMAL, 18)
+       DECLARE_COLOR_CONFIG(CURSOR_NORMAL, 19)
 
        DECLARE_IMAGE_CONFIG(BG_NORMAL, 1)
        DECLARE_IMAGE_CONFIG(BG_PRESSED, 2)
@@ -60,15 +61,16 @@ DECLARE_UI_CONFIG(EDIT);
        DECLARE_IMAGE_CONFIG(BG_ROUND_EFFECT, 15)
        DECLARE_IMAGE_CONFIG(CLEAR_ICON_NORMAL, 16)
        DECLARE_IMAGE_CONFIG(CLEAR_ICON_PRESSED, 17)
-       DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, 18)
-       DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, 19)
-       DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, 20)
-       DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_NORMAL, 21)
-       DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_NORMAL, 22)
-       DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_NORMAL, 23)
-       DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_NORMAL, 24)
-       DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_NORMAL, 25)
-       DECLARE_IMAGE_CONFIG(BG_RING_FOCUSED, 26)
+       DECLARE_IMAGE_CONFIG(CLEAR_ICON_DISABLED, 18)
+       DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, 19)
+       DECLARE_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, 20)
+       DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, 21)
+       DECLARE_IMAGE_CONFIG(GROUPED_TOP_BG_EFFECT_NORMAL, 22)
+       DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_NORMAL, 23)
+       DECLARE_IMAGE_CONFIG(GROUPED_MIDDLE_BG_EFFECT_NORMAL, 24)
+       DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_NORMAL, 25)
+       DECLARE_IMAGE_CONFIG(GROUPED_BOTTOM_BG_EFFECT_NORMAL, 26)
+       DECLARE_IMAGE_CONFIG(BG_RING_FOCUSED, 27)
 
        DECLARE_DIMENSION_CONFIG(MIN_SIZE, 1)
        DECLARE_DIMENSION_CONFIG(TITLE_STYLE_MIN_SIZE, 2)
index 05a3954..cac6cff 100644 (file)
@@ -36,8 +36,9 @@ START_UI_CONFIG(EDIT);
        ADD_COLOR_CONFIG(TEXT_HIGHLIGHTED, $F011L1);
        ADD_COLOR_CONFIG(TEXT_DISABLED, $F011L1D);
        ADD_COLOR_CONFIG(GUIDE_TEXT_NORMAL, $F051);
-       ADD_COLOR_CONFIG(CLEAR_ICON_NORMAL, $F041i);
-       ADD_COLOR_CONFIG(CLEAR_ICON_PRESSED, $B042);
+       ADD_COLOR_CONFIG(CLEAR_ICON_NORMAL, $F041i); //$F053);
+       ADD_COLOR_CONFIG(CLEAR_ICON_PRESSED, $B042);//$F053P);
+       ADD_COLOR_CONFIG(CLEAR_ICON_DISABLED, $F053D);
        ADD_COLOR_CONFIG(CUT_LINK_TEXT_NORMAL, $B052L5);
        ADD_COLOR_CONFIG(CUT_LINK_BG_NORMAL, $B0217);
        ADD_COLOR_CONFIG(CURSOR_NORMAL, $F052);
@@ -59,6 +60,7 @@ START_UI_CONFIG(EDIT);
        ADD_IMAGE_CONFIG(BG_ROUND_EFFECT, #00_edit_field_line_round_bg_01.#.png);
        ADD_IMAGE_CONFIG(CLEAR_ICON_NORMAL, #00_edit_field_clear.png);
        ADD_IMAGE_CONFIG(CLEAR_ICON_PRESSED, #00_edit_field_clear.png);
+       ADD_IMAGE_CONFIG(CLEAR_ICON_DISABLED, #00_edit_field_clear.png);
        ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_NORMAL, #00_edit_group_bg.#.png);
        ADD_IMAGE_CONFIG(GROUPED_SINGLE_BG_EFFECT_NORMAL, #00_edit_group_bg_ef.#.png);
        ADD_IMAGE_CONFIG(GROUPED_TOP_BG_NORMAL, #00_edit_group_bg_top.#.png);