add patch
[framework/osp/uifw.git] / src / ui / controls / FUiCtrl_EditPresenter.cpp
index dd2d8d5..f6afed7 100755 (executable)
@@ -163,6 +163,7 @@ _EditPresenter::_EditPresenter(void)
        , __pCommandButton(null)
        , __pInputConnection(null)
        , __isInputConnectionBound(false)
+       , __sentKeypadEvent(CORE_KEYPAD_EVENT_STATUS_CLOSE)
        , __pClipboard(null)
        , __guideText()
        , __titleText()
@@ -292,11 +293,14 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                }
                else
                {
-                       if (!__isClipboardExist)
+                       if (GetLastSentKeypadEvent() != CORE_KEYPAD_EVENT_STATUS_OPEN)
                        {
-                               __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
+                               if (!__isClipboardExist)
+                               {
+                                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
+                               }
+                               __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
                        }
-                       __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
                }
        }
        else if (showState == INPUT_PANEL_SHOW_STATE_HIDE)// 1.unbound  2.bounded&usb off -> usb on 3.Flick keypad hide
@@ -352,7 +356,7 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
                }
                else
                {
-                       if (__isInputConnectionBound)// keypad drag down
+                       if (__isInputConnectionBound)// keypad hided by back key or prediction hided by usb mode changed(on -> off)
                        {
                                if (!__isKeypadCommandButtonVisible && !__isClipboardExist)
                                {
@@ -398,7 +402,7 @@ _EditPresenter::OnInputConnectionPanelShowStateChanged(InputConnection& source,
 
                                if (__pParentForm)
                                {
-                                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
                                        __pParentForm->DeflateClientRectHeight(0.0f);
                                }
 
@@ -1085,7 +1089,7 @@ _EditPresenter::OnClipboardPopupClosed(void)
                        AdjustParentPanelHeight(true);
                        if (__pParentForm)
                        {
-                               SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                               SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
                                __pParentForm->DeflateClientRectHeight(0.0f);
                                __pParentForm->Draw();
                        }
@@ -1147,7 +1151,7 @@ _EditPresenter::Dispose(void)
 
                if (__pParentForm)
                {
-                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
                        __pParentForm->DeflateClientRectHeight(0.0f);
                }
 
@@ -1383,6 +1387,19 @@ CATCH:
        return false;
 }
 
+void
+_EditPresenter::SetSentKeypadEvent(CoreKeypadEventStatus sentKeypadEvent)
+{
+       __sentKeypadEvent = sentKeypadEvent;
+}
+
+CoreKeypadEventStatus
+_EditPresenter::GetLastSentKeypadEvent(void)
+{
+       return __sentKeypadEvent;
+}
+
+
 _EditPresenter*
 _EditPresenter::CreateInstanceN(void)
 {
@@ -2767,7 +2784,7 @@ _EditPresenter::IsHorizontalDirection(const _TouchInfo& touchInfo)
                return true;
        }
 
-       FloatRectangle absoluteEditRect = __pEdit->GetAbsoluteBoundsF();
+       FloatRectangle absoluteEditRect = __pEdit->GetAbsoluteBoundsF(true);
        FloatPoint touchStartPoint = __pressedAbsolutePoint;
        //After internal touch core complete the float conversion, we need to change the code here
        FloatPoint touchPoint = touchInfo.GetCurrentPosition();
@@ -3143,14 +3160,14 @@ _EditPresenter::OnTouchPressed(const _Control& source, const _TouchInfo& touchIn
        __pScrollEffect->previousX = _CoordinateSystemUtils::ConvertToFloat(touchInfo.GetCurrentPosition().x);
        __pScrollEffect->currentX = _CoordinateSystemUtils::ConvertToFloat(touchInfo.GetCurrentPosition().x);
 
-       __pScrollEffect->previousAbsX = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF().x + touchInfo.GetCurrentPosition().x);
-       __pScrollEffect->currentAbsX = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF().x + touchInfo.GetCurrentPosition().x);
-       __pScrollEffect->previousAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF().y + touchInfo.GetCurrentPosition().y);
-       __pScrollEffect->currentAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF().y + touchInfo.GetCurrentPosition().y);
+       __pScrollEffect->previousAbsX = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF(true).x + touchInfo.GetCurrentPosition().x);
+       __pScrollEffect->currentAbsX = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF(true).x + touchInfo.GetCurrentPosition().x);
+       __pScrollEffect->previousAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF(true).y + touchInfo.GetCurrentPosition().y);
+       __pScrollEffect->currentAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF(true).y + touchInfo.GetCurrentPosition().y);
 
        __pScrollEffect->cursorPosition = GetCursorPosition();
 
