Fix N_SE-45120
authorTaejun <tj.twt.park@samsung.com>
Mon, 8 Jul 2013 12:37:48 +0000 (21:37 +0900)
committerTaejun <tj.twt.park@samsung.com>
Mon, 8 Jul 2013 12:37:48 +0000 (21:37 +0900)
Change-Id: Ie728e51cb0e0a8d05ebc2b29021ceaac89eb1436

src/ui/controls/FUiCtrl_Edit.cpp
src/ui/controls/FUiCtrl_EditPresenter.cpp
src/ui/inc/FUiCtrl_EditPresenter.h

index b865dba..3795d65 100755 (executable)
@@ -2152,7 +2152,13 @@ _Edit::OnAncestorEnableStateChanged(const _Control& control)
 
        if (!enableState)
        {
-               _pEditPresenter->ChangeToUnbindState();
+               _pEditPresenter->ChangeToUnbindState(false);
+       }
+
+       if (this == dynamic_cast< const _Edit* >(&control))
+       {
+               _pEditPresenter->SetKeypadEventSkipped(!enableState);
+               _pEditPresenter->SetCursorDisabled(!enableState);
        }
 
        Invalidate();
@@ -2168,7 +2174,7 @@ _Edit::OnAncestorVisibleStateChanged(const _Control& control)
 
        if (!visibleState)
        {
-               _pEditPresenter->ChangeToUnbindState();
+               _pEditPresenter->ChangeToUnbindState(false);
        }
 
        Invalidate();
index 4fd45c6..5e19fe7 100755 (executable)
@@ -1326,6 +1326,10 @@ _EditPresenter::IsCurrentFocused(void) const
                        return true;
                }
        }
+       else
+       {
+               return __pEdit->IsInternalFocused();
+       }
 }
 
 _EditPresenter*
@@ -5798,7 +5802,17 @@ _EditPresenter::SetViewModeEnabled(bool enable)
 
        if (__pInputConnection)
        {
-               __pInputConnection->SetKeyEventSkipped(enable);
+               if (enable)
+               {
+                       __pInputConnection->SetKeyEventSkipped(true);
+               }
+               else
+               {
+                       if (IsKeypadEnabled())
+                       {
+                               __pInputConnection->SetKeyEventSkipped(false);
+                       }
+               }
        }
 
        return __pEditModel->SetViewModeEnabled(enable);
@@ -5901,12 +5915,38 @@ _EditPresenter::SetKeypadEnabled(bool enable)
 
        if (__pInputConnection)
        {
-               __pInputConnection->SetKeyEventSkipped(!enable);
+               if (!enable)
+               {
+                       __pInputConnection->SetKeyEventSkipped(true);
+               }
+               else
+               {
+                       if (!__pEditModel->IsViewModeEnabled())
+                       {
+                               __pInputConnection->SetKeyEventSkipped(false);
+                       }
+               }
        }
 
        return;
 }
 
+void
+_EditPresenter::SetKeypadEventSkipped(bool skip)
+{
+       if (skip)
+       {
+               __pInputConnection->SetKeyEventSkipped(true);
+       }
+       else
+       {
+               if (__pEdit->IsEnabled() && !__pEditModel->IsViewModeEnabled() && IsKeypadEnabled())
+               {
+                       __pInputConnection->SetKeyEventSkipped(false);
+               }
+       }
+}
+
 bool
 _EditPresenter::IsKeypadEnabled(void)
 {
@@ -6382,7 +6422,7 @@ _EditPresenter::OnFrameRestored(const _Frame& source)
 }
 
 void
-_EditPresenter::ChangeToUnbindState(void)
+_EditPresenter::ChangeToUnbindState(bool removeFocus)
 {
        if(__latestBoundedContext != (unsigned int)this)//context is already changed.
        {
@@ -6396,10 +6436,7 @@ _EditPresenter::ChangeToUnbindState(void)
 
        if (__isInputConnectionBound)
        {
-               if (__isKeypadExist)
-               {
-                       HideKeypad(false);
-               }
+               HideKeypad(removeFocus);
 
                if (__isClipboardExist)
                {
@@ -11429,6 +11466,11 @@ _EditPresenter::IsClearIconPressed(void) const
 result
 _EditPresenter::DrawFocusRing(Tizen::Graphics::Canvas& canvas) const
 {
+       if (IsViewModeEnabled() || !__pEdit->IsEnabled())
+       {
+               return E_SUCCESS;
+       }
+
        result r = E_SUCCESS;
        Bitmap* pFocusRing = null;
        Color color = __pEdit->GetColor(EDIT_STATUS_HIGHLIGHTED);
index 029331f..3451755 100755 (executable)
@@ -141,7 +141,7 @@ public:
        virtual result Draw(Tizen::Graphics::Canvas& canvas);
        virtual result DrawCursor(Tizen::Graphics::Canvas& canvas, Tizen::Graphics::FloatRectangle& cursorRect, bool isCursorOpaque);
        virtual result DrawScrollBar(void);
-       virtual void ChangeToUnbindState(void);
+       virtual void ChangeToUnbindState(bool removeFocus);
        virtual bool OnFocusGained(void);
        virtual bool OnFocusLost(void);
 
@@ -253,6 +253,7 @@ public:
        bool IsFocused(void) const;
        bool IsInternalFocused(void) const;
        bool IsKeypadActionEnabled(void) ;
+       void SetKeypadEventSkipped(bool skip);
        bool IsKeypadEnabled(void) ;
        bool IsLowerCaseModeEnabled(void) const;
        bool IsKeypadCommandButtonVisible(void) const;