-       FloatRectangle absoluteEditRect = __pEdit->GetAbsoluteBoundsF();
+       FloatRectangle absoluteEditRect = __pEdit->GetAbsoluteBoundsF(true);
 
        __pressedPoint = touchInfo.GetCurrentPosition();
        __pressedAbsolutePoint.x = __pressedPoint.x + absoluteEditRect.x;
@@ -3368,6 +3385,14 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI
                                }
                        }
                }
+               else
+               {
+                       if ((__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE) == false)
+                       {
+                               SetCursorPosition(GetTextLength());
+                       }
+               }
+
                FadeOutScrollBar();
                if (!__isCopyPasteManagerExist && !__pFlickAnimationTimer)
                {
@@ -3403,6 +3428,11 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI
 
                        if (IsCurrentFocused() && !tokenEditting && needToCreatePopup)
                        {
+                               if (__pPasswordTimer)
+                               {
+                                       ChangePasswordToEchoCharacter(__pTextBuffer, __echoChar);
+                                       StopPasswordTimer();
+                               }
                                __pCopyPasteManager = new (std::nothrow) _EditCopyPasteManager(*__pEdit);
                                SysTryReturn(NID_UI_CTRL, __pCopyPasteManager != null, false, E_SYSTEM, "Unable to create _EditCopyPasteManager instance.");
                                __pCopyPasteManager->AddCopyPasteEventListener(*this);
@@ -3484,6 +3514,11 @@ _EditPresenter::OnTouchReleased(const _Control& source, const _TouchInfo& touchI
        __isTouchMoving = false;
        __pEdit->Invalidate();
 
+       if (GetSearchBarFlag())
+       {
+               return false;
+       }
+
        return true;
 }
 
@@ -3651,7 +3686,7 @@ _EditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo
        __pScrollEffect->currentY = touchInfo.GetCurrentPosition().y;
 
        __pScrollEffect->previousAbsY = __pScrollEffect->currentAbsY;
-       __pScrollEffect->currentAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF().y + touchInfo.GetCurrentPosition().y);
+       __pScrollEffect->currentAbsY = _CoordinateSystemUtils::ConvertToFloat(__pEdit->GetAbsoluteBoundsF(true).y + touchInfo.GetCurrentPosition().y);
 
 //     float moveGap = __pScrollEffect->previousY - __pScrollEffect->currentY;
        float moveGap = __pScrollEffect->previousAbsY - __pScrollEffect->currentAbsY;
@@ -3661,7 +3696,7 @@ _EditPresenter::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo
                __isMovingCursorByTouchMove = false;
        }
 
-       if (!(__pEdit->GetEditStyle() & EDIT_STYLE_NOSCROLL))
+       if (!(__pEdit->GetEditStyle() & EDIT_STYLE_NOSCROLL) && !(__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN))
        {
                if (__pScrollBar)
                {
@@ -4095,7 +4130,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
 
                        if (__pParentPanel)
                        {
-                               panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF();
+                               panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF(true);
                                GetCursorBounds(true, absCursorBounds);
 
                                if (!panelAbsBounds.Contains(FloatPoint(absCursorBounds.x, absCursorBounds.y + absCursorBounds.height)))
@@ -4167,7 +4202,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
 
                        if (__pParentPanel)
                        {
-                               panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF();
+                               panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF(true);
                                GetCursorBounds(true, absCursorBounds);
                                if (!panelAbsBounds.Contains(FloatPoint(absCursorBounds.x, absCursorBounds.y)))
                                {
@@ -4237,7 +4272,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
 
                        if (__pParentPanel)
                        {
-                               panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF();
+                               panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF(true);
                                GetCursorBounds(true, absCursorBounds);
 
                                if (!panelAbsBounds.Contains(FloatPoint(absCursorBounds.x, absCursorBounds.y + absCursorBounds.height)))
@@ -4286,7 +4321,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
 
                        if (__pParentPanel)
                        {
-                               panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF();
+                               panelAbsBounds = __pParentPanel->GetAbsoluteBoundsF(true);
                                GetCursorBounds(true, absCursorBounds);
 
                                if (!panelAbsBounds.Contains(FloatPoint(absCursorBounds.x, absCursorBounds.y + absCursorBounds.height)))
@@ -4362,7 +4397,7 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
        }
        else if (_KEY_OEM_1 == keyCode)
        {
-               __pClipboard->ShowPopup(CLIPBOARD_DATA_TYPE_TEXT, *__pEdit);
+               __pClipboard->ShowPopup(CLIPBOARD_DATA_TYPE_TEXT, *__pEdit, true);
                __clipboardConnected = true;
                return true;
        }
@@ -4370,6 +4405,22 @@ _EditPresenter::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo)
        {
                return true;
        }
+       else if (_KEY_TAB == keyCode)
+       {
+               if (__isCopyPasteManagerExist)
+               {
+                       InitializeCopyPasteManager();
+                       if ((__pEdit->GetEditStyle() & EDIT_STYLE_TOKEN) == false)
+                       {
+                               DrawText();
+                       }
+                       else
+                       {
+                               __pEdit->Invalidate();
+                       }
+               }
+               return false;
+       }
 
        return false;
 }
@@ -4512,6 +4563,8 @@ _EditPresenter::OnClipboardPopupClosed(const ClipboardItem* pClipboardItem)
                SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
        }
 
+       ScrollPanelToCursorPosition();
+
        __pEdit->SendTextEvent(CORE_TEXT_EVENT_CHANGED);
 
        __pEdit->Invalidate();
@@ -4578,6 +4631,12 @@ _EditPresenter::OnLongPressGestureDetected(void)
 
                FinishTextComposition();
 
+               if (__pPasswordTimer)
+               {
+                       ChangePasswordToEchoCharacter(__pTextBuffer, __echoChar);
+                       StopPasswordTimer();
+               }
+
                int cursorPos = GetCursorPositionAt(__pressedPoint);
                if (cursorPos != -1)
                {
@@ -4970,6 +5029,10 @@ _EditPresenter::PasteText(void)
        delete pClipboardItem;
 
        ReplaceTextIntoPasswordHyphenString();
+       if (__pEdit->GetEditStyle() & EDIT_STYLE_PASSWORD)
+       {
+               __pTextObject->NotifyTextChanged(__pTextBuffer, 0, __pTextString->GetLength(), 0);
+       }
 
        ScrollPanelToCursorPosition();
 
@@ -6457,7 +6520,7 @@ _EditPresenter::ChangeToUnbindState(bool removeFocus)
                        __isInputConnectionBound = false;
 
                        AdjustParentPanelHeight(true);
-                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
                        __pParentForm->DeflateClientRectHeight(0);
 
                        if (!__pEdit->IsFullScreenKeypadEdit())
@@ -6652,7 +6715,7 @@ _EditPresenter::ScrollText(float distance)
 bool
 _EditPresenter::IsContained(FloatRectangle& paramRect) const
 {
-       FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF();
+       FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(true);
 
        if ((paramRect.x < absBounds.x) ||
                (paramRect.y < absBounds.y) ||
@@ -6675,7 +6738,7 @@ _EditPresenter::CalculateAbsoluteCursorBounds(int index, FloatRectangle& absCurs
        float cursorRelativeX = 0.0f;
        float cursorRelativeY = 0.0f;
 
-       FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF();
+       FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(true);
 
        __pTextObject->SetBounds(GetTextBoundsF());
        if (index != __cursorPos)
@@ -6739,7 +6802,7 @@ _EditPresenter::CalculateAbsoluteCursorBounds(int rowIndex, int columnIndex, Flo
        float cursorRelativeX = 0.0f;
        float cursorRelativeY = 0.0f;
 
-       FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF();
+       FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(true);
 
        __pTextObject->SetBounds(GetTextBoundsF());
 
@@ -6796,7 +6859,7 @@ _EditPresenter::GetCursorBounds(bool isAbsRect, FloatRectangle& cursorBounds)
 
        if (isAbsRect)
        {
-               FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF();
+               FloatRectangle absBounds = __pEdit->GetAbsoluteBoundsF(true);
                cursorBounds.x += absBounds.x;
                cursorBounds.y += absBounds.y;
        }
@@ -6880,7 +6943,7 @@ _EditPresenter::SetKeypadCommandButton(const FloatRectangle& bounds)
        {
                __pCommandButton->SetResizable(true);
                __pCommandButton->SetMovable(true);
-               SysLog(NID_UI_CTRL, "Command position changed!!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
+               SysLog(NID_UI_CTRL, "Command position changed!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
                r = __pCommandButton->SetBounds(bounds);
 
                __pCommandButton->SetResizable(false);
@@ -6924,7 +6987,7 @@ _EditPresenter::SetKeypadCommandButton(const FloatRectangle& bounds)
 
        __pCommandButton->SetResizable(true);
        __pCommandButton->SetMovable(true);
-       SysLog(NID_UI_CTRL, "Command created!!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
+       SysLog(NID_UI_CTRL, "Command created!!! bounds(%f, %f, %f, %f)", bounds.x, bounds.y, bounds.width, bounds.height);
        r = __pCommandButton->SetBounds(bounds);
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
@@ -7017,11 +7080,11 @@ _EditPresenter::SetFooterVisible(bool isVisible)
                {
                        if (isVisible)
                        {
-                               SysLog(NID_UI_CTRL, "SetFooterVisible TRUE!!!!!");
+                               SysLog(NID_UI_CTRL, "SetFooterVisible TRUE!!!");
                        }
                        else
                        {
-                               SysLog(NID_UI_CTRL, "SetFooterVisible FALSE!!!!!");
+                               SysLog(NID_UI_CTRL, "SetFooterVisible FALSE!!!");
                        }
 
                        __footerVisibleChanged = true;
@@ -7068,7 +7131,7 @@ _EditPresenter::ShowFullscreenKeypad(void)
 
                if (__pParentForm)
                {
-                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
                        __pParentForm->DeflateClientRectHeight(0);
                        __pParentForm->Draw();
                }
@@ -7219,18 +7282,18 @@ _EditPresenter::CheckKeypadExist(_ControlOrientation orientation)
        {
                if ((absKeypadBounds.y != screenSize.height))
                {
-                       SysLog(NID_UI_CTRL, "KEYPAD EXIST!!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
+                       SysLog(NID_UI_CTRL, "KEYPAD EXIST!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
                        return true;
                }
                else
                {
-                       SysLog(NID_UI_CTRL, "NO KEYPAD!!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
+                       SysLog(NID_UI_CTRL, "NO KEYPAD!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
                        return false;
                }
        }
        else
        {
-               SysLog(NID_UI_CTRL, "NO KEYPAD!!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
+               SysLog(NID_UI_CTRL, "NO KEYPAD!!!Keypad(y: %f, w: %f, h: %f)", absKeypadBounds.y, absKeypadBounds.width, absKeypadBounds.height);
                return false;
        }
 }
@@ -7308,7 +7371,7 @@ _EditPresenter::ShowKeypad(bool focus)
        //layout rearrange
        if (__isUSBKeyboardConnected)
        {
-               SysLog(NID_UI_CTRL, "ShowKeypad called in USB ON mode!!!!");
+               SysLog(NID_UI_CTRL, "ShowKeypad called in USB ON mode!!!");
 
                __isKeypadExist = CheckKeypadExist(__pEdit->GetOrientation()); //prediction alreaedy exists
 
@@ -7326,9 +7389,15 @@ _EditPresenter::ShowKeypad(bool focus)
                        SetFooterVisible(false);
                        ChangeLayoutInternal(__pEdit->GetOrientation());
                        AdjustParentPanelHeight(false);
+                       ScrollPanelToCursorPosition();
 
                        __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
                        __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
+
+                       if (__pParentForm)
+                       {
+                               __pParentForm->Draw();
+                       }
                }
                else
                {
@@ -7339,16 +7408,38 @@ _EditPresenter::ShowKeypad(bool focus)
 
                        if (__isKeypadExist)
                        {
+                               if (__pParentForm)
+                               {
+                                       sendKeypadEventForcely = !__pParentForm->IsDeflated();
+                               }
+
+                               if (sendKeypadEventForcely)
+                               {
+                                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CREATED);
+                                       __pEdit->AttachScrollPanelEvent();
+                                       __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_CREATED);
+                               }
+
                                ChangeLayoutInternal(__pEdit->GetOrientation());
                                AdjustParentPanelHeight(false);
+                               ScrollPanelToCursorPosition();
+
+                               if (__pParentForm)
+                               {
+                                       __pParentForm->Draw();
+                               }
+
+                               if (sendKeypadEventForcely)
+                               {
+                                       __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_OPEN);
+                                       __pEdit->SendScrollPanelEvent(CORE_OVERLAY_CONTROL_OPENED);
+                               }                                                       
                        }
                }
-
-               ScrollPanelToCursorPosition();
        }
        else
        {
-               SysLog(NID_UI_CTRL, "ShowKeypad called in USB OFF mode!!!!");
+               SysLog(NID_UI_CTRL, "ShowKeypad called in USB OFF mode!!!");
 
                __isKeypadExist = CheckKeypadExist(__pEdit->GetOrientation()); //call once only from here.
 
@@ -7432,7 +7523,10 @@ _EditPresenter::ShowKeypad(bool focus)
                {
                        if(!__isClipboardExist && __pParentPanel)
                        {
-                               __initialParentHeight = 0.0f;
+                               if (__initialParentHeight)
+                               {
+                                       AdjustParentPanelHeight(true);
+                               }
                        }
                        ScrollPanelToCursorPosition();
                }
@@ -7486,7 +7580,7 @@ _EditPresenter::ChangeLayout(_ControlOrientation orientation)
 
                if (__pParentForm)
                {
-                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
                        __pParentForm->DeflateClientRectHeight(0.0f);
                }
 
@@ -7683,6 +7777,7 @@ _EditPresenter::AdjustParentPanelHeight(bool restore)
 {
        if (__pParentPanel == null)
        {
+               SysLog(NID_UI_CTRL, "__pParentPanel is NULL!!!, so skip resizing scrollpanel");
                return;
        }
 
@@ -7734,6 +7829,10 @@ _EditPresenter::AdjustParentPanelHeight(bool restore)
                        __pParentPanel->SetBounds(scrollPanelBounds);
                        __pParentPanel->Invalidate();
                }
+               else
+               {
+                       SysLog(NID_UI_CTRL, "initialParentHeight is ZERO!!!, so skip scrollPanel height recovery!!!");
+               }
        }
        else
        {
@@ -7774,7 +7873,7 @@ _EditPresenter::AdjustParentPanelHeight(bool restore)
                        GET_SHAPE_CONFIG(FOOTER::HEIGHT, orientation, commandButtonHeight);
                }
 
-               absScrollPanelBounds = __pParentPanel->GetAbsoluteBoundsF();
+               absScrollPanelBounds = __pParentPanel->GetAbsoluteBoundsF(true);
                displayedPanelHeight = screenSize.height - commandButtonHeight - absScrollPanelBounds.y;
                gapY = (absKeypadBounds.y - commandButtonHeight)- absScrollPanelBounds.y;
 
@@ -7873,7 +7972,7 @@ _EditPresenter::HideKeypad(bool focus)
 
        if (__isUSBKeyboardConnected)
        {
-               SysLog(NID_UI_CTRL, "HideKeypad called in USB ON mode!!!!");
+               SysLog(NID_UI_CTRL, "HideKeypad called in USB ON mode!!!");
                if (__pCommandButton && __isKeypadCommandButtonVisible)
                {
                        SetFooterVisible(true);
@@ -7882,7 +7981,7 @@ _EditPresenter::HideKeypad(bool focus)
 
                        if (__pParentForm)
                        {
-                               SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                               SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
                                __pParentForm->DeflateClientRectHeight(0.0f);
                        }
 
@@ -7893,7 +7992,7 @@ _EditPresenter::HideKeypad(bool focus)
        }
        else
        {
-               SysLog(NID_UI_CTRL, "HideKeypad called in USB OFF mode!!!!");
+               SysLog(NID_UI_CTRL, "HideKeypad called in USB OFF mode!!!");
                if (__pCommandButton && __isKeypadCommandButtonVisible)
                {
                        if (!__isKeypadExist)
@@ -7902,7 +8001,7 @@ _EditPresenter::HideKeypad(bool focus)
 
                                if (__pParentForm)
                                {
-                                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!!!!!!!!");
+                                       SysLog(NID_UI_CTRL, "Form deflate RESET!!!");
                                        __pParentForm->DeflateClientRectHeight(0.0f);
                                }
                                __pEdit->SendKeypadEvent(GetKeypadAction(), CORE_KEYPAD_EVENT_STATUS_CLOSE);
@@ -9609,6 +9708,9 @@ _EditPresenter::ChangePasswordToEchoCharacter(wchar_t* dspStrBuffer, wchar_t ech
        dspStrBuffer[bufferLength] = null;
        __isCursorChanged = true;
 
+       __pTextObject->NotifyTextChanged(__pTextBuffer, 0, __pTextString->GetLength(), 0);
+       UpdateComponentInformation();
+
        return r;
 }
 
@@ -10394,8 +10496,8 @@ _EditPresenter::ScrollPanelToTop(bool show)
        if (!__pParentPanel)
                return;
 
-       FloatRectangle editAbsoluteBounds = __pEdit->GetAbsoluteBoundsF();
-       FloatRectangle panelAbsoluteBounds = __pParentPanel->GetAbsoluteBoundsF();
+       FloatRectangle editAbsoluteBounds = __pEdit->GetAbsoluteBoundsF(true);
+       FloatRectangle panelAbsoluteBounds = __pParentPanel->GetAbsoluteBoundsF(true);
        float scrollPosition = __pParentPanel->GetScrollPosition() + (editAbsoluteBounds.y - panelAbsoluteBounds.y);
 
        __pParentPanel->SetScrollPosition(scrollPosition);
@@ -10416,6 +10518,8 @@ _EditPresenter::ScrollPanelToCursorPosition(bool show)
 
        result r = E_SUCCESS;
 
+       UpdateComponentInformation();
+
        FloatRectangle absCursorBounds(0.0f, 0.0f, 0.0f, 0.0f);
        r = CalculateAbsoluteCursorBounds(__cursorPos, absCursorBounds);
 
@@ -10424,7 +10528,7 @@ _EditPresenter::ScrollPanelToCursorPosition(bool show)
                return;
        }
 
-       FloatRectangle absPanelRect = __pParentPanel->GetAbsoluteBoundsF();
+       FloatRectangle absPanelRect = __pParentPanel->GetAbsoluteBoundsF(true);
        float panelHeight = __pParentPanel->GetBoundsF().height;
 
        float scrollPosition = __pParentPanel->GetScrollPosition();
@@ -10444,8 +10548,19 @@ _EditPresenter::ScrollPanelToCursorPosition(bool show)
        if (upSideGap > 0.0f || downSideGap > 0.0f)
        {
                float gap = 0.0f;
-               float topTextMargin = __textObjectBounds.y;
-               float bottomTextMargin = __pEdit->GetBoundsF().height - __textObjectBounds.y -  __textObjectBounds.height;
+               float topTextMargin = 0.0f;
+               float bottomTextMargin = 0.0f;
+
+               if (__pEdit->GetEditStyle() & EDIT_STYLE_SINGLE_LINE)
+               {
+                       topTextMargin = __pEdit->GetBoundsF().y;
+                       bottomTextMargin = __pEdit->GetBoundsF().height;
+               }
+               else
+               {
+                       topTextMargin = __textObjectBounds.y;
+                       bottomTextMargin = __pEdit->GetBoundsF().height - __textObjectBounds.y - __textObjectBounds.height;
+               }
 
                if (upSideGap > 0.0f)
                {